project QadFinancials > class BBLWIReport > business logic query CInvoiceForBLWIReport

Description

Select CInvoices


Parameters


iiCompanyIdintegerCompany id
iiYearPeriodinteger
ilIsOpenlogical
icBWLIFromGroupcharacter
icBWLIToGroupcharacter
icCountryCodecharacter


query condition


  each CInvoice where
CInvoice.Company_Id = iiCompanyId AND
CInvoice.CInvoiceIsOpen = ilIsOpen

      first BLWIGroup (inner-join) where
BLWIGroup.BLWIGroup_ID = CInvoice.BLWIGroup_ID AND
BLWIGroup.BLWIGroupCode >= icBWLIFromGroup AND
BLWIGroup.BLWIGroupCode <= icBWLIToGroup

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

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

      first Creditor (inner-join) where
Creditor.SharedSet_Id = vi_CREDITOR_sharedset(iiCompanyId) AND
Creditor.Creditor_ID = CInvoice.Creditor_ID AND

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

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

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

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


query resultset tqCInvoiceForBLWIReport


field namedata typedb fielddescription
tcBLWICountryCodecharacterBLWICountry.BLWICountryCodeBLWI Country Code
tiBLWIGroup_IDintegerBLWIGroup.BLWIGroup_IDRecord ID
tcBLWIGroupCodecharacterBLWIGroup.BLWIGroupCodeBLWI Group Code
tcBLWIGroupDescriptioncharacterBLWIGroup.BLWIGroupDescriptionDescription
tiCInvoice_IDintegerCInvoice.CInvoice_IDRecord ID
tdCInvoiceBalanceLCdecimalCInvoice.CInvoiceBalanceLCBC 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.
tdCInvoiceBalanceTCdecimalCInvoice.CInvoiceBalanceTCBalance. This field displays the sum of the debit and credit amounts of all posting lines in transaction currency.
ttCInvoicePostingDatedateCInvoice.CInvoicePostingDatePosting Date. This filed indicates the date on which the invoice is to be posted.
api annotation:This field defaults from the invoice creation date.
tcCInvoiceTypecharacterCInvoice.CInvoiceTypeInvoice Type. This field identifies the invoice type.
The value can be Invoice Correction and Credit Note Correction type only when the appropriate daybook types have already been defined.
tiCountry_IDintegerCountry.Country_IDRecord ID
tcCountryCodecharacterCountry.CountryCodeCountry Code
tcCountryDescriptioncharacterCountry.CountryDescriptionDescription
tlCountryIsActivelogicalCountry.CountryIsActiveActive
tlCountryIsEUCountrylogicalCountry.CountryIsEUCountryEU Member
tcCurrencyCodecharacterCurrency.CurrencyCodeCurrency Code
tiPeriod_IDintegerCInvoice.Period_IDLink to Period
tiPeriodYearintegerPeriod.PeriodYearGL Calendar Year
tiPeriodYearPeriodintegerPeriod.PeriodYearPeriodGL Calendar Year/GL Period


Internal usage


QadFinancials
method BBLWIReport.CreateBWLIReportFromCInvoices