project QadFinancials > class BBLWIReport > method CreateBWLIReportFromCInvoiceMovement

Description

This method is called by the report method DocumentBLWIReport. Since the report method is not used, this method is also obsolete.


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBLWIReport.DocumentBLWIReport


program code (program5/bblwireport.p)

<Q-1 run CInvoiceMovementForBLWIReport (all) (Read) (NoCache)
          (input {&INVOICEPOSTINGTYPE-INITIAL}, (Type)
           input int(vcYearPeriod), (YearPeriod)
           input vcCountryCodeBE, (CountryCode)
           input viCompanyId, (CompanyId)
           input vcBWLIRepFromFilter, (BLWICodeFrom)
           input vcBWLIRepToFilter, (BLWICodeTo)
           output dataset tqCInvoiceMovementForBLWIReport) in BBLWIReport >
for each tqCInvoiceMovementForBLWIReport :
    if tqCInvoiceMovementForBLWIReport.tcBLWICountryCode <> "":U
    then assign vcCountryCode = tqCInvoiceMovementForBLWIReport.tcBLWICountryCode.
    else assign vcCountryCode = tqCInvoiceMovementForBLWIReport.tcCountryCode.
    find first tBWLIReport where tBWLIReport.tcBWLIGroupCode   = tqCInvoiceMovementForBLWIReport.tcBLWIGroupCode + "C":U and
                                 tBWLIReport.tcBWLICountryCode = vcCountryCode
                                 exclusive-lock no-error.
    if not available tBWLIReport
    then do:
        create tBWLIReport.
        assign tBWLIReport.tcBWLIGroupDescription   = tqCInvoiceMovementForBLWIReport.tcBLWIGroupDescription + " - ":U + #T-3'Sales':30(418)t-3#
               tBWLIReport.tcBWLIGroupCode          = tqCInvoiceMovementForBLWIReport.tcBLWIGroupCode + "C":U
               tBWLIReport.tcBWLICountryCode        = vcCountryCode
               tBWLIReport.tcBWLICountryDescription = if tqCInvoiceMovementForBLWIReport.tcBLWICountryCode = "":U
                                                      then tqCInvoiceMovementForBLWIReport.tcCountryDescription
                                                      else "":U.
    end. /* if not available tBWLIReport */
    assign vdCalcAmountTC = ((tqCInvoiceMovementForBLWIReport.tdPostingLineDebitTC + tqCInvoiceMovementForBLWIReport.tdPostingLineCreditTC) * 1)
           vdCalcAmountLC = ((tqCInvoiceMovementForBLWIReport.tdPostingLineDebitLC + tqCInvoiceMovementForBLWIReport.tdPostingLineCreditLC) * 1).
    case tqCInvoiceMovementForBLWIReport.tcCurrencyCode:
      when "EUR":U then assign tBWLIReport.tdAmountEUR     = tBWLIReport.tdAmountEUR + vdCalcAmountLC.
      when "CHF":U then assign tBWLIReport.tdAmountCHF_EUR = tBWLIReport.tdAmountCHF_EUR + vdCalcAmountLC
                               tBWLIReport.tdAmountCHF     = tBWLIReport.tdAmountCHF + vdCalcAmountTC.
      when "GBP":U then assign tBWLIReport.tdAmountGBP_EUR = tBWLIReport.tdAmountGBP_EUR + vdCalcAmountLC
                               tBWLIReport.tdAmountGBP     = tBWLIReport.tdAmountGBP + vdCalcAmountTC.
      when "JPY":U then assign tBWLIReport.tdAmountJPY_EUR = tBWLIReport.tdAmountJPY_EUR + vdCalcAmountLC
                               tBWLIReport.tdAmountJPY     = tBWLIReport.tdAmountJPY + vdCalcAmountTC.
      when "USD":U then assign tBWLIReport.tdAmountUSD_EUR = tBWLIReport.tdAmountUSD_EUR + vdCalcAmountLC
                               tBWLIReport.tdAmountUSD     = tBWLIReport.tdAmountUSD + vdCalcAmountTC.
      otherwise do:
        <M-10 run GetExchangeRate
           (input  ? (iiCompanyID), 
            input  ? (iiFromCurrencyID), 
            input  tqCInvoiceMovementForBLWIReport.tcCurrencyCode (icFromCurrencyCode), 
            input  viCompanyLCId (iiToCurrencyID), 
            input  ? (icToCurrencyCode), 
            input  ? (iiExchangeRateTypeID), 
            input  {&EXCHANGERATETYPE-ACCOUNTING} (icExchangeRateTypeCode), 
            input  tqCInvoiceMovementForBLWIReport.ttPostingDate (itValidityDate), 
            output vdRateCurrency (odExchangeRate), 
            output vdRateScaleCurrency (odExchangeScaleFactor), 
            output viFcReturnSuper (oiReturnStatus)) in BBLWIReport>
        assign tBWLIReport.tdAmountOTHER_EUR = tBWLIReport.tdAmountOther_EUR + (vdCalcAmountTC * vdRateCurrency).
      end. /* otherwise */
    end case. /* case tqSelectCInvoicesBWLI.tcCurrencyCode: */
end. /* for each tqSelectCInvoicesBWLI */