project QadFinancials > class BDInvoice > business logic query DInvoiceMovementByDebtorPm

Description

This query will return all the prepayments data within a specific date range for a customer.


Parameters


iiCompanyIdintegerthe id of the entity
itFromPostingDatedatestart date filter
itToPostingDatedateend date filter
iiDebtorIDintegerthe id of the customer


query condition


  each DInvoiceMovement where
DInvoiceMovement.Company_Id = iiCompanyId AND
DInvoiceMovement.DInvoiceMovementType = {&MOVEMENTTYPE-MOVEMENT} AND
DInvoiceMovement.Debtor_ID = iiDebtorID AND
DInvoiceMovement.DInvoiceMovementPostDate >= itFromPostingDate AND
DInvoiceMovement.DInvoiceMovementPostDate <= itToPostingDate

      first DInvoice (inner-join) where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.DInvoice_ID = DInvoiceMovement.DInvoice_ID AND

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

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

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

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

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

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

          first Posting (inner-join) where
Posting.Company_Id = iiCompanyId AND
Posting.Posting_ID = PostingLine.Posting_ID AND

              first Journal2 (inner-join) where
Journal2.SharedSet_Id = vi_JOURNAL_sharedset(iiCompanyId) AND
Journal2.Journal_ID = Posting.Journal_ID AND
Journal2.JournalTypeCode <> {&JOURNALTYPE-DEBTORPAYMENT}


query resultset tqDInvoiceMovementByDebtorPm


field namedata typedb fielddescription
tcBaseCurrencyCodecharacterCurrency1.CurrencyCodeCurrency Code
tiCompany_IDintegerDInvoice.Company_IDLink to Company
tcCompanyCodecharacterCompany.CompanyCodeEntity Code
tiCurrency_IDintegerPostingLine.Currency_IDCurrency Code
tcCurrencyCodecharacterCurrency2.CurrencyCodeCurrency Code
tiDebtor_IDintegerDInvoice.Debtor_IDLink to Debtor
tiDebtor_ID1integerDInvoiceMovement.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.
ttDInvoiceClosingDatedateDInvoice.DInvoiceClosingDateClosing Date. This field displays the date on which the open balance became zero.
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.
tlDInvoiceIsOpenlogicalDInvoice.DInvoiceIsOpenOpen.This field indicates if the invoice has been completely paid.
This field is updated automatically when complete payment is confirmed.
This field is read-only.
api annotation:PartialUpdate = yes - defaults to true
tdDInvoiceMovementDiscountTCdecimalDInvoiceMovement.DInvoiceMovementDiscountTCCInvoiceMovementDiscountTC. The amount of payment discount in TC.
tcDInvoiceMovementTypecharacterDInvoiceMovement.DInvoiceMovementTypeCInvoiceMovementType. "Initial" indicates that the movement represents the initial creation of the invoice, "movement" stands for all subsequent modifications of the invoice balance (payments, adjustments etc).
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.
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.
tcDocumentNumbercharactercalculated
tcJournalCodecharacterJournal2.JournalCodeA daybook code (maximum eight characters).
tcJournalInvoiceCodecharacterJournal1.JournalCodeA daybook code (maximum eight characters).
tcJournalTypeCodecharacterJournal2.JournalTypeCodeA daybook type code.
api annotation:Value for this field defaults to "Journal Entries".
tdOpenAmountCCdecimalcalculated
tdOpenAmountLCdecimalcalculated
tdOpenAmountTCdecimalcalculated
tdOriginalAmountCCdecimalcalculated
tdOriginalAmountLCdecimalcalculated
tdOriginalAmountTCdecimalcalculated
tiOverdueDaysintegercalculated
tdPaymentAmountTCdecimalcalculated
tiPosting_IDintegerPosting.Posting_IDRecord ID
ttPostingDatedatePosting.PostingDateThe accounting date on which the journal entry is posted. The posting date must be a valid calendar date and must be within the GL calendar year (PostingYear) and period (PostingPeriod).
tiPostingLine_IDintegerPostingLine.PostingLine_IDRecord ID
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
tdPostingLineExchangeRatedecimalPostingLine.PostingLineExchangeRateExchange Rate
api annotation:Default value for this field depends on the exchang erate shared set specified for the current domain.
tcPostingTextcharacterPosting.PostingTextFree text describing the posting.
api annotation:Value for this field defaults to blank
tiPostingVoucherintegerPosting.PostingVoucherVoucher is a sequential number that uniquely identifies the journal entry (within the combination of an entity and a daybook code).
api annotation:In create mode,enter 0 in this field - the voucher number is generated by the system. In Modify/Delete, the correct voucher number must be entered because this identifies the record.
tiPostingYearintegerPosting.PostingYearThe GL calendar year for the posting.
tiWeekNumbersintegercalculated


Internal usage


QadFinancials
method BDebtor.GetDebtorPaymentData