project QadFinancials > class BBillReport > business logic query DInvoiceMovementForBill


Parameters


iiCompanyIdintegerCompany id
iiDebtor_IDinteger
itPostDateFromdate
itPostDateTodate
iiCurrency_IDinteger
iiDInvoiceMovementIDFrominteger
iiDInvoiceMovementIDTointeger
iiBill_IDinteger


query condition


  each DInvoiceMovement where
DInvoiceMovement.Company_Id = iiCompanyId AND
DInvoiceMovement.Debtor_ID = iiDebtor_ID AND
DInvoiceMovement.DInvoiceMovementPostDate >= itPostDateFrom AND
DInvoiceMovement.DInvoiceMovementPostDate <= itPostDateTo AND
DInvoiceMovement.DInvoiceMovement_ID > iiDInvoiceMovementIDFrom AND
DInvoiceMovement.DInvoiceMovement_ID <= iiDInvoiceMovementIDTo

      first DInvoice (inner-join) where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.DInvoice_ID = DInvoiceMovement.DInvoice_ID AND
DInvoice.Bill_ID = iiBill_ID AND
DInvoice.DInvoiceCurrency_ID = iiCurrency_ID

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

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

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

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


query sort order


DInvoiceMovement.DInvoiceMovement_ID (ascending)


query resultset tqDInvoiceMovementForBill


field namedata typedb fielddescription
tiBill_IDintegerDInvoice.Bill_IDLink to Bill
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
tdDInvoiceBalanceCCdecimalDInvoice.DInvoiceBalanceCCSC Balance. This field displays the sum of the debit and credit amounts of all posting lines in statutory currency.
This field is calculated by the system using the TC Balance and the SC rate.
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.
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.
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.
tcDInvoiceDescriptioncharacterDInvoice.DInvoiceDescriptionDescription. A brief description of the invoice. This field is mandatory.
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
tdDInvoiceMovementDiscountTCdecimalDInvoiceMovement.DInvoiceMovementDiscountTCCInvoiceMovementDiscountTC. The amount of payment discount in TC.
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
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.
tiJournal_IDintegerJournal.Journal_IDRecord ID
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
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
tdPostingLineCreditTCdecimalPostingLine.PostingLineCreditTCTC Credit
tdPostingLineDebitTCdecimalPostingLine.PostingLineDebitTCTC Debit
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.


Internal usage


QadFinancials
method BBillReport.BillReportDInvoice
dataset BBillReport.tDInvoiceMovementForBill