hejingsong
17th November 2004, 17:10
I print a report.I need sum amount in every page.so i add foodter in report layout.but last purchase order line always reprint.Attach file is script.How can i delete reprint order line!
|*get po line information
|=========================
select tdpur401.*
from tdpur401
where tdpur401._index1 = {:tdpur400.orno }
and tdpur401.sqnb = 0
and tdpur401.clyn <> tcyesno.yes
order by tdpur401._index1
selectdo
po.position = tdpur401.pono
po.item = tdpur401.item
po.item.dsca = get.item.dsca(tdpur401.item)
po.unit = tdpur401.cuqp
dt.string = sprintf$("%u002",tdpur401.rdta)
po.req.dt = dt.string(5;4) & dt.string(3;2) & dt.string(1;2)
po.qty = tdpur401.oqua
po.price = tdpur401.pric
po.amnunt = tdpur401.oqua * tdpur401.pric
total.page.amount=total.page.amount + po.amnunt
total.all.amount =total.all.amount + po.amnunt
row.count = row.count + 1
if row.count = 10 then
print.amount=total.page.amount
amount.dsca = "PAGE TOTAL : "
amount.eng.dsca = convert.amount.to.word(po.currency.dsca,rpt.curr.ifx,total.page.amount)
rprt_send()
total.page.amount=0
row.count = 0
else
rprt_send()
endif
selecteos
print.amount=total.all.amount
amount.dsca = "GRAND TOTAL :"
amount.eng.dsca = convert.amount.to.word(po.currency.dsca,rpt.curr.ifx,total.all.amount)
rprt_send()
endselect
|*get po line information
|=========================
select tdpur401.*
from tdpur401
where tdpur401._index1 = {:tdpur400.orno }
and tdpur401.sqnb = 0
and tdpur401.clyn <> tcyesno.yes
order by tdpur401._index1
selectdo
po.position = tdpur401.pono
po.item = tdpur401.item
po.item.dsca = get.item.dsca(tdpur401.item)
po.unit = tdpur401.cuqp
dt.string = sprintf$("%u002",tdpur401.rdta)
po.req.dt = dt.string(5;4) & dt.string(3;2) & dt.string(1;2)
po.qty = tdpur401.oqua
po.price = tdpur401.pric
po.amnunt = tdpur401.oqua * tdpur401.pric
total.page.amount=total.page.amount + po.amnunt
total.all.amount =total.all.amount + po.amnunt
row.count = row.count + 1
if row.count = 10 then
print.amount=total.page.amount
amount.dsca = "PAGE TOTAL : "
amount.eng.dsca = convert.amount.to.word(po.currency.dsca,rpt.curr.ifx,total.page.amount)
rprt_send()
total.page.amount=0
row.count = 0
else
rprt_send()
endif
selecteos
print.amount=total.all.amount
amount.dsca = "GRAND TOTAL :"
amount.eng.dsca = convert.amount.to.word(po.currency.dsca,rpt.curr.ifx,total.all.amount)
rprt_send()
endselect