project QadFinancials > class BDInvoice > business logic query DInvoiceForPaymentExt

Description

Query on DInvoice that is used for making Payemtns against the invoice (note there are two variants of this query: one normal and one with additional joins that has extention Ext)


Parameters


iiCompanyIdintegerCompany id
iiDInvoiceIdintegerID of the Customer Invoice


query condition


  each DInvoice where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.DInvoice_ID = iiDInvoiceId

      first Company (inner-join) where
Company.Company_Id = iiCompanyId AND
Company.Company_ID = DInvoice.Company_ID AND

          each CompanySharedSet (inner-join) where
CompanySharedSet.Company_Id = iiCompanyId AND
CompanySharedSet.Company_ID = Company.Company_ID AND

              first SharedSet (inner-join) where
SharedSet.SharedSet_ID = CompanySharedSet.SharedSet_ID AND
SharedSet.SharedSetTypeCode = 'EXCHANGERATE'

          first DomainProperty (inner-join) where
DomainProperty.Domain_ID = Company.Domain_ID AND

      first CostCentre (outer-join) where
CostCentre.SharedSet_Id = vi_COSTCENTRE_sharedset(iiCompanyId) AND
CostCentre.CostCentre_ID = DInvoice.CostCentre_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 Project (outer-join) where
Project.SharedSet_Id = vi_PROJECT_sharedset(iiCompanyId) AND
Project.Project_ID = DInvoice.Project_ID AND


query resultset tqDInvoiceForPaymentExt


field namedata typedb fielddescription
tiCompany_IDintegerDInvoice.Company_IDLink to Company
tcCompanyCodecharacterCompany.CompanyCodeEntity Code
tcCostCentreCodecharacterCostCentre.CostCentreCodeCost Center: A code that identifies the cost center.
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
tdDInvoiceBalanceCCdecimalDInvoice.DInvoiceBalanceCCSC Balance. This field displays the sum of the debit and credit amounts of all posting lines in statutory currency.
This field is calculated by the system using the TC Balance and the SC rate.
tdDInvoiceBalanceLCdecimalDInvoice.DInvoiceBalanceLCBC Balance. This field displays the sum of the debit and credit amounts of all posting lines in base currency.
This field is calculated by the system using the TC Balance and the Exchange rate.
tdDInvoiceBalanceTCdecimalDInvoice.DInvoiceBalanceTCBalance. This field displays the sum of the debit and credit amounts of all posting lines in transaction currency.
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.
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.
tiDivision_IDintegerDInvoice.Division_IDSub-Account
tiExchangeRateSharedSet_IDintegerSharedSet.SharedSet_IDRecord ID
tcJournalCodecharacterJournal.JournalCodeA daybook code (maximum eight characters).
tiLCCurrency_IDintegerDomainProperty.Currency_IDBase Currency
tcProjectCodecharacterProject.ProjectCodeProject
tcSharedSetTypeCodecharacterSharedSet.SharedSetTypeCodeShared Set Type
tiStatutoryCurrency_IDintegerDomainProperty.StatutoryCurrency_IDStatutory Currency


Internal usage


QadFinancials
method BDInvoice.CreateDInvoiceMovementsCrossCy