So I've noticed this and have no idea how to fix it. It doesn't always happen, but I think it happens when there is more then 1 page, not sure.

So we have a function that calculates how much a customer still has to pay on their advance (or 0 if the advance is paid).
Code:
dim nVal


let nVal = ({SALE.AdvanceRequested}-{SALE.AmountPaid})
if (nVal < 0) then let nVal = 0 end


return nVal
In the report footer we show a label that is based on the function above, if it's 0 we show "ADVANCE PAID" and when it's > 0 we show "ADVANCE OWED". Right next to it we show the output of the function.
But when these specific orders are printed the label says "ADVANCE OWED" but the amount that is printed right next to it is 0. So when this function as used inside another function it wasn't zero but when printed it is.. Any ideas?