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?
Also I tried a different approach:
I created a field that is 1 if the record detail is the first one (or the only one)in an invoice and zero otherwise. I multiply this field with the receipts amount and I get a new formula field that is equal to the receipt amount for every first detail in the invoice and zero otherwise. Now I would simply want to to a sum for the whole report. The proble is that the sum button it is not available (it is greyed out). The field is definitely numeric.What is the problem in this case?
Thank you for your help.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.