project QadFinancials > class BDDocument > business logic query DDocumentByDebtor


Parameters


iiCompanyIdintegerCompany id
iiDebtorIDinteger
itPaymentStartDatedate
itPaymentEndDatedate
ilDocumentIsOpenlogical


query condition


  each DDocument where
DDocument.DDocumentCreationDate <= itPaymentEndDate AND
DDocument.DDocumentCreationDate >= itPaymentStartDate AND
DDocument.Debtor_ID = iiDebtorID AND
DDocument.Company_ID <> ? AND
DDocument.DDocumentIsOpen = ilDocumentIsOpen

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

      each DDocumentInvoiceXref (conditional-join) where
DDocumentInvoiceXref.DDocument_ID = DDocument.DDocument_ID AND

          first DInvoice (conditional-join) where
DInvoice.DInvoice_ID = DDocumentInvoiceXref.DInvoice_ID AND
DInvoice.Company_ID = iiCompanyId

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

                  each CompanyProperty (conditional-join) where
CompanyProperty.Company_Id = iiCompanyId AND
CompanyProperty.Company_ID = Company.Company_ID AND

                      first Currency2 (conditional-join) where
Currency2.Currency_ID = CompanyProperty.Currency_ID AND

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

      first DPaySel (conditional-join) where
DPaySel.Company_Id = iiCompanyId AND
DPaySel.DPaySel_ID = DDocument.DPaySel_ID AND


query resultset tqDDocumentByDebtor


