I am working on creating a new invoice which will have three labels: Unit Price Base, Discount, and Unit Price. The Unit Price Base is the selling price, the discount is the discount and the Unit Price is the net of the two. I am trying to set it up to only show the Unit Price Base and Discount if there is an item on the invoice that gets a discount, otherwise only the last label will show. The discounts are actually Line Discounts. I set up a variable TotalLineDiscount := TotalLineDiscount + "Line Discount Amount" . I then set the labels to show if TotalLineDiscount > 0, however it is not working correctly. It works in the following circumstances:
1- an invoice for one item that receives the discount
2- an invoice for one item that does NOT receive the discount
3- an invoice for both types of items where the first item on the invoice is one that receives a discount.
I cannot get it to work when there are multiple items and the first one listed does not get a discount, but others do.
Can anyone offer any suggestions? I thought by creating the total discount variable, it would look at the total and decide if the label should be printed. I am thinking that maybe I need to move the code somewhere but nothing has worked correctly so far.
thanks for your help
Ron Gallagher
0
Comments
for first section you write in OnPreSection trigger:
CurrReport.SHOWOUTPUT(LineDiscount<>0);
on second section:
CurrReport.SHOWOUTPUT(LineDiscount=0);
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
make a new var for Lines and a boolean HaveDiscounts
OnPreDataItem you can go through you lines record and find out if you have discounts and properly set your boolean var.
then you use previus hint of 2 sections...
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