project QadFinancials > class BCInvoice > business logic query CInvoiceByLinkedInvoice


Parameters


iiCompanyIdintegerCompany id
iiLinkedCInvoicePostingYearinteger
icLinkedJournalCodecharacter
iiLinkedCInvoiceVoucherinteger


query condition


  each CInvoice where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.CInvoicePostingYear = iiLinkedCInvoicePostingYear AND
CInvoice.CInvoiceVoucher = iiLinkedCInvoiceVoucher

      first Country1 (conditional-join) where
Country1.Country_ID = CInvoice.TransactionStartCountry_ID AND

      first Country2 (conditional-join) where
Country2.Country_ID = CInvoice.TransactionEndCountry_ID AND

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

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


query resultset tqCInvoiceByLinkedInvoice


field namedata typedb fielddescription
tiCInvoicePostingYearintegerCInvoice.CInvoicePostingYearYear.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.
tdCInvoiceVatExchangeRatedecimalCInvoice.CInvoiceVatExchangeRateTax Exchange Rate. The exchange rate used to calculate the tax of the invoice.
The BC Tax amount is calculated using the Tax exchange rate.
tdCInvoiceVatRateScaledecimalCInvoice.CInvoiceVatRateScaleTax Rate Scale. This field indicates the scale factor applying to the tax exchange rate in use for foreign currency payments.
tiCInvoiceVoucherintegerCInvoice.CInvoiceVoucherVoucher. This field displays the numeric identifier assigned to the posting.
When the daybook of the journal entry is changed (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.
tiCompany_IDintegerCInvoice.Company_IDLink to Company
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tcTransactionEndCountryCodecharacterCountry2.CountryCodeCountry Code
tcTransactionStartCountryCodecharacterCountry1.CountryCodeCountry Code
tcVatCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code


Internal usage


QadFinancials
method BCInvoice.DefaultValuesLinkedInvoice