project QadFinancials > class BDebtorReport > business logic query DebtorBalanceDHist


Parameters


iiCompanyIdintegerCompany id
icCandoBRCodecharacter
icCandoDebtorCodecharacter
icCandoGLCodecharacter
iiEndOfYearPeriodinteger
icFromBRCodecharacter
icFromDebtorCodecharacter
icFromGLCodecharacter
icToBRCodecharacter
icToDebtorCodecharacter
icToGLCodecharacter


query condition


  each Debtor where
Debtor.SharedSet_Id = vi_DEBTOR_sharedset(iiCompanyId) AND
Debtor.DebtorCode >= icFromDebtorCode AND
Debtor.DebtorCode <= icToDebtorCode AND
Debtor.DebtorCode can-do icCandoDebtorCode

      first BusinessRelation (inner-join) where
BusinessRelation.BusinessRelation_ID = Debtor.BusinessRelation_ID AND
BusinessRelation.BusinessRelationCode >= icFromBRCode AND
BusinessRelation.BusinessRelationCode <= icToBRCode AND
BusinessRelation.BusinessRelationCode can-do icCandoBRCode

      each DHist (inner-join) where
DHist.Company_Id = iiCompanyId AND
DHist.Debtor_ID = Debtor.Debtor_ID AND
DHist.DHistYearPeriodFrom <= iiEndOfYearPeriod AND
DHist.DHistYearPeriodTill >= iiEndOfYearPeriod

          first Currency (inner-join) where
Currency.Currency_ID = DHist.Currency_ID AND

          first GL (inner-join) where
GL.SharedSet_Id = vi_GL_sharedset(iiCompanyId) AND
GL.GL_ID = DHist.GL_ID AND
GL.GLCode >= icFromGLCode AND
GL.GLCode <= icToGLCode AND
GL.GLCode can-do icCandoGLCode

          first Journal (inner-join) where
Journal.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal.Journal_ID = DHist.Journal_ID AND


query resultset tqDebtorBalanceDHist


field namedata typedb fielddescription
tcBusinessRelationCodecharacterBusinessRelation.BusinessRelationCodeBusiness Relation. A code to identify the business relation.
If this field does not have a input from the user, the system automatically generates a number for the record based on the sequence defined in Business Relation Autonumber Create.
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tiCurrencyNumberOfDecimalsintegerCurrency.CurrencyNumberOfDecimalsNumber of Decimals
tiDebtor_IDintegerDebtor.Debtor_IDRecord ID
tcDebtorCodecharacterDebtor.DebtorCodeA code (maximum eight characters) that identifies a customer. If the code you specify matches an existing supplier code, a warning message displays. You can choose to ignore the warning, and create the record. However, when a supplier and customer share the same code, they must reference the same business relation.
api annotation:If you leave the Customer Code field blank, the system automatically generates a number for the record based on the sequence defined in Customer Autonumber Create.
tdDHistBalanceCCdecimalDHist.DHistBalanceCCSC Balance
tdDHistBalanceLCdecimalDHist.DHistBalanceLCBC Balance
tdDHistBalanceTCdecimalDHist.DHistBalanceTCTC Balance
tiGL_IDintegerGL.GL_IDRecord ID
tcGLCodecharacterGL.GLCodeA code identifying the GL account.
tcGLDescriptioncharacterGL.GLDescriptionA description of the GL account.
tcGLTypeCodecharacterGL.GLTypeCodeA code identifying the type of account.
tiJournal_IDintegerJournal.Journal_IDRecord ID
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tcJournalDescriptioncharacterJournal.JournalDescriptionA brief description of the daybook.
api annotation:Value for this field defaults to null.
tcJournalTypeCodecharacterJournal.JournalTypeCodeA daybook type code.
api annotation:Value for this field defaults to "Journal Entries".


Internal usage


QadFinancials
method BDebtorReport.DebtorAccountMovements