project QadFinancials > class BDInvoice > business logic query DInvoiceByIDForBill


Parameters


iiCompanyIdintegerCompany id
iiDInvoice_IDintegerDInvoice ID
iiBill_IDinteger
icMovementTypecharacter


query condition


  each DInvoice where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.DInvoice_ID = iiDInvoice_ID AND
DInvoice.Bill_ID = iiBill_ID

      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


query sort order


DInvoice.Bill_ID (ascending)
DInvoice.DInvoice_ID (ascending)
DInvoiceMovement.DInvoiceMovement_ID (ascending)


query resultset tqDInvoiceByIDForBill


field namedata typedb fielddescription
tiBill_IDintegerDInvoice.Bill_IDLink to Bill
tiCompany_IDintegerDInvoice.Company_IDLink to Company
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
ttDInvoiceCreationDatedateDInvoice.DInvoiceCreationDateCreation Date
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.
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.
tiDInvoiceMovement_IDintegerDInvoiceMovement.DInvoiceMovement_IDRecord ID
ttDInvoiceMovementPostDatedateDInvoiceMovement.DInvoiceMovementPostDatePosting Date. The Posting Date of the Invoice's movement.
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).
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
ttPostingDatedatePostingLine.PostingDatePosting Date.
api annotation:If this field is blank, it gets a default value equal to the value of PostingDate in tPosting.
tiPostingLine_IDintegerPostingLine.PostingLine_IDRecord ID
tdPostingLineCreditTCdecimalPostingLine.PostingLineCreditTCTC Credit
tdPostingLineDebitTCdecimalPostingLine.PostingLineDebitTCTC Debit


Internal usage


QadFinancials
method BBill.ValidateComponent
method BBillReport.GetPreBillDate