project QadFinancials > class BDebtorReport > business logic query DebtorOpenItemsByStatement


Parameters


iiCompanyIdintegerCompany id
icFromDebtorCodecharacterFromDebtorCode
icToDebtorCodecharacterToDebtorCode
icCandoDebtorCodecharacterCandoDebtorCode
icFromBRCodecharacterFromBRCode
icToBRCodecharacterToBRCode
icCandoBRCodecharacterCandoBRCode
itStatementDatedate
icStatementCyclecharacter


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 AND
Debtor.DebtorStatementCycle can-do icStatementCycle

      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

      first Currency1 (inner-join) where
Currency1.Currency_ID = Debtor.Currency_ID AND

      each DInvoice (inner-join) where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.Debtor_ID = Debtor.Debtor_ID AND

          first Company (inner-join) where
Company.Company_Id = iiCompanyId AND
Company.Company_ID = DInvoice.Company_ID AND

          first Currency2 (inner-join) where
Currency2.Currency_ID = DInvoice.DInvoiceCurrency_ID AND

          each DInvoiceMovement (conditional-join) where
DInvoiceMovement.Company_Id = iiCompanyId AND
DInvoiceMovement.DInvoice_ID = DInvoice.DInvoice_ID AND

              first PostingLine (conditional-join) where
PostingLine.Company_Id = iiCompanyId AND
PostingLine.PostingLine_ID = DInvoiceMovement.PostingLine_ID AND

                  first Posting (conditional-join) where
Posting.Company_Id = iiCompanyId AND
Posting.Posting_ID = PostingLine.Posting_ID AND
Posting.PostingDate <= itStatementDate

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

          first PaymentCondition (inner-join) where
PaymentCondition.PaymentCondition_ID = DInvoice.NormalPaymentCondition_ID AND

          first Period (inner-join) where
Period.Company_Id = iiCompanyId AND
Period.Period_ID = DInvoice.Period_ID AND


query resultset tqDebtorOpenItemsByStatement


