pjohns
5th October 2011, 14:55
Hello,
I'm having issues with totals on a pack slip layout I've created.
I have a field called "amount" which is printed in the "after.dico.5" layout only if the pack slip is raised for a certain customer. This field is a total for each line on the pack slip.
If I print one pack slip for this customer the total is correct. If I print a number of pack slips which may or may not be for this customer the amount field ends up being a total of ALL pack slips. I've tried resetting the amount field each time on the after.dico.5 layout but it's not working. I also have a detail layout which is specific to this customer which is where I'm calculating the amount.
Can I please ask some of you clever Baan users to help me out with this?
before.program:
amount = 0
detail.20:
before.layout:
select tdsls040.cuno
from tdsls040
where tdsls040._index1 = {:tdsls040.orno}
as set with 1 rows
selectdo
endselect
if (tdsls040.cuno = "SE8900" or tdsls040.cuno = "SE2000") then
lattr.print = false
endif
detail.22:
before.layout:
amount = amount + tdsls045.amnt
select tdsls040.cuno
from tdsls040
where tdsls040._index1 = {:tdsls040.orno}
as set with 1 rows
selectdo
endselect
if (tdsls040.cuno <> "SE8900" and tdsls040.cuno <> "SE2000") then
lattr.print = false
endif
after.dico.5:
before.layout:
lattr.print = false
if tdsls040.cuno = "SE8900" or tdsls040.cuno = "SE2000" then
lattr.print = true
endif
after.layout:
amount = 0
I'm having issues with totals on a pack slip layout I've created.
I have a field called "amount" which is printed in the "after.dico.5" layout only if the pack slip is raised for a certain customer. This field is a total for each line on the pack slip.
If I print one pack slip for this customer the total is correct. If I print a number of pack slips which may or may not be for this customer the amount field ends up being a total of ALL pack slips. I've tried resetting the amount field each time on the after.dico.5 layout but it's not working. I also have a detail layout which is specific to this customer which is where I'm calculating the amount.
Can I please ask some of you clever Baan users to help me out with this?
before.program:
amount = 0
detail.20:
before.layout:
select tdsls040.cuno
from tdsls040
where tdsls040._index1 = {:tdsls040.orno}
as set with 1 rows
selectdo
endselect
if (tdsls040.cuno = "SE8900" or tdsls040.cuno = "SE2000") then
lattr.print = false
endif
detail.22:
before.layout:
amount = amount + tdsls045.amnt
select tdsls040.cuno
from tdsls040
where tdsls040._index1 = {:tdsls040.orno}
as set with 1 rows
selectdo
endselect
if (tdsls040.cuno <> "SE8900" and tdsls040.cuno <> "SE2000") then
lattr.print = false
endif
after.dico.5:
before.layout:
lattr.print = false
if tdsls040.cuno = "SE8900" or tdsls040.cuno = "SE2000" then
lattr.print = true
endif
after.layout:
amount = 0