project QadFinancials > class BBLWIReport > business logic query DInvoiceForBLWIReport

Description

Select DInvoices


Parameters


iiCompanyIdintegerCompany id
icCountryCodecharacterCountry Code
ilIsOpenlogical
iiYearPeriodinteger


query condition


  each DInvoice where
DInvoice.Company_Id = iiCompanyId AND
DInvoice.DInvoiceIsOpen = ilIsOpen

      first Country (inner-join) where
Country.Country_ID = DInvoice.TransactionEndCountry_ID AND
Country.CountryCode <> icCountryCode

          first BLWICountry (conditional-join) where
BLWICountry.BLWICountry_ID = Country.BLWICountry_ID AND

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

      first Debtor (inner-join) where
Debtor.SharedSet_Id = vi_DEBTOR_sharedset(iiCompanyId) AND
Debtor.Debtor_ID = DInvoice.Debtor_ID AND

          first BusinessRelation (inner-join) where
BusinessRelation.BusinessRelation_ID = Debtor.BusinessRelation_ID AND

              each Address (inner-join) where
Address.BusinessRelation_ID = BusinessRelation.BusinessRelation_ID AND

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


query resultset tqDInvoiceForBLWIReport


field namedata typedb fielddescription
tcBLWICountryCodecharacterBLWICountry.BLWICountryCodeBLWI Country Code
tiCountry_IDintegerCountry.Country_IDRecord ID
tcCountryCodecharacterCountry.CountryCodeCountry Code
tcCountryDescriptioncharacterCountry.CountryDescriptionDescription
tlCountryIsActivelogicalCountry.CountryIsActiveActive
tlCountryIsEUCountrylogicalCountry.CountryIsEUCountryEU Member
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tiDInvoice_IDintegerDInvoice.DInvoice_IDRecord ID
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.
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.
tcDInvoiceTypecharacterDInvoice.DInvoiceTypeInvoice Type. This field displays the invoice type.
Invoice Correction and Credit Note Correction display as choices only when the appropriate daybook types have already been defined.
api annotation:PartialUpdate = yes - defaults to Invoice
tiPeriod_IDintegerDInvoice.Period_IDLink to Period


Internal usage


QadFinancials
method BBLWIReport.CreateBWLIReportFromDInvoices