report procedure
Parameters
icLanguageCode | input | character | |
tFilter | input | temp-table | |
dcrDocumentBLWIReport | output | dataset | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
unused
program code (program7/bblwireport.p)
empty temp-table tqDocumentBLWIReport.
<M-10 run GetReportLabels (input 'DocumentBLWIReport':U (icReportName),
input icLanguageCode (icLanguageCode),
input tFilter (tFilter),
output tqHeader (tqHeader),
output tqFilter (tqFilter),
output tqText (tqText),
output oiReturnStatus (oiReturnStatus)) in BBLWIReport>
if oiReturnStatus <> 0
then return.
/* ========================================================== */
/* Assign the filter-data-items based on the tFilter records */
/* ========================================================== */
<M-1 run SetDataItemsBasesOnFilter (output oiReturnStatus (oiReturnStatus)) in BBLWIReport>
/* ========================================================== */
/* Validation on selection fields & company */
/* ========================================================== */
<M-13 run ValidateSelections (output vcValidationMessages (ocMessage),
output viFcReturnSuper (oiReturnStatus)) in BBLWIReport>
if vcValidationMessages <> '':U
then do:
<M-14 run SetMessage (input vcValidationMessages (icMessage),
input '':U (icArguments),
input '':U (icFieldName),
input '':U (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input '':U (icRowid),
input 'QADFIN-2867':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BBLWIReport>
assign oiReturnStatus = -1
viFcReturnSuper = -1.
return.
end. /* if vcValidationMessages <> '':U */
empty temp-table tqDocumentBLWIReport.
/*
assign viBWLIRepYearFilter = 2005
viBWLIRepPeriodFilter = 12
vcBWLIRepTypeFilter = "Both"
vcBWLIRepFromFilter = ""
vcBWLIRepToFilter = "999"
vlBWLIRepInEuro = TRUE.
*/
empty temp-table tBWLIReport.
assign vcYearPeriod = string(viBWLIRepYearFilter,"9999":U) + string(viBWLIRepPeriodFilter,"99":U).
/* ========================================================== */
/* Search for data by the selection fields */
/* ========================================================== */
/* search for CINVOICES */
if vcBWLIRepTypeFilter <> {&BWLITYPE-LIABIL-TR}
then do:
<M-4 run CreateBWLIReportFromCInvoices (output viFcReturnSuper (oiReturnStatus)) in BBLWIReport>
<M-5 run CreateBWLIReportFromCInvoiceMovement (output viFcReturnSuper (oiReturnStatus)) in BBLWIReport>
end. /* if vcBWLIRepTypeFilter <> {&BWLITYPE-LIABIL-TR}*/
/* search for DINVOICES */
if vcBWLIRepTypeFilter <> {&BWLITYPE-DEBT-TR}
then do:
<M-6 run CreateBWLIReportFromDInvoices (output viFcReturnSuper (oiReturnStatus)) in BBLWIReport>
<M-7 run CreateBWLIReportFromDInvoiceMovement (output viFcReturnSuper (oiReturnStatus)) in BBLWIReport>
end. /* if vcBWLIRepTypeFilter <> {&BWLITYPE-DEBT-TR} */
/* Get the average rate for the currencies */
for each tBWLIReport:
if vlBWLIRepInEuro = true
then do:
if tBWLIReport.tdAmountCHF <> 0
then assign tBWLIReport.tdRateCHF = tBWLIReport.tdAmountCHF / tBWLIReport.tdAmountCHF_EUR.
else assign tBWLIReport.tdRateCHF = 0
tBWLIReport.tdAmountCHF_EUR = 0.
if tBWLIReport.tdAmountUSD <> 0
then assign tBWLIReport.tdRateUSD = tBWLIReport.tdAmountUSD / tBWLIReport.tdAmountUSD_EUR.
else assign tBWLIReport.tdRateUSD = 0
tBWLIReport.tdAmountUSD_EUR = 0.
if tBWLIReport.tdAmountGBP <> 0
then assign tBWLIReport.tdRateGBP = tBWLIReport.tdAmountGBP / tBWLIReport.tdAmountGBP_EUR.
else assign tBWLIReport.tdRateGBP = 0
tBWLIReport.tdAmountGBP_EUR = 0.
if tBWLIReport.tdAmountJPY <> 0
then assign tBWLIReport.tdRateJPY = tBWLIReport.tdAmountJPY / tBWLIReport.tdAmountJPY_EUR.
else assign tBWLIReport.tdRateJPY = 0
tBWLIReport.tdAmountJPY_EUR = 0.
if tBWLIReport.tdAmountCHF_EUR <> 0
then assign tBWLIReport.tiAmountThousandCHF = round(tBWLIReport.tdAmountCHF_EUR / 1000,0).
else assign tBWLIReport.tiAmountThousandCHF = 0.
if tBWLIReport.tdAmountGBP_EUR <> 0
then assign tBWLIReport.tiAmountThousandGBP = round(tBWLIReport.tdAmountGBP_EUR / 1000,0).
else assign tBWLIReport.tiAmountThousandGBP = 0.
if tBWLIReport.tdAmountJPY_EUR <> 0
then assign tBWLIReport.tiAmountThousandJPY = round(tBWLIReport.tdAmountJPY_EUR / 1000,0).
else assign tBWLIReport.tiAmountThousandJPY = 0.
if tBWLIReport.tdAmountUSD_EUR <> 0
then assign tBWLIReport.tiAmountThousandUSD = round(tBWLIReport.tdAmountUSD_EUR / 1000,0).
else assign tBWLIReport.tiAmountThousandUSD = 0.
if tBWLIReport.tdAmountEUR <> 0
then assign tBWLIReport.tiAmountThousandEUR = round(tBWLIReport.tdAmountEUR / 1000,0).
else assign tBWLIReport.tiAmountThousandEUR = 0.
if tBWLIReport.tdAmountOther_EUR <> 0
then assign tBWLIReport.tiAmountThousandOtherEUR = round(tBWLIReport.tdAmountOther_EUR / 1000,0).
else assign tBWLIReport.tiAmountThousandOtherEUR = 0.
end.
else do:
if tBWLIReport.tdAmountCHF <> 0
then assign tBWLIReport.tiAmountThousandCHF = round(tBWLIReport.tdAmountCHF / 1000,0).
else assign tBWLIReport.tiAmountThousandCHF = 0.
if tBWLIReport.tdAmountGBP <> 0
then assign tBWLIReport.tiAmountThousandGBP = round(tBWLIReport.tdAmountGBP / 1000,0).
else assign tBWLIReport.tiAmountThousandGBP = 0.
if tBWLIReport.tdAmountJPY <> 0
then assign tBWLIReport.tiAmountThousandJPY = round(tBWLIReport.tdAmountJPY / 1000,0).
else assign tBWLIReport.tiAmountThousandJPY = 0.
if tBWLIReport.tdAmountUSD <> 0
then assign tBWLIReport.tiAmountThousandUSD = round(tBWLIReport.tdAmountUSD / 1000,0).
else assign tBWLIReport.tiAmountThousandUSD = 0.
if tBWLIReport.tdAmountEUR <> 0
then assign tBWLIReport.tiAmountThousandEUR = round(tBWLIReport.tdAmountEUR / 1000,0).
else assign tBWLIReport.tiAmountThousandEUR = 0.
if tBWLIReport.tdAmountOther_EUR <> 0
then assign tBWLIReport.tiAmountThousandOtherEUR = round(tBWLIReport.tdAmountOther_EUR / 1000,0).
else assign tBWLIReport.tiAmountThousandOtherEUR = 0.
end.
/* get country description */
if tBWLIReport.tcBWLICountryDescription = "":U
then do:
<Q-8 run CountryByCode (all) (Read) (NoCache)
(input tBWLIReport.tcBWLICountryCode, (CountryCode)
output dataset tqCountryByCode) in BCountry >
find first tqCountryByCode no-error.
if avail tqCountryByCode
then assign tBWLIReport.tcBWLICountryDescription = tqCountryByCode.tcCountryDescription.
end.
end.
for each tBWLIReport:
create tqDocumentBLWIReport.
buffer-copy tBWLIReport to tqDocumentBLWIReport.
end.