project QadFinancials > class BCInvoice > business logic query CInvoiceByIDBalanceTCDueDates

Description

CInvoiceByIDBalanceTCDueDates; query that onyl works on table CInvoice and that has a condition on CInvoiceID, duesdates 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
iiCInvoiceIDintegerCInvoiceID
idBalanceTCdecimalBalanceTC
ilCInvoiceIsSelectedlogicalCinvoice Selected
itCInvoiceDueDatedateCInvoiceDueDate
itCInvoiceDiscountDueDatedateCInvoiceDiscountDueDate


query condition


  each CInvoice where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.CInvoice_ID = iiCInvoiceID AND
(CInvoice.CInvoiceBalanceCreditTC = idBalanceTC OR
CInvoice.CInvoiceBalanceDebitTC = idBalanceTC ) AND
CInvoice.CInvoiceIsSelected = ilCInvoiceIsSelected AND
CInvoice.CInvoiceDueDate = itCInvoiceDueDate AND
CInvoice.CInvoiceDiscountDueDate = itCInvoiceDiscountDueDate


query resultset tqCInvoiceByIDBalanceTCDueDates


field namedata typedb fielddescription
tlCInvoiceIsSelectedlogicalCInvoice.CInvoiceIsSelectedSelected. This field indicates whether the invoice is included in a payment selection.
This field is read-only.
tiCInvoice_IDintegerCInvoice.CInvoice_IDRecord ID
tiCompany_IDintegerCInvoice.Company_IDLink to Company
tdCInvoiceBalanceCreditTCdecimalCInvoice.CInvoiceBalanceCreditTCTC Balance Amount CR. This field displays the sum of the credit amounts of all posting lines in transaction currency.
tdCInvoiceBalanceDebitTCdecimalCInvoice.CInvoiceBalanceDebitTCTC Balance Amount DR. This field displays the sum of the debit amounts of all posting lines in transaction currency.
ttCInvoiceDiscountDueDatedateCInvoice.CInvoiceDiscountDueDateDiscount Due Date.This field indicates the last date a discount applies, calculated by the system based on the credit terms and the invoice date.
User can modify this field without affecting the credit terms.
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.


Internal usage


QadFinancials
method BBankEntry.AdditionalUpdatesInvOptimisticLock
method BOpenItemAdjustment.OIAdjCommitSubOptimisticLock