field namedata typedb fielddescription
tiBusinessRelation_IDintegerDebtor.BusinessRelation_IDBusiness Relation
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.
tcBusinessRelationName1characterBusinessRelation.BusinessRelationName1Name: The full name of the business relation.
This field sets the default name for linked addresses such as customers and suppliers.
api annotation:PartialUpdate = yes - defaults to the BusinessRelationCode.
tcBusinessRelationName2characterBusinessRelation.BusinessRelationName2Second Name. An extended name when the Name field is not large enough to contain all information.
This fielsd can be blank.
tcCompanyCodecharacterCompany.CompanyCodeEntity Code
tcCurrencyCodeLCcharacterCurrency1.CurrencyCodeCurrency Code
tcCurrencyCodeTCcharacterCurrency2.CurrencyCodeCurrency Code
tiCurrencyNumberOfDecimalsintegerCurrency1.CurrencyNumberOfDecimalsNumber of Decimals
tiDebtor_IDintegerDebtor.Debtor_IDRecord ID
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
tdDInvoiceBalanceCreditLCdecimalDInvoice.DInvoiceBalanceCreditLCBC Balance Amount CR. This field displays the sum of the credit amounts of all posting lines in transaction currency.
This field is calculated by the system using the TC Base Amount CR and the Exchange rate.
tdDInvoiceBalanceCreditTCdecimalDInvoice.DInvoiceBalanceCreditTCTC Balance Amount CR. This field displays the sum of the credit amounts of all posting lines in transaction currency.
tdDInvoiceBalanceDebitLCdecimalDInvoice.DInvoiceBalanceDebitLCBC Balance Amount DR. This field displays the sum of the debit amounts of all posting lines in transaction currency.
This field is calculated by the system using the TC Base Amount DR and the Exchange rate.
tdDInvoiceBalanceDebitTCdecimalDInvoice.DInvoiceBalanceDebitTCTC Balance Amount DR. This field displays the sum of the debit amounts of all posting lines in transaction currency.
ttDInvoiceDatedateDInvoice.DInvoiceDateInvoice Date. This field indicates the invoice creation date.This field is normallly prior to the posting date and within the same accounting period as the posting date. The date must be within the upper and lower date limits of an open GL period.
The system uses the invoice date with the credit terms to calculate due date and discount date.
api annotation:This field defaults to the DInvoicePostingDate.
tcDInvoiceDescriptioncharacterDInvoice.DInvoiceDescriptionDescription. A brief description of the invoice. This field is mandatory.
tcDInvoiceDITextcharacterDInvoice.DInvoiceDITextCIDescription. A brief description for the SI posting.
api annotation:This field defaults from the DInvoiceDescription.
ttDInvoiceDueDatedateDInvoice.DInvoiceDueDateDue Date. This field displays the date when payment is due, calculated by the system based on the credit terms and the invoice date. User can modify the due date without affecting the credit terms.
If the credit terms have a base date specified, this is used in the due date calculations rather than the invoice creation date.
tdDInvoiceOriginalCreditLCdecimalDInvoice.DInvoiceOriginalCreditLCBC Invoice Amount(CR). This field displays the credit total invoice amount in the base currency.
This field is calculated by the system using the TC Invoice Amount(CR) and the Exchange rate.
tdDInvoiceOriginalCreditTCdecimalDInvoice.DInvoiceOriginalCreditTCTC Invoice Amount CR. This field displays the credit total invoice amount in the transaction currency.
If you modify this field, the system automatically recalculates the exchange rate to ensure that the BC Invoice Amount remains the same.
tdDInvoiceOriginalDebitLCdecimalDInvoice.DInvoiceOriginalDebitLCBC Invoice Amount(DR). This field displays the debit total invoice amount in the base currency.
This field is calculated by the system using the TC Invoice Amount(DR) and the Exchange rate.
tdDInvoiceOriginalDebitTCdecimalDInvoice.DInvoiceOriginalDebitTCTC AP Amount. This field displays the debit total invoice amount in the transaction currency.
If you modify this field, the system automatically recalculates the exchange rate to ensure that the TC Invoice Amount remains the same.
tcDInvoicePurchaseOrdercharacterDInvoice.DInvoicePurchaseOrderPurchase Order.If a purchase order number was recorded on the original sales order, it displays in this field. This number indicates the original number of the document that initiated the sale, and can be useful when communicating with the customer.
tiDInvoiceReminderCountintegerDInvoice.DInvoiceReminderCountReminder Counter. This field displays the reminder level that applies to this invoice.
tcDInvoiceTSMNumbercharacterDInvoice.DInvoiceTSMNumberPayment Reference. This field contains a reference number to identify a customer payment for this invoice.
Normally this could be a unique transaction structured message (TSM) number. The TSM is a standard reference numbering system for electronic transfers,used by many banks.
tcDInvoiceTypecharacterDInvoice.DInvoiceTypeInvoice Type. This field displays the invoice type.
Invoice Correction and Credit Note Correction display as choices only when the appropriate daybook types have already been defined.
api annotation:PartialUpdate = yes - defaults to Invoice
tiDInvoiceVoucherintegerDInvoice.DInvoiceVoucherVoucher.This field displays the numeric identifier assigned to the posting.
When the daybook of the journal entry is charged(after transfer), the voucher is cleared.
Voucher must be unique in one GL period.
When the user input is zero, the system automatically assign a value not used yet for this field.
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tcPaymentConditionPaymentTypcharacterPaymentCondition.PaymentConditionPaymentTypPayment Type
tiPeriodYearintegerPeriod.PeriodYearGL Calendar Year
tdPostingLineCreditCCdecimalPostingLine.PostingLineCreditCCSC Credit
api annotation:Partial Update = yes - it will get a default value depending on the value of PostingLinCreditTC, PostingLineCCRate & PostingLineCCScale.
SC Amount = TC Amount * Exchange rate (TC/SC) * Scale Factor (TC/SC). If Partial Update is false, you should enter the correct value for this field
tdPostingLineCreditLCdecimalPostingLine.PostingLineCreditLCBC Credit
api annotation:Partial Update = yes - it will get a default value depends on the value of PostingLineCreditTC, PostingLineExchangeRate & PostingLineRateScale.
BC Amount = TC Amount * Exchange rate (TC/BC) * Scale Factor (TC/BC). If Partial Update is false, enter a value for this field.
tdPostingLineCreditTCdecimalPostingLine.PostingLineCreditTCTC Credit
tdPostingLineDebitCCdecimalPostingLine.PostingLineDebitCCSC Debit
api annotation:Partial Update = yes - it will get a default value depending on the value of PostingLineDebitTC, PostingLineCCRate & PostingLineCCScale.
SC Amount = TC Amount * Exchange rate (TC/SC) * Scale Factor (TC/SC). If Partial Update is false, enter the correct value for this field.
tdPostingLineDebitLCdecimalPostingLine.PostingLineDebitLCBC Debit
api annotation:Partial Update = yes - it will get a default value depending on the value of PostingLineDebitTC, PostingLineExchangeRate and PostingLineRateScale.
BC Amount = TC Amount * Exchange rate (TC/BC) * Scale Factor (TC/BC). If Partial Update = false, enter the correct value into this field.
tdPostingLineDebitTCdecimalPostingLine.PostingLineDebitTCTC Debit
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.
ti_sequenceintegercalculatedprimary index
tc_rowidcharactercalculated = rowid(Debtor),rowid(BusinessRelation),rowid(Currency1),rowid(DInvoice),rowid(Company),rowid(Currency2),rowid(DInvoiceMovement),rowid(PostingLine),rowid(Posting),rowid(Journal),rowid(PaymentCondition),rowid(Period)


Internal usage


QadFinancials
method BDebtorReport.DebtorAccountState