field namedata typedb fielddescription
tcBaseCurrencyCodecharacterCurrency2.CurrencyCodeCurrency Code
tiCompany_IDintegerDDocument.Company_IDLink to Company
tiCompany_ID2integerDInvoice.Company_IDLink to Company
tcCompanyCodecharacterCompany.CompanyCodeEntity Code
tiCurrency_IDintegerDDocument.Currency_IDCurrency Code
tcCurrencyCodecharacterCurrency1.CurrencyCodeCurrency Code
tiDDocument_IDintegerDDocument.DDocument_IDRecord ID
tcDDocumentBankImpRefcharacterDDocument.DDocumentBankImpRefBank Importing Reference
ttDDocumentCreationDatedateDDocument.DDocumentCreationDateCreation Date.This field indicate the payment creation date.
This field is read-only.
tiDDocumentCreationTimeintegerDDocument.DDocumentCreationTimeCreation Time. The time payment is created.
ttDDocumentDueDatedateDDocument.DDocumentDueDateDue Date. The date on which the payment is receivable.
tdDDocumentExchangeRatedecimalDDocument.DDocumentExchangeRateExchange Rate. This field holds the exchange rate applying to the transaction currency.
tdDDocumentInvoiceXrefAlloTCdecimalDDocumentInvoiceXref.DDocumentInvoiceXrefAlloTCTC Allocated Amount. This field indicates the invocie amount already Allocated in transaction currency.
tdDDocumentInvoiceXrefDiscTCdecimalDDocumentInvoiceXref.DDocumentInvoiceXrefDiscTCTC Discount Amount. This field indicates the discount amount of the invoice already allocated by transaction currency.
tdDDocumentInvoiceXrefIntTCdecimalDDocumentInvoiceXref.DDocumentInvoiceXrefIntTCTC Interest Amount
tlDDocumentIsOpenlogicalDDocument.DDocumentIsOpenOpen. This field indicates if the payment is completely paid already.
tiDDocumentNumberintegerDDocument.DDocumentNumberDocument Number. This field hold a unified number for report use.
tdDDocumentOriginalCreditBCdecimalDDocument.DDocumentOriginalCreditBCBC Original Credit
tdDDocumentOriginalCreditCCdecimalDDocument.DDocumentOriginalCreditCCSC Original Credit. This field hold the amount of the payment in management currency.
tdDDocumentOriginalCreditLCdecimalDDocument.DDocumentOriginalCreditLCBC Original Credit.This field holds the amount of the Payment in baisc currency.
tdDDocumentOriginalCreditTCdecimalDDocument.DDocumentOriginalCreditTCTC Original Credit. This field holds the debit value of the payment in transaction currency.
tdDDocumentOriginalDebitBCdecimalDDocument.DDocumentOriginalDebitBCBC Original Debit
tdDDocumentOriginalDebitCCdecimalDDocument.DDocumentOriginalDebitCCTC Original Debit. This field holds the debit value of the payment in management currency.
tdDDocumentOriginalDebitLCdecimalDDocument.DDocumentOriginalDebitLCTC Original Debit. This field holds the debit value of the payment in base currency.
tdDDocumentOriginalDebitTCdecimalDDocument.DDocumentOriginalDebitTCAmount.This field hold the value of the payment in the transaction currency. This field must be positive and can be entered manually or automatically by linking the payment to an open item.
tcDDocumentReferencecharacterDDocument.DDocumentReferenceReference. Reference text for the payment.
tcDDocumentStatuscharacterDDocument.DDocumentStatusStatus. The payment status. The default value for a new record is Initial.
tcDDocumentSubTypecharacterDDocument.DDocumentSubTypeSubtype. This read-only field indicates that the payment is manual or automatic. You create manual customer payments through the Customer Payment activities, and automatic payments through the Customer Payment Selections.
tcDDocumentTypecharacterDDocument.DDocumentTypePayment Instrument. The system displays the payment instrument associated with the payment format linked to the customer bank.
tiDDocumentValueDaysintegerDDocument.DDocumentValueDaysValue Days. A value for the number of days required by the bank to process the transaction. The default is based on the payment status entered.
tiDDocumentYearintegerDDocument.DDocumentYearYear/Number. This field displays the accounting year and payment sequence number, which is automatically generated by the accounting year.
tiDebtor_IDintegerDDocument.Debtor_IDCustomer
tiDebtor_ID2integerDInvoice.Debtor_IDLink to Debtor
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
tdDInvoiceBalanceCreditCCdecimalDInvoice.DInvoiceBalanceCreditCCBC 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 SC rate.
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.
tdDInvoiceBalanceDebitCCdecimalDInvoice.DInvoiceBalanceDebitCCSC Balance Amount DR. This field displays the sum of the debit amounts of all posting lines in statutory currency.
This field is calculated by the system using the TC Base Amount DR and the SC rate.
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.
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.
tcDInvoiceNumbercharactercalculated
tdDInvoiceOriginalCreditCCdecimalDInvoice.DInvoiceOriginalCreditCCSC Invoice Amount (CR). This field displays the credit total invoice amount in the statutory currency.
This field is calculated by the system using the TC Invoice Amount(CR) and the SC Rate.
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.
tdDInvoiceOriginalDebitCCdecimalDInvoice.DInvoiceOriginalDebitCCSC Invoice Amount (DR). This field displays the debit total invoice amount in the statutory currency.
This field is calculated by the system using the TC Invoice Amount(CR) and the SC Rate.
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.
ttDInvoicePaymentDatedateDInvoice.DInvoicePaymentDateExpected Payment Date.This field displays the date when payment is expected to be received. The expected payment date is used in cash flow reporting. If you manually change the due date to a date later than the expected payment date, this date is automatically updated.
api annotation:This field defaults to the due date when the invoice is created.
tiDInvoicePostingYearintegerDInvoice.DInvoicePostingYearYear.This field indicates the accounting year for the invoice.
If you modify these fields, the posting and tax dates are changed correspondingly.
api annotation:This field defaults to the accounting year associated with the posting date.
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.
tcDocumentNumbercharactercalculated
tiDPaySel_IDintegerDPaySel.DPaySel_IDRecord ID
tcDPaySelCodecharacterDPaySel.DPaySelCodePayment Selection
tiGL_IDintegerDDocument.GL_IDBank Account
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tcJournalTypeCodecharacterJournal.JournalTypeCodeA daybook type code.
api annotation:Value for this field defaults to "Journal Entries".
tdOpenAmountCCdecimalcalculated
tdOpenAmountLCdecimalcalculated
tdOpenAmountTCdecimalcalculated
tdOriginalAmountCCdecimalcalculated
tdOriginalAmountLCdecimalcalculated
tdOriginalAmountTCdecimalcalculated
tiOverdueDaysintegercalculated
tdPaymentOriginalAmountTCdecimalcalculated
tiWeekNumbersintegercalculated


Internal usage


QadFinancials
method BDebtor.GetActivityData
method BDebtor.GetDebtorPaymentData