project QadFinancials > class BDDocumentReport > business logic query SelectDInvoiceByDDocument


Parameters


iiCompanyIdintegerCompany id
iiDDocumentIDinteger


query condition


  each DDocumentInvoiceXref where
DDocumentInvoiceXref.DDocument_ID = iiDDocumentID

      first DInvoice (conditional-join) where
DInvoice.DInvoice_ID = DDocumentInvoiceXref.DInvoice_ID AND
DInvoice.Company_ID > 0

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

          first Journal (conditional-join) where
Journal.Journal_ID = DInvoice.Journal_ID AND
Journal.SharedSet_ID > 0

          first Period (conditional-join) where
Period.Period_ID = DInvoice.Period_ID AND
Period.Company_ID > 0


query resultset tqSelectDInvoiceByDDocument


field namedata typedb fielddescription
tiCurrency_IDintegerCurrency.Currency_IDRecord ID
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tiCurrencyNumberOfDecimalsintegerCurrency.CurrencyNumberOfDecimalsNumber of Decimals
tiDDocument_IDintegerDDocumentInvoiceXref.DDocument_IDLink to DDocument
tdDDocumentInvoiceXrefAlloTCdecimalDDocumentInvoiceXref.DDocumentInvoiceXrefAlloTCTC Allocated Amount. This field indicates the invocie amount already Allocated in transaction currency.
tdDDocumentInvoiceXrefDiscTCdecimalDDocumentInvoiceXref.DDocumentInvoiceXrefDiscTCTC Discount Amount. This field indicates the discount amount of the invoice already allocated by transaction currency.
tiDebtor_IDintegerDInvoice.Debtor_IDLink to Debtor
tiDInvoice_IDintegerDDocumentInvoiceXref.DInvoice_IDLink to DInvoice
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.
tdDInvoiceBalanceTCdecimalDInvoice.DInvoiceBalanceTCBalance. This field displays the sum of the debit and credit amounts of all posting lines in transaction currency.
tiDInvoiceCurrency_IDintegerDInvoice.DInvoiceCurrency_IDCurrency Code
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.
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.
tdDInvoiceOriginalCreditTCdecimalDInvoice.DInvoiceOriginalCreditTCTC Invoice Amount CR. This field displays the credit total invoice amount in the transaction currency.
If you modify this field, the system automatically recalculates the exchange rate to ensure that the BC Invoice Amount remains the same.
tdDInvoiceOriginalDebitTCdecimalDInvoice.DInvoiceOriginalDebitTCTC AP Amount. This field displays the debit total invoice amount in the transaction currency.
If you modify this field, the system automatically recalculates the exchange rate to ensure that the TC Invoice Amount remains the same.
tcDInvoiceTSMNumbercharacterDInvoice.DInvoiceTSMNumberPayment Reference. This field contains a reference number to identify a customer payment for this invoice.
Normally this could be a unique transaction structured message (TSM) number. The TSM is a standard reference numbering system for electronic transfers,used by many banks.
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_IDintegerDInvoice.Journal_IDDaybook Code
tiJournal_ID2integerJournal.Journal_IDRecord ID
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tiPeriod_IDintegerDInvoice.Period_IDLink to Period
tiPeriodPeriodintegerPeriod.PeriodPeriodGL Period
tiPeriodYearintegerPeriod.PeriodYearGL Calendar Year
ti_sequenceintegercalculatedprimary index
tc_rowidcharactercalculated = rowid(DDocumentInvoiceXref),rowid(DInvoice),rowid(Currency),rowid(Journal),rowid(Period)


Internal usage


QadFinancials
method BDDocumentReport.DDocumentReportAll