project QadFinancials > class BCInvoice > business logic query CInvoiceByControlGL

Description

Returns all invoices that were booked with a particular Creditor 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
itFromClosingDatedate
iiGLIDinteger
icMovementTypecharacter
itToDueDatedate
itToPostingDatedate


query condition


  each CInvoice where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.CInvoiceClosingDate >= itFromClosingDate AND
CInvoice.CInvoicePostingDate <= itToPostingDate AND
CInvoice.CInvoiceDueDate <= itToDueDate AND
CInvoice.Division_ID = iiDivisionID

      each CInvoiceMovement (inner-join) where
CInvoiceMovement.Company_Id = iiCompanyId AND
CInvoiceMovement.CInvoice_ID = CInvoice.CInvoice_ID AND
CInvoiceMovement.CInvoiceMovementType = icMovementType

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


query resultset tqCInvoiceByControlGL


field namedata typedb fielddescription
tiCInvoice_IDintegerCInvoice.CInvoice_IDRecord ID
tdCInvoiceBalanceCreditCCdecimalCInvoice.CInvoiceBalanceCreditCCBC 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.
tdCInvoiceBalanceCreditLCdecimalCInvoice.CInvoiceBalanceCreditLCBC 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.
tdCInvoiceBalanceCreditTCdecimalCInvoice.CInvoiceBalanceCreditTCTC Balance Amount CR. This field displays the sum of the credit amounts of all posting lines in transaction currency.
tdCInvoiceBalanceDebitCCdecimalCInvoice.CInvoiceBalanceDebitCCSC 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.
tdCInvoiceBalanceDebitLCdecimalCInvoice.CInvoiceBalanceDebitLCBC 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.
tdCInvoiceBalanceDebitTCdecimalCInvoice.CInvoiceBalanceDebitTCTC Balance Amount DR. This field displays the sum of the debit amounts of all posting lines in transaction currency.
ttCInvoiceClosingDatedateCInvoice.CInvoiceClosingDateClosing Date. This field displays the date on which the open balance became zero.
tiCInvoiceCurrency_IDintegerCInvoice.CInvoiceCurrency_IDCurrency Code
ttCInvoiceDueDatedateCInvoice.CInvoiceDueDateDue Date.This field indicates the date when payment become due.
This field can be modified without affecting the credit terms.
This field is calculated by the system based on the credit terms and the invoice date.
tcCInvoiceMovementTypecharacterCInvoiceMovement.CInvoiceMovementTypeCInvoiceMovementType. "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).
ttCInvoicePostingDatedateCInvoice.CInvoicePostingDatePosting Date. This filed indicates the date on which the invoice is to be posted.
api annotation:This field defaults from the invoice creation date.
tiDivision_IDintegerCInvoice.Division_IDSub-Account
tiGL_IDintegerPostingLine.GL_IDGL Description
ti_sequenceintegercalculatedprimary index
tc_rowidcharactercalculated = rowid(CInvoice),rowid(CInvoiceMovement),rowid(PostingLine)


Internal usage


QadFinancials
method BCashReport.Recalculate
method BCashReport.RecalculateGLTypeCodeCreditorAmounts