project QadFinancials > class BDInvoice > business logic query DInvoiceByIDBalanceTCDueDates

Description

DInvoiceByIDBalanceTCDueDates; query that onyl works on table DInvoice and that has a condition on DInvoiceID,due dates and on Balance. The check on balance is true if the balance is either credit, either debit.
Please do not add fields or joins to this query: is should stay as simple as possible.


Parameters


iiCompanyIdintegerCompany id
iiDInvoiceIDintegerDInvoiceID
idBalanceTCdecimalBalanceTC
ilDInvoiceIsSelectedlogicalCInvoice is Selected
itDInvoiceDueDatedateDInvoiceDueDate
itDInvoiceDiscountDueDatedateDInvoiceDiscountDueDate


query condition


  each DInvoice where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.DInvoice_ID = iiDInvoiceID AND
(DInvoice.DInvoiceBalanceCreditTC = idBalanceTC OR
DInvoice.DInvoiceBalanceDebitTC = idBalanceTC ) AND
DInvoice.DInvoiceIsSelected = ilDInvoiceIsSelected AND
DInvoice.DInvoiceDueDate = itDInvoiceDueDate AND
DInvoice.DInvoiceDiscountDueDate = itDInvoiceDiscountDueDate


query resultset tqDInvoiceByIDBalanceTCDueDates


field namedata typedb fielddescription
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.
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.
tlDInvoiceIsSelectedlogicalDInvoice.DInvoiceIsSelectedSelected. This field indicates whether the invoice is included in a payment selection.
This field is read-only.
api annotation:PartialUpdate = yes - defaults to false
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
tiCompany_IDintegerDInvoice.Company_IDLink to Company
tdDInvoiceBalanceCreditTCdecimalDInvoice.DInvoiceBalanceCreditTCTC Balance Amount CR. This field displays the sum of the credit amounts of all posting lines in transaction currency.
tdDInvoiceBalanceDebitTCdecimalDInvoice.DInvoiceBalanceDebitTCTC Balance Amount DR. This field displays the sum of the debit amounts of all posting lines in transaction currency.


Internal usage


QadFinancials
method BBankEntry.AdditionalUpdatesInvOptimisticLock
method BOpenItemAdjustment.OIAdjCommitSubOptimisticLock