project QadFinancials > class BDDocument > business logic query DDocumentInvoiceXrefbyId


Parameters


iiCompanyIdintegerCompany id
iiDocumentIDinteger


query condition


  each DDocumentInvoiceXref where
DDocumentInvoiceXref.DDocument_ID = iiDocumentID

      first DInvoice (inner-join) where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.DInvoice_ID = DDocumentInvoiceXref.DInvoice_ID AND

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

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

          first Period (inner-join) where
Period.Company_Id = iiCompanyId AND
Period.Period_ID = DInvoice.Period_ID AND


query resultset tqDDocumentInvoiceXrefbyId


field namedata typedb fielddescription
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tiDDocument_IDintegerDDocumentInvoiceXref.DDocument_IDLink to DDocument
tdDDocumentInvoiceXrefAlloTCdecimalDDocumentInvoiceXref.DDocumentInvoiceXrefAlloTCTC Allocated Amount. This field indicates the invocie amount already Allocated 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.
tcDInvoiceDITextcharacterDInvoice.DInvoiceDITextCIDescription. A brief description for the SI posting.
api annotation:This field defaults from the DInvoiceDescription.
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.
tdDInvoiceExchangeRatedecimalDInvoice.DInvoiceExchangeRateExchange Rate. The accounting exchange rate used by the invoice.
The BC Invoice Amount is calculated based on the exchange rate.
If user modify the TC Invoice Amount, the BC invoice amount is automatically adjusted.
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.
tdDInvoiceRateScaledecimalDInvoice.DInvoiceRateScaleScale Factor.This field indicates the scale factor applying to the exchange rate in use for foreign currency payments.
The exchange rate is multiplied by the scale factor to determine the actual exchange rate.
api annotation:The value for the scale factor defaults from the exchange rate definition, but it can be modified.
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
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 BDCollection.ExportXml