countnikon
20th July 2007, 19:35
I have a report that I'm working on that I need the text from the sales order to appear on the sales order lines but not on the installment lines.
Is this possible?
mark_h
20th July 2007, 20:00
Maybe I do not understand the question - but my answer would be - you can put text were you want it and suppress it using the output expression. So if for example I wanted to print all production orders, but only print text for complete orders - I would put tisfc001.txta on the report with an output express with tisfc001.osta = tcosta.ready. So maybe I do not understand the question.
countnikon
20th July 2007, 20:14
Thanks for the quick response mark.
The first line is the High Level Item from the Sales Order Lines.
The lines under it are the installment data. The installment data still has the Sales Order Lines Text printing under it. That is what I'm trying to get rid of.
here's some code
|******************************************************************************
|* tdsls9401 0 VRC B40C c4 csi0
|* Print Order Acknowledgement
|* bsp
|* 06-17-05 [09:03]
|******************************************************************************
|* Script Type: 4
|******************************************************************************
|****************************** DECLARATION SECTION ***************************
declaration:
table ttccom010
table ttcmcs002
table ttcmcs039
table ttdsls040
table ttdsls041
table ttdsls045
table ttdsls048
table ttipcs021
table ttdsls020
table ttcmcs046
|****************************** form variables ********************************
extern domain tccuno cuno.f fixed | From customer
extern domain tccuno cuno.t fixed | To customer
extern domain tcorno orno.f | From order number
extern domain tcorno orno.t | To order number
extern domain tcncmp comp.f | Fin.comp.to
extern domain tcncmp comp.t | Fin.comp.f
extern domain tcyesno hide.prices.f | Show pricing info?
extern domain tdsls.kofl printed | Already printed bills
extern domain tcyesno selection | Select spec. order no.
extern domain tcyesno prnt.options | Print variant options
extern domain tcyesno prnt.sellpr | Print variant prices
extern domain tdsls.koqu quan.to.print
|****************************** prog variables ********************************
long copies
long open.mode
domain tcorno s.orno
domain tcmcs.st45 exag.4401
extern domain tcstno stno.4401
extern domain tcbool apdx
extern domain tcmcs.long line
extern domain tcmcs.long nr.copy
extern domain tcmcs.st20 orco
extern domain tcdsun prun.print
extern domain tcdsun quun.print
extern domain tccrnd crnd.orno
extern domain tctxtn txtn.ptr | Pointer to text file
extern domain tcdsca header.text | for EDI hardcopy
domain tcorno save.orno,zoom.orno
domain tcorno lsp.orno | last printed value
domain tcpono lsp.pono | last printed value
domain tcsrnb lsp.srnb | last printed value
extern long stand.desc
extern long itm.txtn
extern domain tcnama isls.cdel.nama.l |#10023304.n
|****************************** zoom variables ********************************
extern domain tcorno orno.1, orno.2, orno.3, orno.4, orno.5,
orno.6, orno.7, orno.8, orno.9, orno.10
|****************************** PROGRAM SECTION ***************************
before.program:
|****************************** ZOOM FROM SECTION ***************************
zoom.from.all:
on.entry:
import("tdsls040.orno",zoom.orno)
|****************************** FORM SECTION ***************************
form.1:
init.form:
if orno.f = 0 then
get.screen.defaults()
endif
if zoom.orno <> 0 then
orno.f = zoom.orno
orno.t = zoom.orno
display("orno.f")
display("orno.t")
endif
|****************************** CHOICE SECTION ***************************
choice.cont.process:
on.choice:
execute(print.data)
choice.print.data:
on.choice:
if rprt_open() then
print.order.range()
rprt_close()
else
choice.again()
endif
|****************************** FIELD SECTION ***************************
field.cuno.f:
when.field.changes:
cuno.t = cuno.f
field.orno.f:
when.field.changes:
orno.t = orno.f
|****************************** MAIN TABLE SECTION ***************************
|****************************** FUNCTION SECTION ***************************
functions:
function print.order.selection()
{
save.orno = 0
select tdsls045.*, tdsls040.*, tdsls041.*, tccom010.*, tcmcs042.*
from tdsls045 for update, tdsls040, tdsls041, tccom010, tcmcs042
where (tdsls045._index1 = {:orno.1} or
tdsls045._index1 = {:orno.2} or
tdsls045._index1 = {:orno.3} or
tdsls045._index1 = {:orno.4} or
tdsls045._index1 = {:orno.5} or
tdsls045._index1 = {:orno.6} or
tdsls045._index1 = {:orno.7} or
tdsls045._index1 = {:orno.8} or
tdsls045._index1 = {:orno.9} or
tdsls045._index1 = {:orno.10} )
and tdsls045.cuno inrange :cuno.f and :cuno.t
and tdsls045.srnb = 0
and tdsls045.pono <> 0
and tdsls045.orno refers to tdsls040
and tdsls040.cotp refers to tcmcs042
and tdsls045.cuno refers to tccom010 unref skip
and tdsls045.cmba refers to tdsls041
order by tdsls045.orno, tdsls045.pono, tdsls045.srnb
selectdo
update.tdsls041.taxcodes(tdsls045.orno,tdsls045.pono,tdsls045.pono)
| Get Alt. Item by Item Code Systemq | CSI.bn
select tiitm012.aitc
from tiitm012
where tiitm012.item = :tdsls041.item
and tiitm012.cntr = :tdsls041.cntr
and tiitm012.citt = :tdsls041.citt
selectdo
endselect
line = 1
rprt_send()
line = 0
print.text.itemlines.isls0013()
endselect
}
function print.order.range()
{
save.orno = 0
select tdsls045.*, tdsls040.*, tdsls041.*, tccom010.*, tcmcs042.*
from tdsls045, tdsls040, tdsls041, tccom010, tcmcs042
where tdsls045._index1 inrange {:orno.f} and {:orno.t}
and tdsls045.cuno inrange :cuno.f and :cuno.t
and tdsls045.srnb = 0
and tdsls045.pono <> 0
and tdsls045.orno refers to tdsls040
and tdsls040.cotp refers to tcmcs042
and tdsls045.cuno refers to tccom010 unref skip
and tdsls045.cmba refers to tdsls041
order by tdsls045.orno, tdsls045.pono, tdsls045.srnb
selectdo
update.tdsls041.taxcodes(tdsls045.orno,tdsls045.pono,tdsls045.pono)
| Get Alt. Item by Item Code Systemq | CSI.bn
select tiitm012.aitc
from tiitm012
where tiitm012.item = :tdsls041.item
and tiitm012.cntr = :tdsls041.cntr
and tiitm012.citt = :tdsls041.citt
selectdo
endselect
line = 1
rprt_send()
line = 0
print.text.itemlines.isls0013()
print.instalment.schedule()
txtn.ptr = 0
endselect
|select *
|from tdsls048
|where tdsls048._index1 inrange {:orno.f} and {:orno.t}
|selectdo
| print.instalment.schedule()
|endselect
}
function print.text.itemlines.isls0013()
{
stand.desc = true
if tdsls041.sdsc = tcyesno.yes then
print.standard.text.isls0013()
isls.cdel.nama.l = "" |#10023304.n
| In several reports there is check on this variable.
| When this variable isn't initialized, the delivery date would
| be printed twice.
endif
print.itemline.text.isls0013()
}
function print.standard.text.isls0013()
{
search.textnumber.isls0013()
if txtn.ptr <> 0 then
rprt_send()
else
stand.desc = false
rprt_send()
stand.desc = true
endif
}
function search.textnumber.isls0013()
{
txtn.ptr = 0
if not isspace(tdsls041.cprj) and tdsls041.opol = tcittc.customized then
find.text.for.customized.item.isls0013()
else
tdsls020.item = tdsls041.item
tdsls020.cntr = tdsls041.cntr
fix.cuno.for.item.description.isls0013()
read.sls020.1eq.isls0013()
if tdsls020.txta <> 0 then
txtn.ptr = tdsls020.txta
else
tdsls020.cuno = tdsls040.cuno
read.sls020.1eq.isls0013()
if tdsls020.txta <> 0 then
txtn.ptr = tdsls020.txta
else
txtn.ptr = 0
endif
endif
endif
}
function fix.cuno.for.item.description.isls0013()
{
if not isspace(tdsls040.pctx) then
tdsls020.cuno = tdsls040.pctx
else
tdsls020.cuno = tdsls040.cuno
endif
}
function read.sls020.1eq.isls0013()
{
table ttdsls020
select tdsls020.txta
from tdsls020
where tdsls020._index1 = {:tdsls020.cuno, :tdsls020.item,
:tdsls020.cntr}
|HYDRPD_3.sn
as set with 1 rows
|HYDRPD_3.en
selectdo
selectempty
tdsls020.txta = 0
endselect
}
function find.text.for.customized.item.isls0013()
{
table ttipcs021
domain tctxtn hold.tiitm001.txts
if not isspace(tipcs021.cpvr) then
txtn.ptr = itm.txtn
return
endif
if isspace(tipcs021.dfit) then
txtn.ptr = itm.txtn
return
endif
select tiitm001.txts:hold.tiitm001.txts
from tiitm001
where tiitm001.item = :tipcs021.dfit
|HYDRPD_3.sn
as set with 1 rows
|HYDRPD_3.en
selectdo
selectempty
txtn.ptr = itm.txtn
return
endselect
tdsls020.item = tipcs021.dfit
tdsls020.cntr = ""
fix.cuno.for.item.description.isls0013()
read.sls020.1eq.isls0013()
if tdsls020.txta <> 0 then
txtn.ptr = tdsls020.txta
else
tdsls020.cuno = tdsls040.cuno
read.sls020.1eq.isls0013()
if tdsls020.txta <> 0 then
txtn.ptr = tdsls020.txta
else
txtn.ptr = hold.tiitm001.txts
endif
endif
}
function print.itemline.text.isls0013()
{
if tdsls041.txta then
txtn.ptr = tdsls041.txta
rprt_send()
endif
}
|*************************** deal instalments **********************************
function print.instalment.schedule()
{
table ttdsls048
domain tcpono save.pono
line = 2 | header
save.pono = tdsls045.pono
set.max(tdsls045.pono) | to force to end of acknowledgement
select tdsls048.*, tcmcs036.*
from tdsls048, tcmcs036
where tdsls048._index1 = {:tdsls045.orno}
and tdsls048.srnb = 0
and tdsls048.cmba refers to tcmcs036
order by tdsls048.orno, tdsls048.srna, tdsls048.srnb
selectdo
tdsls041.cvat = tdsls048.cvat
rprt_send()
if line = 2 then
line = 3 | detail
rprt_send()
endif
endselect
tdsls045.pono = save.pono
}
|**** end of include ****
|**** end of source ****
|******************************************************************************
|* tdsls940101000 VRC B40C c4 csi0
|* Sales Order Acknowledgement
|* bsp
|* 06-17-05 [10:21]
|******************************************************************************
|
|*
declaration:
double good.total
string date(10)
long array.length
long disc.ind
long disc.array |#10229340.n
long dummy.long
string dummy.string(1)
domain tcdiam discount |10227874.n
domain tcmcs.str30 disc.difo
domain tcmcs.str30 pric.difo
extern domain tcmcs.str12 disc.expr fixed
extern domain tcaitm tiitm012.aitc | CSI
extern domain tcdsca tcmcs080.dsca | CSI
extern domain tcnama tccom001.nama | CSI
extern domain tcnama billing.address(5) | CSI
extern domain tcnama delivery.address(5) | CSI
extern domain tcnama delivery.label | CSI
long tx.ctr
extern double cvat.totl |#TAXP.en
#include "itdsls0006" | calculate invoice totals
before.program:
date = sprintf$("%D001," & lattr.language$,date.num())
array.length = tdsls.dll0022.array.length()
rdi.domain("tcdisc",disc.difo,dummy.string,dummy.string,dummy.long,
dummy.string,dummy.long)
rdi.domain("tcdiam",pric.difo,dummy.string,dummy.string,dummy.long,
|10227874.n
dummy.string,dummy.long)
detail.10:
before.layout:
| Get Alt. Item by Item Code System
select tiitm012.aitc
from tiitm012
where tiitm012.item = :tdsls041.item
and tiitm012.cntr = :tdsls041.cntr
and tiitm012.citt = :tdsls041.citt
selectdo
endselect
if trim(tdsls041.cprj) = "" then
itm.dsca = get.itemdesc(tdsls041.item)
else
itm.dsca = get.projectitemdesc(tdsls041.cprj,tdsls041.item)
endif
if tdsls041.disc(1) <> 0 then
discount = tdsls041.disc(1)
disc.expr = sprintf$("%@"&disc.difo&"@",discount)
disc.expr = shiftr$(disc.expr)
else
discount = tdsls041.ldam(1)
disc.expr = pric.difo & "," & tdsls040.ccur
disc.expr = sprintf$(disc.expr,discount)
endif
disc.ind = 1
if ( line = 1 ) then
fill.incl.variables.isls0006()
update.line.totals.isls0006()
endif
before.field.tdsls045.orno.5:
before.layout:
message("get tax"&str(tdsls045.orno)&str(tdsls045.pono))
| Get Tax Codes
update.tdsls041.taxcodes(tdsls045.orno,tdsls045.pono,tdsls045.pono)
| Get Alt. Item by Item Code Systemq | CSI.bn
select tiitm012.aitc
from tiitm012
where tiitm012.item = :tdsls041.item
and tiitm012.cntr = :tdsls041.cntr
and tiitm012.citt = :tdsls041.citt
selectdo
endselect
detail.11:
before.layout:
disc.ind = disc.ind + 1
if disc.ind <= array.length then
if tdsls041.disc(disc.ind) <> 0 then
discount = tdsls041.disc(disc.ind)
disc.expr = sprintf$("%@"&disc.difo&"@", discount)
disc.expr = shiftr$(disc.expr)
else
discount = tdsls041.ldam(disc.ind)
disc.expr = pric.difo & "," & tdsls040.ccur
disc.expr = sprintf$(disc.expr,discount)
endif
if discount = 0 then
lattr.print = false
|#10229340.sn
for disc.array = disc.ind to array.length
if tdsls041.disc(disc.array) <> 0 then
lattr.print = true
endif
|#11961-1.sn
if tdsls041.ldam(disc.array) <> 0 then
lattr.print = true
endif
|#11961-1.en
endfor |#10229340.en
endif
else
lattr.print = false
endif
after.layout:
if disc.ind + 1 <= array.length then
layout.again()
endif
detail.35: |#10224135.sn
before.layout:
if tdsls041.sdsc = tcyesno.yes and tdsls041.txta and
not tdsls041.txta = txtn.ptr then
lattr.print = false
endif |#10224135.en
detail.140: |#TAXP.sn
before.layout:
lattr.print = (tcmcs010.pltx.l = tcyesno.yes) and
tccom999.txpr = tcyesno.yes and
line = 1 and
cvat.amount <> 0 ? true : false
after.orco.1:
before.layout:
cuno.isls0006 = tdsls040.cuno |#31bglo.sn
tax.exempt.isls0006 = true |#31bglo.en
calculate.invoice.totals.isls0006()
after.orco.4:
before.layout:
lattr.print = false
if print.ctau.header.isls0006() then
lattr.print = true
tx.ctr = 1
else
tx.ctr = max.cvat
endif
after.orco.5:
before.layout:
lattr.print = false
while tx.ctr <> max.cvat and not lattr.print
if print.ctau.line.isls0006(tx.ctr) then
lattr.print = true
else
tx.ctr = tx.ctr + 1
endif
endwhile
after.layout:
if tx.ctr <> max.cvat then
tx.ctr = tx.ctr + 1
layout.again()
endif
after.orco.8:
before.layout:
lattr.print = false
if print.ctau.header.isls0006() then
lattr.print = true
endif |#TAXP.en
after.orco.20: |EV#10229818
before.layout:
if tdsls000.oatd.4 = tdpur.pram.gross.and.disc then |#4.0.n
good.total = grgo.totl
cost.totl = grco.totl
else
good.total = good.totl
endif
if ( tdsls000.oatd.4 ) = tdpur.pram.nett.no.disc then |#10229818.sn
oatd = 1
endif |#10229818.en
r.head.control()
skip.to(spool.pg.length - 11)
after.layout:
init.all.totals.isls0006()
lattr.pageno = 0
before.orco.70:
before.layout:
|message(str$(tdsls040.orno))
| Sales Order
select tdsls040.cfrw, tdsls040.crep
from tdsls040
where tdsls040._index1 = {:tdsls040.orno}
selectdo
endselect
| Get Forwarding Agent description
select tcmcs080.dsca
from tcmcs080
where tcmcs080._index1 = {:tdsls040.cfrw}
selectdo
endselect
| Get Sales Rep name
select tccom001.nama
from tccom001
where tccom001._index1 = {:tdsls040.crep}
selectdo
endselect
|Fill in addresses
if fill.sales.delivery.address(tdsls040.orno, tdsls040.cuno, tdsls040.ccor, delivery.address ) then
delivery.label = "Delivery"
|message(worksite.label)
else
delivery.label = ""
endif
if not fill.sales.postal.address(tdsls040.orno, tdsls040.cuno, tdsls040.ccor, billing.address ) then
fill.customer.address(tdsls040.cuno,billing.address )
endif
billing.address(1,1) = billing.address(1,1)
field.tdsls040.txta:
before.print:
validate.textline()
field.tdsls040.txtb:
before.print:
validate.textline()
field.txtn.ptr:
before.print:
validate.textline()
field.tdsls048.txta:
before.print:
validate.textline()
|*** functions *****************************************************************
functions:
function validate.textline()
{
if ( lattr.prline(1;1) = ">" ) then
lattr.prline = lattr.prline(2)
else
if ( lattr.prline(1;1) = "<" ) then
lattr.print = false
endif
endif
}
function fill.incl.variables.isls0006() |EV#46666
{
date.isls0006 = tdsls040.odat
ccty.isls0006 = tdsls041.ccty
ccur.isls0006 = tdsls040.ccur
rate.isls0006 = tdsls045.rats
ratf.isls0006 = tdsls045.ratf
crnd.isls0006 = tcmcs002.crnd
if ( tdsls040.cvyn = tcyesno.yes ) then
cvat.isls0006 = tdsls041.cvat
else
cvat.isls0006 = ""
endif
if ( tdsls041.pric <> 0 and tdsls041.oqua <> 0 ) then
tdsls.dll0022.calc.net.amount( tdsls041.cvqs, |#4.0.sn
tdsls041.cvps,
tdsls041.oqua,
tdsls041.pric,
tdsls040.ccur,
crnd.orno,
tdsls041.dmth,
tdsls041.disc,
tdsls041.ldam,
amnt.isls0006,
ldam.isls0006) |#4.0.en
else
amnt.isls0006 = tdsls041.amta
ldam.isls0006 = 0.0
endif
if itm.kitm <> tckitm.cost and itm.kitm <> tckitm.service then
odam.isls0006 = amnt.isls0006 - imcs0010.amnt.min.odis(
amnt.isls0006,
|#46666.en
tdsls040.odis,
tdsls040.ccur,
crnd.orno)
else
odam.isls0006 = 0
endif
}
|**** end of report ****
mark_h
20th July 2007, 21:27
Okay - this is in the report somewhere. Can you tell which layout prints which fields? What are the output expresions? What it looks like is there are several detail layouts to print all of the information. Is the text information you are referring to in a detail layout? If it is then you have to look at the output expression to see why it is true for each of these layouts. My first thought was that the sales order lines (and text) should be in a before.field layout. Keep in mind I really do not know how the sales stuff works, but you should certainly be able to turn off that text. To me it looks like it is in the output expression.
countnikon
20th July 2007, 21:55
I believe that it is detail.20 printing the text.
Also the print expression is txtn.ptr I believe.
detail.60 is printing the installment lines.
detail.70 is printing the installment text.
I'm editing this report that my boss did and I've never messed with the BaaN reports before so I'm really struggling with this.
mark_h
20th July 2007, 22:10
So then I would say you need to change the print expression on detail.20 that is printing the text. Evidently the text.ptr is set for both types of detail lines. Usually like some of the bom reports you have print expressions like k.of.data - depending on which detail you print on what you sent in k.of.data. So you might be able to look at the out expression for detail.60 - see that what it says. The change detail.20 output expression to be something like text.ptr and not (detail.20 output expression). So try playing with combining the two output expressions.
countnikon
20th July 2007, 23:39
Mark,
It turns out I was a bit wrong on what field was what on this report. Thanks for all your help. If it weren't for you, I would have been in all the wrong places.