project QadFinancials > class BDInvoice > business logic query DInvoiceByLinkedInvoice


Parameters


iiCompanyIdintegerCompany id
iiLinkedDInvoicePostingYearinteger
iiLinkedDInvoiceVoucherinteger
icLinkedJournalCodecharacter


query condition


  each DInvoice where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.DInvoicePostingYear = iiLinkedDInvoicePostingYear AND
DInvoice.DInvoiceVoucher = iiLinkedDInvoiceVoucher

      first Country1 (inner-join) where
Country1.Country_ID = DInvoice.TransactionStartCountry_ID AND

      first Country2 (inner-join) where
Country2.Country_ID = DInvoice.TransactionEndCountry_ID AND

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

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


query resultset tqDInvoiceByLinkedInvoice


field namedata typedb fielddescription
tiCompany_IDintegerDInvoice.Company_IDLink to Company
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.
tdDInvoiceVatExchangeRatedecimalDInvoice.DInvoiceVatExchangeRateTax Exchange Rate. The exchange rate used to calculate the tax of the invoice.
The BC Tax amount is calculated using the Tax exchange rate.
tdDInvoiceVatRateScaledecimalDInvoice.DInvoiceVatRateScaleTax Rate Scale. This field indicates the scale factor applying to the tax exchange rate in use for foreign currency payments.
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).
tcTransactionEndCountryCodecharacterCountry2.CountryCodeCountry Code
tcTransactionStartCountryCodecharacterCountry1.CountryCodeCountry Code
tcVatCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code


Internal usage


QadFinancials
method BDInvoice.DefaultValuesLinkedInvoice