project QadFinancials > class BDebtorReport > business logic query DebtorMovements


Parameters


iiCompanyIdintegerCompany id
icCandoBRCodecharacter
icCandoDebtorCodecharacter
icCandoGLCodecharacter
icFromBRCodecharacter
icFromDebtorCodecharacter
icFromGLCodecharacter
iiFromYearPeriodinteger
icToBRCodecharacter
icToDebtorCodecharacter
icToGLCodecharacter
iiToYearPeriodinteger


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 DInvoiceMovement (inner-join) where
DInvoiceMovement.Company_Id = iiCompanyId AND
DInvoiceMovement.Debtor_ID = Debtor.Debtor_ID AND
DInvoiceMovement.DInvoiceMovementYearPeriod >= iiFromYearPeriod AND
DInvoiceMovement.DInvoiceMovementYearPeriod <= iiToYearPeriod

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

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

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

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

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

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

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


query resultset tqDebtorMovements


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.
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
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.
ttDInvoiceDiscountDueDatedateDInvoice.DInvoiceDiscountDueDateDiscount Due Date. This field displays the last date a discount applies, calculated by the system based on the credit terms and the invoice date.
You 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.
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.
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).
ttDInvoicePostingDatedateDInvoice.DInvoicePostingDatePosting Date. This field displays the date the sales-related invoice was generated by Invoice Post and Print.
This field is updated when the invoice is validated and saved.
api annotation:This field defaults from the invoice creation date.
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.
tiDInvoicePostingYearPeriodintegerDInvoice.DInvoicePostingYearPeriodYear/Period. This field indicates the accounting year and period 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 and period 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.
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.
tcInvoiceJournalCodecharacterJournal2.JournalCodeA daybook code (maximum eight characters).
tiJournal_IDintegerJournal1.Journal_IDRecord ID
tcJournalCodecharacterJournal1.JournalCodeA daybook code (maximum eight characters).
tcJournalDescriptioncharacterJournal1.JournalDescriptionA brief description of the daybook.
api annotation:Value for this field defaults to null.
tcJournalTypeCodecharacterJournal1.JournalTypeCodeA daybook type code.
api annotation:Value for this field defaults to "Journal Entries".
ttPostingDatedatePostingLine.PostingDatePosting Date.
api annotation:If this field is blank, it gets a default value equal to the value of PostingDate in tPosting.
tcPostingInvoiceReferenceTxtcharacterPosting.PostingInvoiceReferenceTxtWhen the posting is part of an invoice posting, then this field contains the invoice number (Year/Daybook/Voucher extended with supplier invoice Reference in case of a supplier invoice). Used for information purpose on reports and browsers.
api annotation:Value for this field defaults to blank
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
tcPostingLineLegalDocNbrcharacterPostingLine.PostingLineLegalDocNbrLegal Document Nbr
tiPostingLineSequenceintegerPostingLine.PostingLineSequenceSequence
tcPostingLineTextcharacterPostingLine.PostingLineTextDescription
api annotation:Value for this field defaults to blank. Note: if a new record is created through the user interface, the default value is as same as the value of "PostingText" of tPosting.
tcPostingParentTextcharacterPosting.PostingParentTextContains the description field from the parent object that triggered the posting. When the posting is an invoice posting, this field contains the invoice description. When the posting is a banking entry posting, the description of the bank statement line is copied to this field, etc. Used for information purposes on reports and browses.
api annotation:Value for this field defaults to blank.
tiPostingPeriodintegerPosting.PostingPeriodThe GL period for the posting. The period must be open.
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.
tiPostingYearPeriodintegerPosting.PostingYearPeriodThe GL calendar year/period for the posting. This field is determined by "PostingPeriod" and "PostingYear".
api annotation:If Partial Update is true, the value defaults using PostingPeriod and PostingYear.


Internal usage


QadFinancials
method BDebtorReport.DebtorAccountMovements