I have done a report in which I linked OE history detail (I need to report payments by item category) to AR receipt.
There are invoices that do not have a payment attached and also because an invoice has more than one detail line I want the payment amount to be added into an accumulator only once per invoice.
Here is the formula I used.
NumberVar Runtotal;
-Runtotal:=Runtotal+tonumber(if isnull({AROBP.AMTPAYMHC}) then 0 else {AROBP.AMTPAYMHC}*if ( recordnumber=1 or Previous ({OESHDT.TRANNUM}) <>{OESHDT.TRANNUM}) then 1 else 0)
If I place the field in the detail section of the report, the very last detail reports a correct running total.
My problem is that I will have to hide the detail of the report (since I want to use it as a sub-report and the client is interested only in the receipt total).
If I copy and paste the formula field in the report's footer the running total seems to be incorrect, specifically the amount field of the very last record gets added to the running total twice. How can I fix this issue?
There are invoices that do not have a payment attached and also because an invoice has more than one detail line I want the payment amount to be added into an accumulator only once per invoice.
Here is the formula I used.
NumberVar Runtotal;
-Runtotal:=Runtotal+tonumber(if isnull({AROBP.AMTPAYMHC}) then 0 else {AROBP.AMTPAYMHC}*if ( recordnumber=1 or Previous ({OESHDT.TRANNUM}) <>{OESHDT.TRANNUM}) then 1 else 0)
If I place the field in the detail section of the report, the very last detail reports a correct running total.
My problem is that I will have to hide the detail of the report (since I want to use it as a sub-report and the client is interested only in the receipt total).
If I copy and paste the formula field in the report's footer the running total seems to be incorrect, specifically the amount field of the very last record gets added to the running total twice. How can I fix this issue?