project QadFinancials > class BDInvoice > business logic query DInvoiceByInvoiceNumber


Parameters


iiCompanyIdintegerCompany id
iiDInvoicePostingYearintegerThe year that the invocie record is being posted in.
iiDInvoiceVoucherintegerThe voucher number.
icJournalCodecharacterDaybook Code


query condition


  each DInvoice where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.DInvoicePostingYear = iiDInvoicePostingYear AND
DInvoice.DInvoiceVoucher = iiDInvoiceVoucher

      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
Journal.JournalCode = icJournalCode


query resultset tqDInvoiceByInvoiceNumber


field namedata typedb fielddescription
tiCompany_IDintegerDInvoice.Company_IDLink to Company
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
tdDInvoiceCCRatedecimalDInvoice.DInvoiceCCRateSC Rate. The statutory exchange rate used by the invoice.
The SC Invoice Amount is calculated based on the SC rate.
tdDInvoiceCCScaledecimalDInvoice.DInvoiceCCScaleScale Factor. This field indicates the scale factor applying to the SC rate in use for foreign currency payments.
tiDInvoiceCurrency_IDintegerDInvoice.DInvoiceCurrency_IDCurrency Code
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.
tlDInvoiceIsExternallogicalDInvoice.DInvoiceIsExternalExternal. This field indicates if the daybook used is external.
This field is calculated by the system using the daybook code.
tdDInvoiceOriginalCreditCCdecimalDInvoice.DInvoiceOriginalCreditCCSC Invoice Amount (CR). This field displays the credit total invoice amount in the statutory currency.
This field is calculated by the system using the TC Invoice Amount(CR) and the SC Rate.
tdDInvoiceOriginalCreditLCdecimalDInvoice.DInvoiceOriginalCreditLCBC Invoice Amount(CR). This field displays the credit total invoice amount in the base currency.
This field is calculated by the system using the TC Invoice Amount(CR) and the Exchange rate.
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.
tdDInvoiceOriginalDebitCCdecimalDInvoice.DInvoiceOriginalDebitCCSC Invoice Amount (DR). This field displays the debit total invoice amount in the statutory currency.
This field is calculated by the system using the TC Invoice Amount(CR) and the SC Rate.
tdDInvoiceOriginalDebitLCdecimalDInvoice.DInvoiceOriginalDebitLCBC Invoice Amount(DR). This field displays the debit total invoice amount in the base currency.
This field is calculated by the system using the TC Invoice Amount(DR) and the Exchange rate.
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.
ttDInvoicePostingDatedateDInvoice.DInvoicePostingDatePosting Date. This field displays the date the sales-related invoice was generated by Invoice Post and Print.
This field is updated when the invoice is validated and saved.
api annotation:This field defaults from the invoice creation date.
tiDInvoicePostingYearintegerDInvoice.DInvoicePostingYearYear.This field indicates the accounting year for the invoice.
If you modify these fields, the posting and tax dates are changed correspondingly.
api annotation:This field defaults to the accounting year associated with the posting date.
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.
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).


Internal usage


QadFinancials
method BDInvoice.AdditionalUpdatesAllAssignments
method BDInvoice.ApiInvoiceStagebyInvoiceNbr
method BDInvoice.CheckExternalInvoiceApiCC
method BDInvoice.CheckExternalInvoiceCC
method BDInvoiceJournalEntry.ApiStdMaintainTTCheckLink
method BDInvoiceJournalEntry.ApiStdMaintainTTFillCCLC