project QadFinancials > class BBLWIReport > method CreateBWLIReportFromCInvoices
Description
This method is called by the report method DocumentBLWIReport. Since the report method is not used, this method is also obsolete.
Parameters
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program3/bblwireport.p)
<Q-1 run CInvoiceForBLWIReport (all) (Read) (NoCache)
(input viCompanyId, (CompanyId)
input int(vcYearPeriod), (YearPeriod)
input TRUE, (IsOpen)
input vcBWLIRepFromFilter, (BWLIFromGroup)
input vcBWLIRepToFilter, (BWLIToGroup)
input vcCountryCodeBE, (CountryCode)
output dataset tqCInvoiceForBLWIReport) in BBLWIReport >
for each tqCInvoiceForBLWIReport :
if tqCInvoiceForBLWIReport.tcBLWICountryCode <> "":U
then assign vcCountryCode = tqCInvoiceForBLWIReport.tcBLWICountryCode.
else assign vcCountryCode = tqCInvoiceForBLWIReport.tcCountryCode.
find first tBWLIReport where tBWLIReport.tcBWLIGroupCode = tqCInvoiceForBLWIReport.tcBLWIGroupCode + "C":U and
tBWLIReport.tcBWLICountryCode = vcCountryCode
exclusive-lock no-error.
if not available tBWLIReport
then do:
create tBWLIReport.
assign tBWLIReport.tcBWLIGroupDescription = tqCInvoiceForBLWIReport.tcBLWIGroupDescription + " - ":U + #T-3'Sales':30(418)t-3#
tBWLIReport.tcBWLIGroupCode = tqCInvoiceForBLWIReport.tcBLWIGroupCode + "C":U
tBWLIReport.tcBWLICountryCode = vcCountryCode
tBWLIReport.tcBWLICountryDescription = if tqCInvoiceForBLWIReport.tcBLWICountryCode = "":U
then tqCInvoiceForBLWIReport.tcCountryDescription
else "":U.
end. /* if not available tBWLIReport */
case tqCInvoiceForBLWIReport.tcCurrencyCode:
when "EUR":U then assign tBWLIReport.tdAmountEUR = tBWLIReport.tdAmountEUR + (tqCInvoiceForBLWIReport.tdCInvoiceBalanceLC * -1).
when "CHF":U then assign tBWLIReport.tdAmountCHF_EUR = tBWLIReport.tdAmountCHF_EUR + (tqCInvoiceForBLWIReport.tdCInvoiceBalanceLC * -1)
tBWLIReport.tdAmountCHF = tBWLIReport.tdAmountCHF + (tqCInvoiceForBLWIReport.tdCInvoiceBalanceTC * -1).
when "GBP":U then assign tBWLIReport.tdAmountGBP_EUR = tBWLIReport.tdAmountGBP_EUR + (tqCInvoiceForBLWIReport.tdCInvoiceBalanceLC * -1)
tBWLIReport.tdAmountGBP = tBWLIReport.tdAmountGBP + (tqCInvoiceForBLWIReport.tdCInvoiceBalanceTC * -1).
when "JPY":U then assign tBWLIReport.tdAmountJPY_EUR = tBWLIReport.tdAmountJPY_EUR + (tqCInvoiceForBLWIReport.tdCInvoiceBalanceLC * -1)
tBWLIReport.tdAmountJPY = tBWLIReport.tdAmountJPY + (tqCInvoiceForBLWIReport.tdCInvoiceBalanceTC * -1).
when "USD":U then assign tBWLIReport.tdAmountUSD_EUR = tBWLIReport.tdAmountUSD_EUR + (tqCInvoiceForBLWIReport.tdCInvoiceBalanceLC * -1)
tBWLIReport.tdAmountUSD = tBWLIReport.tdAmountUSD + (tqCInvoiceForBLWIReport.tdCInvoiceBalanceTC * -1).
otherwise do:
<M-96 run GetExchangeRate
(input ? (iiCompanyID),
input ? (iiFromCurrencyID),
input tqCInvoiceForBLWIReport.tcCurrencyCode (icFromCurrencyCode),
input viCompanyLCId (iiToCurrencyID),
input ? (icToCurrencyCode),
input ? (iiExchangeRateTypeID),
input {&EXCHANGERATETYPE-ACCOUNTING} (icExchangeRateTypeCode),
input tqCInvoiceForBLWIReport.ttCInvoicePostingDate (itValidityDate),
output vdRateCurrency (odExchangeRate),
output vdRateScaleCurrency (odExchangeScaleFactor),
output viFcReturnSuper (oiReturnStatus)) in BBLWIReport>
assign tBWLIReport.tdAmountOTHER_EUR = tBWLIReport.tdAmountOther_EUR + (tqCInvoiceForBLWIReport.tdCInvoiceBalanceLC * vdRateCurrency * -1).
end. /* otherwise */
end case. /* case tqCInvoiceForBLWIReport.tcCurrencyCode: */
end. /* for each tqCInvoiceForBLWIReport */