Conditional formatting based on sum() totals
Posted: 29 Aug 2012, 14:37
I'm trying to hide / show a "Discount" header text box when a sales total discount is zero / non-zero.
I have a text box showing "Discount" and the conditional expression:-
if sum(Rounddp(SOP_ITEM.FOREIGN_FULL_NET_AMOUNT, 2) - Rounddp(SOP_ITEM.FOREIGN_NET_AMOUNT, 2) + Rounddp(SALES_ORDER.NET_VALUE_DISCOUNT_NET, 2)) = 0 then
begin
Visible := False;
end
This is based on the "Total_Discount" expression in the footer of the default layout.
Here's the problem ... this all seems to work fine provided the *first* item (and/or any other item) in the sale has a discount value.
If I only apply a discount to the (say) final item, my conditional expression always hides the header.
Am I doing something wrong ?
Thanks for any help you can provide.
I have a text box showing "Discount" and the conditional expression:-
if sum(Rounddp(SOP_ITEM.FOREIGN_FULL_NET_AMOUNT, 2) - Rounddp(SOP_ITEM.FOREIGN_NET_AMOUNT, 2) + Rounddp(SALES_ORDER.NET_VALUE_DISCOUNT_NET, 2)) = 0 then
begin
Visible := False;
end
This is based on the "Total_Discount" expression in the footer of the default layout.
Here's the problem ... this all seems to work fine provided the *first* item (and/or any other item) in the sale has a discount value.
If I only apply a discount to the (say) final item, my conditional expression always hides the header.
Am I doing something wrong ?
Thanks for any help you can provide.