project QadFinancials > class BDInvoice > business logic query DInvoiceByControlGL

Description

Returns all invoices that were booked with a particular Debtor Control account.
Selections can be made on the invoices being posted before a specified date, due before a specified date and still open at a specified date.


Parameters


iiCompanyIdintegerCompany id
iiDivisionIDinteger
iiGLIDinteger
icMovementTypecharacter
itToPostingDatedate
itToDueDatedate
itFromClosingDatedate


query condition


  each DInvoice where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.DInvoiceClosingDate >= itFromClosingDate AND
DInvoice.DInvoicePostingDate <= itToPostingDate AND
DInvoice.DInvoiceDueDate <= itToDueDate AND
DInvoice.Division_ID = iiDivisionID

      each DInvoiceMovement (inner-join) where
DInvoiceMovement.Company_Id = iiCompanyId AND
DInvoiceMovement.DInvoice_ID = DInvoice.DInvoice_ID AND
DInvoiceMovement.DInvoiceMovementType = icMovementType

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


query resultset tqDInvoiceByControlGL


field namedata typedb fielddescription
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.
tiDInvoiceCurrency_IDintegerDInvoice.DInvoiceCurrency_IDCurrency Code
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.
tiDivision_IDintegerDInvoice.Division_IDSub-Account
tiGL_IDintegerPostingLine.GL_IDGL Description
ti_sequenceintegercalculatedprimary index
tc_rowidcharactercalculated = rowid(DInvoice),rowid(DInvoiceMovement),rowid(PostingLine)


Internal usage


QadFinancials
method BCashReport.Recalculate
method BCashReport.RecalculateGLTypeCodeDebtorAmounts