Elrodyn
19th December 2008, 12:05
Hello all,


i'm having problem with the print condition on the LN report,


i want to set the print condition on my report like this:

if the field cisli205.vtal is empty the report isn't printed

i already use the sprint$(cisli205.vtal) <>"" but the result is the report isn't printed at all eventhough the field isn't empty.

i tried the lattr.print = false command too, but is seems not working at all.

below is the script i used for the report, i customized it based from original report.

|******************************************************************************
|* Component : cisli220011000 VRC B50 a df01
|* Name : Invoices
|* Author : Jan Visser
|* Date Written : 27-03-97 [16:45]
|******************************************************************************

declaration:

table ttcmcs055 |#116722-1.n
table ttcemm170 |#900-140022.sn
table ttcmcs036
table tcisli206
| table ttcmcs142 |#BRQ000813.o
table ttcmcs005 |#900-140022.en
table ttcmcs041 |#Gem_INC.sn
table ttcmcs042 |#Gem_INC.en
table ttccom000 |#201164.sn
table tcisli205
table tcisli225
table tcisli240
table tcisli256
table ttctax000 |#206601.n
table ttccom114
table ttccom115
table ttccom130
table ttcmcs010 |#201164.en
table ttcmcs002 |#203578.n
table tcisli901
table ttccom100
table tcisli900

domain tcmcs.double transfer |* Carry forward variable

|* Variables of Payment Schedules
domain tcdate due.date(1) based |* Due date array
domain tcamnt dues.amount(1) based |* Due amount array
domain tcamnt dues.amount.eur(1) based |* Due amount (Euro) array
domain tfcmg.paym paym.method(1) based |#200-153929.n

|DF78548-1.n
long due.counter |* Due counter
long count.dues |* Count of due records
domain tcmcs.int hold.nhln |* Number of blank lines
domain tcbool tax.exempt |* is tax exempt to be used
domain tddmth detail.dism(11) |* Discount Methods
domain tcamnt discount |#116722-1.sn
domain tcmcs.str12 disc.expr fixed
domain tcmcs.str30 dummy.disc |#132163.n
domain tcmcs.str30 disc.difo
domain tcmcs.str30 pric.difo
long dummy.long
long disc.array
string dummy.string(1) |#116722-1.en
long sql.id
long error
domain tcamnt taxable.amount |#900-140022.sn
domain tcmcs.long loc.pos
domain tcccur loc.curr
long sql.id2
long error2 |#900-140022.sn
extern domain tcamnt tot.due.on.amount |#200-89095.n
extern domain tfcmg.paym paym.method.on.rep |#200-153929.n
extern domain tfgld.inel tax.display
| extern domain tcamnt tot.amnt |#200-65495.n
domain tcbool original.invoice |#900-134258.n
extern domain tcamnt settled.amti |#119506-1.n
|#Draft.sn
extern domain tcmcs.ctau tax.authority(1) based
extern domain tcdsca tax.authority.desc(1) based
extern domain tcfovn tax.exempt.numb(1) based
extern domain tcamnt tax.base.amnt.inv(1) based
extern domain tcpvat tax.percent(1) based
extern domain tcamnt tax.amnt.inv(1) based
extern domain tcamnt tax.amnt.home(1,1) based
extern domain tcccty tax.country(1) based
extern domain tccvat tax.id.array(1) based
extern domain tcqsl1 lot.quantity(1) based
extern domain tcclot lot.code(1) based
extern domain tcibd.sern serial.nos(1) based
extern domain tcqsl1 rep.lot.quantity
extern domain tcclot rep.lot.code
extern domain tcibd.sern rep.serial.nos
extern domain tcmcs.long expand.array
|#800-146442.sn
extern domain tcmcs.long r.row
extern domain tcmcs.str100 print.lot.string(1) based
extern domain tcmcs.str100 rep.lot.string
|#800-146442.en
extern domain tcmcs.long row.len(1) based |#212390.sn
extern domain tcmcs.st41 lot.array(1) based
domain tcmcs.long def.lot(1,4)
domain tcmcs.long domain.length.lot
domain tcmcs.long row.max
domain tcmcs.long row.no
extern domain tcmcs.long max.lot.element |#212390.en
extern domain tcamnt sum.hbai |#219960.n
extern domain tcmcs.long no.of.lines |#212790.sn
extern domain tcmcs.long max.disc.element
extern domain tcamnt ldam.cisli245(1,1) based
domain tcmcs.long def.disc(1,4)
domain tcmcs.long disc.row
extern domain tcmcs.st45 disc.arr(1) based
domain tcmcs.long domain.length.disc
extern domain tcmcs.long max.disc.element |#212790.en
extern domain tddmth dism.cisli245(1,1) based|#218677.sn
domain tddmth discount.method |* Discount Method
|#218677.en
extern domain tcnama itbp.nama |#204252.sn
extern domain tcnamb itbp.namb
extern domain tcnamc itbp.namc
extern domain tcnamd itbp.namd
extern domain tcname itbp.name

extern domain tcnama cofc.nama
extern domain tcnamc cofc.namc
extern domain tcname cofc.name
extern domain tcpstc cofc.pstc

extern domain tcnama pfbp.nama
extern domain tcname pfbp.name
extern domain tcpstc pfbp.pstc
extern domain tcbano bank.acc
extern domain tcmcs.long prnt.pay.slip
extern domain tcmcs.str32 bkrn.pay.slip
|#204252.en
extern domain tcmcs.str1 perc.sign |#200-108356.sn
extern domain tcmcs.str20 exempt.labl |#200-108356.en
domain tcmcs.long d.convert
domain tcmcs.long d.temp.length
long ret


extern domain tcmcs.long array.index.1
extern domain tcmcs.long array.index.2
extern domain tcbool draft.print
extern domain tcbool no.currencies
extern domain tcbool d.length(5)
extern domain tcbool tax.summary
extern domain tcbool tax.amounts.by.authority
| extern domain tcbool prnt |#900-149150.n
extern domain tcdesc dept.desc |#900-204041.sn
extern domain tccwoc dept |#900-204041.en
extern domain tcmcs.str15 del.note.desc |#201164.sn
extern domain tcmcs.str132 del.notes
string dlyn.string(1) based
long no.of.rec
long length.del.notes
long getpos
domain tcbool mem.allocated
domain tcyesno o.bank
domain tcyesno o.badr
extern domain tcmcs.str60 badr.1(20) |#201164.en
domain tcamnt settled.txai |#143482.sn
domain tcamnt goods.net.amnt |#143482.en
domain tcmcs.ctau tax.ath(1)
domain tcdsca tax.ath.desc(1)
domain tcfovn tax.exmpt(1)
domain tcamnt tax.base.amount(1)
domain tcpvat tax.perc(1)
domain tcamnt tax.amount(1)
domain tcamnt tax.amount.home(3)
domain tcccty tax.ctry (1)
domain tccvat tax.code(1)
domain tcmcs.ctau tax.athy
domain tcdsca tax.ath.des
domain tcfovn tax.exmt
domain tcamnt tax.bs.amnt
domain tcpvat tax.prc
domain tcamnt tax.amt
domain tcccty tax.cty
domain tccvat tax.cde
domain tcdsca lps.description
domain tcdsca terms.of.paym.desc
domain tctxtn terms.of.paym.text
domain tcdays lps.days
domain tcdays disc.period.1
domain tcdays disc.period.2
domain tcdays disc.period.3
domain tcperc lps.percentage
domain tcperc disc.percent.1
domain tcperc disc.percent.2
domain tcperc disc.percent.3
domain tcbool print.lot.serial
domain cisli.msid i.msid |#201164.sn
domain tcncmp i.ncmp
domain tcpono i.msln
domain tcncmp slcp.250
domain tcorno srvo.250
| domain tcmcs.str30 invt.255 |#200-106280.so
| domain tcmcs.str30 acln.255 |#200-106280.eo
long posno |#200-106280.n
long lineno
domain tcpono lino.255
domain tcncmp slcp.275
domain tcorno frno.275
domain tcyesno iniv.275
domain tcpono pono.275
domain tcyesno varl.275
domain tcncmp slcp.245
| domain tcdeln dlyn.245 |#200-106351.so
| domain whinh.shpm shpm.245
| domain tcpono pono.245 |#200-106351.eo
domain tcpono sqnb.245
long dummy.val
domain tclang dummy.language |#201164.en
domain tcyesno sfcp.gtro |#203578.n
domain tcmcs.long i
domain tcmcs.long j
domain tcmcs.long k |#Draft.en
domain tcmcs.long l
extern domain tcbool bp.bank.filled |#200-107144.n
extern domain tfgld.ttyp transaction.type |#206601.sn
extern domain tfgld.docn document.number |#206601.en
extern domain tcamnt gdai.discount |#227038.sn
extern domain tcamnt csai.discount
extern domain tcamnt rmai.discount |#227038.en
|#215907.sn
extern domain tcmcs.str60m heco.1(20) |* header company
|#215907.en
string st(30) |#217767.sn
string lot.desc(30)
string quantity.desc(30)
long length1
long length2
long label_len
long len_ret
long convert |#217767.en
domain tcbool prnt.pric |#227642.n

domain cisli901.fpno fpno
domain tcnama itbpnama
domain tcnamc itbpnamc
domain tcstr17 itbpnaam
domain tcmcs.str25 npwp
long rowcount
extern domain tcamnt amth
extern domain tcamnt txah
domain tcamnt total.amti
domain tcamnt total.amth
domain tcratc rate
domain tclino nourut
extern domain tcmcs.str50 add1
extern domain tcmcs.str50 add2
extern domain tcmcs.str15 npwpc

|untuk detail

extern domain tcmcs.str100 idatc
long sql1
extern domain tcdate idatcs
extern domain tcmcs.str100 jbtnc


#include <bic_text> |#201747.n
#define TEXT.HANDLING |#900-132243.sn
^ {
^ validate.textline()
^ } |#900-132243.en
|#85244-1.en
before.program: |#116722-1.sn
rdi.domain("tcdisc",disc.difo,dummy.string,dummy.string,dummy.long,
dummy.string,dummy.long)
rdi.domain("tcamnt",pric.difo,dummy.string,dummy.string,dummy.long,
dummy.string,dummy.long) |#116722-1.en
original.invoice = false |#900-134258.n
mem.allocated = false |#201164.sn
dummy.val = tcmcs.dll0005.read.company.data(get.compnr(),dummy.language)
|#201164.en
l = 1 |#800-146442.n
perc.sign = "%" |#200-108356.sn
exempt.labl = form.text$("cislis2200", lattr.textlang$) |#200-108356.en
initialize.definition.qss.lot.pos() |#212390.n
initialize.definition.qss.disc.pos() |#212790.n
nourut = 1


|******************************************************************************
|* AFTER RECEIVE DATA
|******************************************************************************
after.receive.data:
import("cisli245.ldam",cisli245.ldam) |#116722-1.n
import("count.dues", count.dues)
import("settled.amti", settled.amti) |#119506-1.n
import("detail.dism",detail.dism)
import("lps.description",lps.description)
import("terms.of.paym.desc",terms.of.paym.desc)
import("terms.of.paym.text",terms.of.paym.text)
import("lps.days",lps.days)
import("disc.period.1",disc.period.1)
import("disc.period.2",disc.period.2)
import("disc.period.3",disc.period.3)
import("lps.percentage",lps.percentage)
import("disc.percent.1",disc.percent.1)
import("disc.percent.2",disc.percent.2)
import("disc.percent.3",disc.percent.3)
import("settled.txai", settled.txai) |#143482.sn
import("goods.net.amnt",goods.net.amnt) |#143482.en
import("badr.1", badr.1) |#201164.sn
import("cisli205.pfbp", cisli205.pfbp) |#201164.en
import("cisli205.aaai", cisli205.aaai) |#212790.sn
import("cisli205.atbi", cisli205.atbi) |#212790.en
import("print.lot.serial", print.lot.serial)
import("bp.bank.filled", bp.bank.filled) |#200-107144.n
|#204252.sn
import( "itbp.nama", itbp.nama)
import( "itbp.namb" , itbp.namb)
import( "itbp.namc" , itbp.namc)
import( "itbp.namd" , itbp.namd)
import( "itbp.name" , itbp.name)
import( "cofc.nama" , cofc.nama)
import( "cofc.namc" , cofc.namc)
import( "cofc.name" , cofc.name)
import( "cofc.pstc" , cofc.pstc)
import( "pfbp.nama" , pfbp.nama)
import( "pfbp.name" , pfbp.name)
import( "pfbp.pstc" , pfbp.pstc)
import( "bank.acc" , bank.acc)
import( "cisli205.bkrl" , cisli205.bkrl)
import( "cisli205.amti" , cisli205.amti)

import( "cisli205.amth" , amth)
import( "cisli205.txah" , txah)
import( "cisli205.rate" , rate)

import("prnt.pay.slip",prnt.pay.slip)
import("bkrn.pay.slip",bkrn.pay.slip) |#204252.en
| import("prnt",prnt) |#900-149150.n
import("max.lot.element", max.lot.element) |#212390.sn
import("sum.hbai", sum.hbai) |#219960.n
import("gdai.discount", gdai.discount) |#227038.sn
import("csai.discount", csai.discount)
import("rmai.discount", rmai.discount) |#227038.en
if max.lot.element <> 0 then
alloc.mem(lot.array, 41, max.lot.element)
alloc.mem(row.len, max.lot.element)
import("lot.array", lot.array)
import("row.len", row.len)
endif |#212390.en
import("no.of.lines", no.of.lines) |#212790.sn
import("max.disc.element", max.disc.element)
if no.of.lines <> 0 then
alloc.mem(disc.arr, 45, max.disc.element)
import("disc.arr", disc.arr)
| alloc.mem(ldam.cisli245, 1, no.of.lines) |#218677.o
alloc.mem(ldam.cisli245, no.of.lines, 11) |#218677.n
import("ldam.cisli245", ldam.cisli245)
alloc.mem(dism.cisli245, no.of.lines, 11) |#218677.sn
import("dism.cisli245", dism.cisli245) |#218677.en
endif |#212790.en
if (cisli205.nslo > 0 and print.lot.serial) then
| import("expand.array",expand.array) |#800-146442.so
| rdi.domain.string("tcclot",d.temp.length, d.convert)
| ret = alloc.mem(lot.code, d.temp.length,expand.array)
| rdi.domain.string("tcibd.sern",d.temp.length, d.convert)
| ret = alloc.mem(serial.nos, d.temp.length,expand.array)
| alloc.mem(lot.quantity,expand.array)
| import("lot.code", lot.code)
| import("serial.nos",serial.nos)
| import("lot.quantity",lot.quantity) |#800-146442.eo
import("r.row",r.row) |#800-146442.sn
alloc.mem(print.lot.string,100,r.row)
import("print.lot.string",print.lot.string) |#800-146442.en
alloc.mem(lot.quantity, r.row) |#212390.sn
import("lot.quantity", lot.quantity) |#212390.en
endif

alloc.mem(due.date, count.dues)
alloc.mem(dues.amount, count.dues)
alloc.mem(dues.amount.eur, count.dues) |DF78548-1.n
alloc.mem(paym.method, 3, count.dues) |#200-153929.n
for due.counter = 1 to count.dues
get.indexed.var(parent,
"due.date",
due.date(due.counter),
due.counter)
get.indexed.var(parent,
"dues.amount",
dues.amount(due.counter),
due.counter)
get.indexed.var(parent, |DF78548-1.sn
"dues.amount.eur",
dues.amount.eur(due.counter),
due.counter) |DF78548-1.en
get.indexed.var(parent, |#200-153929.sn
"paym.method",
paym.method(1, due.counter),
due.counter) |#200-153929.en
endfor
due.counter = 0
|* cisli205.wamt is removed from Input fields and detail.lamt
|* is added to Input fields.
import("cisli205.wamt", cisli205.wamt) |#227642.n
| tcmcs.dll0095.read.parm("tccom999") |#Reger_OTH.o

|******************************************************************************
|* BEFORE FIELDS
|******************************************************************************
before.header.key.10:
before.layout:
need(calculate.before.header.key.10.need.lines() +
calculate.detail.need.lines())

before.copy.nr.10:
before.layout: |#215907.sn
import("heco.1", heco.1) |#215907.en
after.layout:
hold.nhln = cisli120.nhln
original.invoice = true |#900-134258.n

before.copy.nr.12:
before.layout: |#215907.sn
import("heco.1", heco.1) |#215907.en
after.layout:
hold.nhln = cisli120.nhln

before.copy.nr.15:
before.layout: |#130154.sn
import("heco.1", heco.1) |#215907.n
| if original.invoice then |#134258.n |#135892.o
if original.invoice or copy.nr > 1 then |#135892.n
lattr.pageno = 0 |#130154.en
endif |#900-134258.n
after.layout:
hold.nhln = cisli120.nhln

before.copy.nr.20:
before.layout: |#215907.sn
import("heco.1", heco.1) |#215907.en
after.layout:
hold.nhln = cisli120.nhln

before.copy.nr.25:
after.layout:
hold.nhln = hold.nhln - 1
if hold.nhln > 0 then
layout.again()
endif

before.copy.nr.50:
before.layout:
transfer = 0
end.invoice = false
import("dept.desc",dept.desc) |#900-204041.sn
import("dept",dept) |#900-204041.en

before.copy.nr.80:
before.layout:
select cisli901.fpno:fpno
from cisli901
where cisli901.invn=:cisli205.idoc
and cisli901.ityp=:cisli205.ityp
selectdo
endselect

select tccom100.nama:itbpnama,cisli205.idat:1
from tccom100,cisli205
where tccom100.bpid=cisli205.itbp
and cisli205.idoc=:cisli205.idoc
and cisli205.ityp=:cisli205.ityp
SELECTBIND(1,idatcs)
selectdo
endselect
idatc = sprintf$("%u(%02y)",idatcs)

select tccom130.namc:itbpnamc, tccom130.vatl:npwp
from tccom130,cisli205
where tccom130.cadr=cisli205.itoa
and cisli205.idoc=:cisli205.idoc
and cisli205.ityp=:cisli205.ityp
selectdo
endselect

select tccom130.ln01:add1,tccom130.ln02:add2
from tccom130,cisli205,tccom100
where tccom100.bpid =:cisli205.itbp
and tccom130.cadr = tccom100.cadr
selectdo
endselect

select cisli900.naam:itbpnaam, cisli900.jbtn:jbtnc
from cisli900
where cisli900.year= :idatc
selectdo
endselect
npwpc = npwp




before.copy.nr.90:
before.layout:
transport = transfer

before.line.key.40: |#201164.sn
before.layout:
|#226785.so
| import("prnt",prnt) |#900-149150.n
|#226785.eo
if prnt then |#900-149150.n
del.note.desc = ""
if tccom000.deln = tcyesno.yes then
tt.label.desc("cicisli.dlyn",ltoe(1), del.note.desc)
del.note.desc = del.note.desc & " " & ":"
|#200-106351.n
endif
else |#900-149150.sn
lattr.print = false
endif |#900-149150.en

before.line.key.50:
before.layout:
string.scan(header.key,"%d %d",i.ncmp,i.msid)
string.scan(line.key,"%d",i.msln)
| select cisli225.dlyn |#200-106246.o
select cisli225.dlyn, cisli225.chtp |#200-106246.n
from cisli225
where cisli225._index1 = {:i.ncmp, :i.msid, :i.msln}
as set with 1 rows
selectdo
endselect
if cisli225.chtp = cisli.chtp.goods then |#200-106246.sn
lattr.print = true
else
lattr.print = false
endif |#200-106246.en

before.line.key.55:
before.layout:
| dummy.val = |#200-106280.so
| tcmcs.dll0005.read.company.data(cisli205.sfcp,dummy.language)
|#200-106280.eo
del.notes = ""
posno = 0 |#200-106280.n
if not mem.allocated then
if line = 5 then
string.scan(header.key,"%d %s",slcp.250,srvo.250)
|#200-106280.so
| string.scan(line.key,"%s %s %d",acln.255, invt.255, lino.255)
|#200-106280.eo
posno = rpos(line.key, " ") |#200-106280.sn
lino.255 = lval(line.key(posno+1)) |#200-106280.en

select count(*):no.of.rec
from cisli256
where cisli256._index2 = {:slcp.250, cisli.ortp.serv.ord,
:srvo.250, :hold.255.acln, :hold.255.invt,
:lino.255}
as set with 1 rows
selectdo
endselect
if no.of.rec <> 0 then
alloc.mem(dlyn.string, no.of.rec*20)
dlyn.string = ""
mem.allocated = true
select cisli256.*
from cisli256
where cisli256._index2 = {:slcp.250,
cisli.ortp.serv.ord, :srvo.250, :hold.255.acln,
:hold.255.invt, :lino.255}
selectdo
dlyn.string(len(strip$(dlyn.string))+2) =
cisli256.dlyn
endselect
length.del.notes = len(strip$(dlyn.string))
if length.del.notes > 130 then
getpos = rpos(dlyn.string(1;132)," ")
del.notes = dlyn.string(1;getpos)
else
del.notes = dlyn.string(1)
endif
endif
endif
if line = 8 then
string.scan(header.key,"%d %s",slcp.275,frno.275)
string.scan(line.key,"%d %d %d",iniv.275, pono.275, varl.275)

select count(*):no.of.rec
from cisli256
where cisli256._index3 = {:slcp.275, :frno.275,
:iniv.275, :pono.275, :varl.275}
as set with 1 rows
selectdo
endselect
if no.of.rec <> 0 then
alloc.mem(dlyn.string, no.of.rec*20)
dlyn.string = ""
mem.allocated = true
select cisli256.*
from cisli256
where cisli256._index3 = {:slcp.275, :frno.275,
:iniv.275, :pono.275, :varl.275}
selectdo
dlyn.string(len(strip$(dlyn.string))+2) =
cisli256.dlyn
endselect
length.del.notes = len(strip$(dlyn.string))
if length.del.notes > 130 then
getpos = rpos(dlyn.string(1;132)," ")
del.notes = dlyn.string(1;getpos)
else
del.notes = dlyn.string(1)
endif
endif
endif
else
length.del.notes = len(strip$(dlyn.string))
if length.del.notes > 130 then
getpos = rpos(dlyn.string(1;132)," ")
del.notes = dlyn.string(1;getpos)
else
del.notes = dlyn.string(1)
endif
endif
after.layout:
if mem.allocated then
if len(strip$(dlyn.string)) > 130 then
dlyn.string = dlyn.string(getpos+1)
layout.again()
else
getpos = 0
free.mem(dlyn.string)
mem.allocated = false
endif
endif |#201164.en

|******************************************************************************
|* DETAIL FIELDS
|******************************************************************************
detail.4: |#106-59608.n
before.layout:
disc.expr = "" |#204864.n
| l =1 |#212390.o
if max.lot.element <> 0 then |#212390.sn
row.no = get.row.no(cisli245.slso, cisli245.pono, cisli245.shpm,
cisli245.dlyn)
l = row.len(row.no)
endif |#212390.en
if no.of.lines <> 0 then |#212790.sn
disc.row = get.row.no.for.disc(cisli245.ortp, cisli245.koor,
cisli245.slso, cisli245.pono, cisli245.shpm,
cisli245.dlyn)
endif |#212790.en
need(calculate.detail.need.lines())
if detail.disc(1) <> 0 then |#116722-1.sn
discount = detail.disc(1)
disc.expr = sprintf$("%@"&disc.difo&"@",discount)
disc.expr = shiftr$(disc.expr)
if disc.row > 0 then |#222281.n
discount.method = dism.cisli245(disc.row, 1)|#218677.n
endif |#222281.n
else
if line = 4 then
| discount = cisli245.ldam(1) |#212790.o
if disc.row > 0 then |#212790.sn
| discount = ldam.cisli245(1, disc.row)|#218677.o
discount = ldam.cisli245(disc.row, 1)|#218677.n
else
discount = 0.0
endif |#212790.en
| |#132163.so
| disc.expr = pric.difo & "," & cisli205.ccur
| disc.expr = sprintf$(disc.expr,discount)|#132163.eo
|#132163.sn
discount = tccom.dll0001.domain.round(discount,
"tcamnt", cisli205.ccur)
dummy.disc = pric.difo & "," & cisli205.ccur
dummy.disc =
strip$(shiftl$(sprintf$(dummy.disc,discount)))
disc.expr = dummy.disc
disc.expr = shiftr$(disc.expr) |#132163.en
endif
endif
disc.ind = 1
| if tcmcs055.gnin = tcgrnt.nett then |#132163.so
| discount = 0
| endif |#132163.eo
|#116722-1.en

if interest.inv then |#Gemini_IIN.sn
if hold.key <> ikey and (not isspace(hold.key)) then
skip(1)
endif
endif |#Gemini_IIN.en
|# Space was not sufficeint in layout for Print |#227642.sn
|# Condition of detail.pric. Hence, it has been moved here.
prnt.pric = true
if (line = 3 and print.price) or
(line = 5 and print.price) or
(line <> 3 and line <> 5 and line <> 8) then
prnt.pric = true
endif |#227642.en

after.layout:
transfer = transfer + detail.amti - hold.235.hbai
rowcount = rowcount + 1
total.amti = total.amti + detail.amti
total.amth = total.amth + (detail.amti * rate)
nourut = nourut + 1

|detail.7: |#210140.sn |#213183.o
|#219815.so
|detail.8: |#213183.n |#210140.sn
|#219815.eo
detail.9: |#219815.n
before.layout:
disc.expr = ""
need(calculate.detail.need.lines())
if detail.disc(1) <> 0 then
discount = detail.disc(1)
disc.expr = sprintf$("%@"&disc.difo&"@",discount)
disc.expr = shiftr$(disc.expr)
endif
disc.ind = 1
after.layout:
transfer = transfer + detail.amti - hold.235.hbai |#210140.en
detail.42:
before.layout:
| if detail.disc(disc.ind) = 0 then |#116722-1.so
| lattr.print = false
| else
| lattr.print = true
| endif |#116722-1.eo
disc.expr = "" |#204864.n
disc.ind = disc.ind + 1 |#116722-1.sn
if disc.ind <= 11 then
if detail.disc(disc.ind) <> 0 then
discount = detail.disc(disc.ind)
disc.expr = sprintf$("%@"&disc.difo&"@", discount)
disc.expr = shiftr$(disc.expr)
if disc.row > 0 then |#222281.n
discount.method = dism.cisli245(disc.row, disc.ind)|#218677.n
endif |#222281.n
else
| discount = cisli245.ldam(disc.ind) |#218677.o
discount = ldam.cisli245(disc.row, disc.ind)|#218677.n
| |#132163.so
| disc.expr = pric.difo & "," & cisli205.ccur
| disc.expr = sprintf$(disc.expr,discount)|#132163.eo
|#132163.sn
discount = tccom.dll0001.domain.round(discount,
"tcamnt", cisli205.ccur)
dummy.disc = pric.difo & "," & cisli205.ccur
dummy.disc =
strip$(shiftl$(sprintf$(dummy.disc,discount)))
disc.expr = dummy.disc
disc.expr = shiftr$(disc.expr) |#132163.en
endif
if discount = 0 then
lattr.print = false
for disc.array = disc.ind to 11
if detail.disc(disc.array) <> 0 or
(line = 4 and
|#218677.sn
ldam.cisli245(disc.row, disc.array) <> 0) then
|#218677.en
|#218677.so
| cisli245.ldam(disc.array) <> 0) then
|#218677.eo
lattr.print = true
endif
endfor
endif
else
lattr.print = false
endif |#116722-1.en

after.layout:
if disc.ind <= 11 then
| disc.ind = disc.ind + 1 |#116722-1.o
layout.again()
endif

|detail.48: |#800-146442.so
|before.layout:
| if l <= expand.array then
| rep.lot.code = lot.code(1,l)
| rep.lot.quantity = lot.quantity(l)
| rep.serial.nos = serial.nos(1,l)
| lattr.print = true
| else
| lattr.print = false
| endif
|
|after.layout:
| if l <= expand.array then
| l = l+1
| layout.again()
| endif
|
|detail.49:
|before.layout:
| if l <= expand.array then
| rep.lot.code = lot.code(1,l)
| rep.lot.quantity = lot.quantity(l)
| rep.serial.nos = serial.nos(1,l)
| lattr.print = true
| else
| lattr.print = false
| endif
|
|after.layout:
| if l <= expand.array then
| l = l+1
| layout.again()
| endif |#800-146442.eo

detail.48: |#800-146442.sn
before.layout:
|#212390.sn
if row.no <> max.lot.element and max.lot.element <> 0 then
row.max = row.len(row.no+1)
else
row.max = r.row + 1
endif |#212390.en
| if l <= r.row then |#212390.o
if l < row.max then |#212390.n
rep.lot.string = print.lot.string(1,l)
if lot.quantity(l) <> 0 then |#212390.sn
|#217767.sn
tt.label.desc("cisli.lot",ttadv.cont.general,
lot.desc)
tt.label.desc("cisli.quantity",ttadv.cont.general,
quantity.desc)
label_len = len(lot.desc)
len_ret = rdi.domain.string("tcclot" , length1 ,
convert)
length2 = len(strip$(rep.lot.string))
st = string.set$(" " , length1 - length2 + 2)
|#217767.en
|#217767.so
| rep.lot.string = strip$(rep.lot.string) & " " &
| str$(lot.quantity(l))
|#217767.eo
|#217767.sn
rep.lot.string = strip$(lot.desc) & ":" &
strip$(rep.lot.string) & " " &
(st) & quantity.desc & ":" & str$(lot.quantity(l))
& " " & str$(detail.unit1) |#217767.en

endif |#212390.en
|*Now , lot & serial information is received in the form
|two dimensional array( this array will be already formatted in
|program script, so there is no need to format this one. we need
|to just print the array.
|*Always, lot code & lot quantity will be printed in a separate
|new line.
lattr.print = true
else
lattr.print = false
endif

after.layout:
| if l < r.row then |#212390.o
if l < row.max then |#212390.n
l = l+1
layout.again()
endif

detail.49:
before.layout:
|#212390.sn
if row.no <> max.lot.element and max.lot.element <> 0 then
row.max = row.len(row.no+1)
else
row.max = r.row + 1
endif |#212390.en
| if l <= r.row then |#212390.o
if l < row.max then |#212390.n
rep.lot.string = print.lot.string(1,l)
if lot.quantity(l) <> 0 then |#212390.sn
|#217767.sn
tt.label.desc("cisli.lot",ttadv.cont.general,
lot.desc)
tt.label.desc("cisli.quantity",ttadv.cont.general,
quantity.desc)
label_len = len(lot.desc)
len_ret = rdi.domain.string("tcclot" , length1 ,
convert)
length2 = len(strip$(rep.lot.string))
st = string.set$(" " , length1 - length2 + 2)
|#217767.en
|#217767.so
rep.lot.string = strip$(rep.lot.string) & " " &
str$(lot.quantity(l))
|#217767.eo
|#217767.sn
rep.lot.string = strip$(lot.desc) & ":" &
strip$(rep.lot.string) & " " &
(st) & quantity.desc & ":" & str$(lot.quantity(l))
& " " & str$(detail.unit1) |#217767.en

endif |#212390.en
|*Now , lot & serial information is received in the form
|two dimensional array( this array will be already formatted in
|program script, so there is no need to format this one. we need
|to just print the array.
|*Always, lot code & lot quantity will be printed in a separate
|new line.
lattr.print = true
else
lattr.print = false
endif

after.layout:
| if l < r.row then |#212390.o
if l < row.max then |#212390.n
l = l+1
layout.again()
endif
|#800-146442.en
detail.50: |#201164.sn
before.layout:
if tccom000.deln = tcyesno.yes and not isspace(cisli245.dlyn) then
string.scan(header.key,"%d",slcp.245)
|#200-106280.so
| string.scan(line.key,"%s %s %d %d",dlyn.245,shpm.245,pono.245,
| sqnb.245) |#200-106280.eo
|#200-106351.so
| |#200-106280.sn
| string.scan(line.key,"%19s %9s %d %d",dlyn.245, shpm.245,
| pono.245, sqnb.245) |#200-106280.en
|#200-106351.eo
posno = 0 |#200-106351.sn
posno = rpos(line.key, " ")
sqnb.245 = lval(line.key(posno+1)) |#200-106351.en

select cisli245.wght, cisli245.wgun, cisli240.ofad,
cisli245.cmba
from cisli245, cisli240
where cisli245.slcp = :slcp.245
and cisli245.slso = :cisli245.slso
and cisli245.ortp = :srct
and cisli245.pono = :cisli245.pono
and cisli245.sqnb = :sqnb.245
| and cisli245.shpm = :shpm.245 |#200-106351.o
and cisli245.shpm = :cisli245.shpm |#200-106351.sn
and cisli245.dlyn = :cisli245.dlyn |#200-106351.en
and cisli245.cmba refers to cisli240
selectdo
if not eu.country(cisli240.ofad, slcp.245) then
lattr.print = false
else
lattr.print = true
endif
endselect
endif |#201164.en

detail.52: |#BRQ000867.sn
before.layout:
if hold.255.invt = tcinvt.freight then
lattr.print = true
else
lattr.print = false
endif |#BRQ000867.en

detail.54:
before.layout:
if hold.255.acln <> save.acln and cisli120.pdtx = tcyesno.yes then
lattr.print = true
else
lattr.print = false
endif

detail.56:
before.layout:
if hold.255.acln <> save.acln and cisli120.pdtx = tcyesno.yes then
lattr.print = true
else
lattr.print = false
endif

detail.65: |#Gem_INC.sn
before.layout:
if extended.cdec = tcyesno.no then
read.terms.of.delivery.desc(terms.of.del)
endif

detail.75:
before.layout:
if extended.ptpa = tcyesno.no then
read.point.of.title.passage(point.of.title)
endif |#Gem_INC.en

|******************************************************************************
|* AFTER FIELDS
|******************************************************************************
after.copy.nr.1:
before.layout:
|need(10) |#900-140022.n
tax.exempt = true
i = 1 |#Draft.sn
j = 0
k = 1

import("draft.print",draft.print)
import("d.length",d.length)
import("array.index.1",array.index.1)
import("array.index.2",array.index.2)
import("no.currencies",no.currencies)
import("tax.summary",tax.summary)
import("tax.amounts.by.authority",tax.amounts.by.authority)

if draft.print then
alloc.mem(tax.country,d.length(4),array.index.2)
import("tax.country",tax.country)
alloc.mem(tax.id.array, d.length(5), array.index.2)
import("tax.id.array",tax.id.array)
if tax.amounts.by.authority then
alloc.mem(tax.authority, d.length(1), array.index.1)
import("tax.authority", tax.authority)
alloc.mem(tax.authority.desc,d.length(2), array.index.1)
import("tax.authority.desc",tax.authority.desc)
alloc.mem(tax.exempt.numb,d.length(3), array.index.1)
import("tax.exempt.numb",tax.exempt.numb)
alloc.mem(tax.base.amnt.inv, array.index.1)
import("tax.base.amnt.inv",tax.base.amnt.inv)
alloc.mem(tax.percent,array.index.1)
import("tax.percent",tax.percent)
alloc.mem(tax.amnt.inv,array.index.1)
import("tax.amnt.inv",tax.amnt.inv)
alloc.mem(tax.amnt.home,array.index.1,no.currencies)
import("tax.amnt.home",tax.amnt.home)
endif
endif |#Draft.en
|#900-140022.sn
select tcemm170.*
from tcemm170
where tcemm170._index1 = {:cisli205.sfcp}
selectdo
loc.curr = tcemm170.fcua
tcemm.dll5000.position.of.hcur( cisli205.sfcp,
loc.curr,
loc.pos)
endselect
if not draft.print then
import("transaction.type", transaction.type) |#206601.sn
import("document.number", document.number) |#206601.en
sql.id = sql.parse(
"select cisli209.* " &
"from cisli209 " &
"where cisli209._index1 = {:cisli205.sfcp, " &
":transaction.type, " &
":document.number}")
|#900-140022.en
sql.exec(sql.id)
error = sql.fetch(sql.id)

sql.id2 = sql.parse( |#900-140022.sn
"select cisli206.txct,cisli206.txid " &
"from cisli206 "&
"where cisli206._index1 = { :cisli205.sfcp, "&
":transaction.type, "&
":document.number} ")
sql.exec(sql.id2)
error2 = sql.fetch(sql.id2) |#900-140022.en
endif

due.counter = 0 |#200-92183.sn
due.on.amount = 0
tot.due.on.amount = 0 |#200-92183.en

if cisli205.ccur= "USD" then skip.to (spool.pg.length -17)else
skip.to (spool.pg.length -16) endif

after.copy.nr.2:
before.layout:
|need(10) |#900-140022.n
tax.exempt = true
i = 1 |#Draft.sn
j = 0
k = 1

import("draft.print",draft.print)
import("d.length",d.length)
import("array.index.1",array.index.1)
import("array.index.2",array.index.2)
import("no.currencies",no.currencies)
import("tax.summary",tax.summary)
import("tax.amounts.by.authority",tax.amounts.by.authority)

if draft.print then
alloc.mem(tax.country,d.length(4),array.index.2)
import("tax.country",tax.country)
alloc.mem(tax.id.array, d.length(5), array.index.2)
import("tax.id.array",tax.id.array)
if tax.amounts.by.authority then
alloc.mem(tax.authority, d.length(1), array.index.1)
import("tax.authority", tax.authority)
alloc.mem(tax.authority.desc,d.length(2), array.index.1)
import("tax.authority.desc",tax.authority.desc)
alloc.mem(tax.exempt.numb,d.length(3), array.index.1)
import("tax.exempt.numb",tax.exempt.numb)
alloc.mem(tax.base.amnt.inv, array.index.1)
import("tax.base.amnt.inv",tax.base.amnt.inv)
alloc.mem(tax.percent,array.index.1)
import("tax.percent",tax.percent)
alloc.mem(tax.amnt.inv,array.index.1)
import("tax.amnt.inv",tax.amnt.inv)
alloc.mem(tax.amnt.home,array.index.1,no.currencies)
import("tax.amnt.home",tax.amnt.home)
endif
endif |#Draft.en
|#900-140022.sn
select tcemm170.*
from tcemm170
where tcemm170._index1 = {:cisli205.sfcp}
selectdo
loc.curr = tcemm170.fcua
tcemm.dll5000.position.of.hcur( cisli205.sfcp,
loc.curr,
loc.pos)
endselect
if not draft.print then
import("transaction.type", transaction.type) |#206601.sn
import("document.number", document.number) |#206601.en
sql.id = sql.parse(
"select cisli209.* " &
"from cisli209 " &
"where cisli209._index1 = {:cisli205.sfcp, " &
":transaction.type, " &
":document.number}")
|#900-140022.en
sql.exec(sql.id)
error = sql.fetch(sql.id)

sql.id2 = sql.parse( |#900-140022.sn
"select cisli206.txct,cisli206.txid " &
"from cisli206 "&
"where cisli206._index1 = { :cisli205.sfcp, "&
":transaction.type, "&
":document.number} ")
sql.exec(sql.id2)
error2 = sql.fetch(sql.id2) |#900-140022.en
endif

due.counter = 0 |#200-92183.sn
due.on.amount = 0
tot.due.on.amount = 0 |#200-92183.en

if cisli205.ccur= "USD" then skip.to (spool.pg.length -17)else
skip.to (spool.pg.length -15) endif


after.layout:
total.amti = 0
total.amth = 0

after.copy.nr.4:
before.layout:
if draft.print then |#Draft.sn
lattr.print = tax.summary
else |#Draft.en
lattr.print = not error
endif

after.copy.nr.5:
before.layout:
if draft.print then |#Draft.sn
if i <= array.index.1 then
tax.ath(1,1) = tax.authority(1,i)
tax.athy = tax.ath(1,1)
cisli209.ctau = tax.athy
tax.ath.desc(1,1)= tax.authority.desc(1,i)
tax.ath.des = tax.ath.desc(1,1)
cisli209.dsca = tax.ath.des
tax.exmpt(1,1) = tax.exempt.numb(1,i)
tax.exmt = tax.exmpt(1,1)
cisli209.exno = tax.exmt
tax.base.amount(1) = tax.base.amnt.inv(i)
tax.bs.amnt = tax.base.amount(1)
cisli209.tbai = tax.bs.amnt
tax.perc(1) = tax.percent(i)
tax.prc = tax.perc(1)
cisli209.perc = tax.prc
tax.amount(1) = tax.amnt.inv(i)
tax.amt = tax.amount(1)
cisli209.txai = tax.amt
for j = 1 to no.currencies
tax.amount.home(j) = tax.amnt.home(i,j)
endfor
cisli209.txah = tax.amount.home
cisli209.txah(loc.pos) = tax.amount.home(loc.pos)
lattr.print = tax.summary
else
lattr.print = false
endif
else |#Draft.en
lattr.print = not error
endif
after.layout:
if draft.print then |#Draft.sn
if i <= array.index.1 then
i = i +1
layout.again()
endif
else |#Draft.en
if not sql.fetch(sql.id) then
layout.again()
else
sql.close(sql.id)
endif
endif |#Draft.n

after.copy.nr.6: |#900-140022.sn
before.layout:
if draft.print then |#Draft.sn
if k <= array.index.2 then
tax.ctry(1,1) = tax.country(1,k)
tax.cty = tax.ctry(1,1)
cisli206.txct = tax.cty
tax.code(1,1) = tax.id.array(1,k)
tax.cde = tax.code(1,1)
cisli206.txid = tax.cde
select tcmcs036.cvat,
tcmcs036.ccty,
tcmcs036.txta
from tcmcs036
where tcmcs036._index1 = { :tax.cty,
:tax.cde}
selectdo
endselect
while tcmcs036.txta = 0 |#216654.sn
k = k +1
if k <= array.index.2 then
tax.ctry(1,1) = tax.country(1,k)
tax.cty = tax.ctry(1,1)
cisli206.txct = tax.cty
tax.code(1,1) = tax.id.array(1,k)
tax.cde = tax.code(1,1)
cisli206.txid = tax.cde
select tcmcs036.cvat,
tcmcs036.ccty,
tcmcs036.txta
from tcmcs036
where tcmcs036._index1 = { :tax.cty,
:tax.cde}
selectdo
endselect
lattr.print = tax.summary
else
lattr.print = false
break
endif
endwhile |#216654.en
lattr.print = tax.summary
else
lattr.print = false
endif
else |#Draft.en
lattr.print = not error2 and not error
select tcmcs036.cvat,tcmcs036.ccty,tcmcs036.txta
from tcmcs036
where tcmcs036._index1 = { :cisli206.txct,
:cisli206.txid}
selectdo
while tcmcs036.txta = 0 |#216654.sn
if not sql.fetch(sql.id2) then
lattr.print = not error2 and not error
select tcmcs036.cvat,
tcmcs036.ccty,
tcmcs036.txta
from tcmcs036
where tcmcs036._index1={:cisli206.txct,
:cisli206.txid}
selectdo
endselect
else
sql.close(sql.id2)
lattr.print = false
break
endif
endwhile |#216654.en
endselect
endif |#Draft.en

after.layout:
if draft.print then |#Draft.sn
if k <= array.index.2 then
k = k +1
layout.again()
endif
else |#Draft.en
if not sql.fetch(sql.id2) then
layout.again()
else
sql.close(sql.id2)
endif |#900-140022.en
endif |#Draft.n

|after.copy.nr.8: |#203578.o
|#203578.sn
|* THIS LAYOUT after.copy.nr 8 HAS BEEN CHANGED TO after.copy.nr.7
after.copy.nr.7: |#203578.en
before.layout:
if draft.print then |#Draft.sn
lattr.print = tax.summary
else |#Draft.en
lattr.print = not error
endif

|after.copy.nr.9: |#203578.o
|#203578.sn
|* THIS LAYOUT after.copy.nr 9 HAS BEEN CHANGED TO after.copy.nr.8
after.copy.nr.8: |#203578.en
before.layout:
if draft.print then |#Draft.sn
lattr.print = tax.summary
else |#Draft.en
lattr.print = not error
endif

|after.copy.nr.10:

|#203578.o
|#203578.sn
|* THIS LAYOUT after.copy.nr 10 HAS BEEN CHANGED TO after.copy.nr.9
after.copy.nr.9:
before.layout:
sfcp.gtro = tccom000.gtro
if cisli205.sfcp <> get.compnr() then
read.gtro.param(cisli205.sfcp, sfcp.gtro)
endif
import("cisli205.rddf", cisli205.rddf) |#203578.en
cisli205.gdai = cisli205.gdai - gdai.discount |#227038.sn
cisli205.csai = cisli205.csai - csai.discount
cisli205.dcai = cisli205.dcai - gdai.discount - csai.discount
- rmai.discount
cisli205.rmai = cisli205.rmai - rmai.discount |#227038.en

after.layout:
end.invoice = true


after.copy.nr.10: |#203578.sn
before.layout:

if sfcp.gtro = tcyesno.yes and
grand.tot.rnd.factor.defined(cisli205.ccur) then
lattr.print = true
else
lattr.print = false
endif |#203578.en

after.copy.nr.18: |#201164.sn
before.layout:
| o.bank = tcyesno.no |#200-107145.o
o.badr = tcyesno.no |#200-107145.n
ciint.dlltfcmg.read.payment.method.bank.and.badr(cisli205.sfcp,
cisli205.paym, o.bank, o.badr)
| if o.bank = tcyesno.yes then |#200-107145.o
|#200-107144.so
| if o.badr = tcyesno.yes then |#200-107145.n
|#200-107144.eo
if o.badr = tcyesno.yes and bp.bank.filled then |#200-107144.n
lattr.print = true
else
lattr.print = false
endif

after.copy.nr.19:
before.layout:
| o.badr = tcyesno.no |#200-107145.o
o.bank = tcyesno.no |#200-107145.n
ciint.dlltfcmg.read.payment.method.bank.and.badr(cisli205.sfcp,
cisli205.paym, o.bank, o.badr)
| if o.badr = tcyesno.yes then |#200-107145.o
|#200-107144.so
| if o.bank = tcyesno.yes then |#200-107145.n
|#200-107144.eo
if o.bank = tcyesno.yes and bp.bank.filled then |#200-107144.n
select tccom114.cban, tccom114._index1
from tccom114
where tccom114._index1 = {:cisli205.pfbp}
and (tccom114.cofc = :cisli205.cofc or tccom114.cofc = "")
order by tccom114._index1 desc
as set with 1 rows
selectdo
select tccom115.bano
from tccom115
where tccom115._index1 = {:cisli205.pfbp,
:tccom114.cban}
as set with 1 rows
selectdo
endselect
endselect
lattr.print = true
else
lattr.print = false
endif |#201164.en

|after.copy.nr.18: |#201164.o
after.copy.nr.20: |#201164.n
before.layout:
skip.to (spool.pg.length -6)
due.counter = due.counter + 1
if due.counter <= count.dues then
due.on = due.date(due.counter)
| due.on.amount = dues.amount(due.counter) |#112688.o
|#112688.sn
due.on.amount = tccom.dll0001.domain.round(
dues.amount(due.counter),
"tcamnt", cisli205.ccur)
|#112688.en
due.on.amount.eur = dues.amount.eur(due.counter) |DF78548-1.n
paym.method.on.rep = paym.method(1, due.counter)|#200-153929.n
if due.on.amount = 0 then
else
if due.on.amount.eur = 0 then |DF78548-1.sn
colon = ""
else
colon = ":"
endif |DF78548-1.en
lattr.print = true
endif
|#200-92183.sn
tot.due.on.amount = tot.due.on.amount + due.on.amount
|#200-92183.en
endif
|#200-92183.so
| tot.due.on.amount = tot.due.on.amount + due.on.amount |#200-89095.n
lattr.print = false

after.layout:
if due.counter < count.dues then
layout.again()
endif
lattr.print = true

after.copy.nr.22: |#201164.n
before.layout:
need(get.needed.lines.for.after.copy.nr(20))

after.copy.nr.25:
before.layout:
need(get.needed.lines.for.after.copy.nr(25))

after.copy.nr.30:
before.layout:
need(get.needed.lines.for.after.copy.nr(30))

after.copy.nr.35:
before.layout:
need(get.needed.lines.for.after.copy.nr(35))

after.copy.nr.40:
before.layout:
need(get.needed.lines.for.after.copy.nr(40))
|#119506-1.sn
| tot.amnt = cisli205.amti - cisli205.aaai - |#200-65495.n
| cisli205.opai - cisli205.inii - cisli205.tbii |#200-65495.n
|#119506-1.en

|after.copy.nr.45:
after.copy.nr.31:
before.layout:
| need(get.needed.lines.for.after.copy.nr(45))
need(get.needed.lines.for.after.copy.nr(31))

after.copy.nr.70:
before.layout:
need(get.needed.lines.for.after.copy.nr(70))

after.copy.nr.80: |#201747.sn
before.layout:
need(get.needed.lines.for.after.copy.nr(80))
|#201747.en
after.copy.nr.85: |#800-149823.sn
before.layout:
|* Payment slip has to be always printed at the page bottom.
|* Hence we first store number of lines yet to be printed into lineno. After
|* we find the line number from which payment slip should be printed so as to be
|* be printed at the end of the current page
lineno = spool.pg.length - lattr.lineno
if lineno > 21 then
lineno = lineno + lattr.lineno -23
skip.to(lineno)
else
lineno = spool.pg.length -23
skip.to(lineno)
endif
|#800-149823.en

after.header.key.1: |#217728.sn
before.layout:
if order.discount <> 0 then
lattr.print = true
else
lattr.print = false
endif |#217728.en

after.header.key.10:
before.layout:
if cisli205.ccur="USD" then skip.to (spool.pg.length -21) else
skip.to (spool.pg.length -20) endif

|******************************************************************************
|* FOOTER
|******************************************************************************
footer.10:
before.layout:
transport = transfer

|******************************************************************************
|* TEXTS
|******************************************************************************

|#120536.sn
field.text:
before.print:
TEXT.HANDLING

field.atxt:
before.print:
TEXT.HANDLING

field.ftxt:
before.print:
TEXT.HANDLING
|#120536.en

field.dtxt:
before.print:
TEXT.HANDLING

field.cisli245.itxt:
before.print:
TEXT.HANDLING

field.cisli245.ltxt:
before.print:
TEXT.HANDLING

field.hold.255.actx:
before.print:
TEXT.HANDLING

field.hold.255.txtc:
before.print:
TEXT.HANDLING

|******************************************************************************
|* AFTER PROGRAM
|******************************************************************************
after.program:
free.mem(due.date)
free.mem(dues.amount)


|******************************************************************************
|* FUNCTIONS
|******************************************************************************
functions:

|******************************************************************************
|* Calculate needed lines for detail layouts
|******************************************************************************
function long calculate.detail.need.lines()
{
long need.detail.lines |* Needed printlines for details

need.detail.lines = 3

|* Lines from detail 3
if not isspace(detail.desc2) then
need.detail.lines = need.detail.lines + 1
endif

|* Lines from detail 7, 30 - 56 without textlines
if not (cisli120.pdtx = tcyesno.yes and dtxt) then
|* detail lines for detail 30 - 56
on case line
case 4: if cisli245.shpm <> save.shpm then
need.detail.lines = need.detail.lines + 1
endif
if cisli245.pono <> save.pono then
need.detail.lines = need.detail.lines + 5
endif
if not isspace(cisli245.cpva) and apdx then
need.detail.lines = need.detail.lines + 1
endif
break
case 5: if hold.255.srvo <> save.srvo then
|#106-59608.so
| need.detail.lines = need.detail.lines + 2
|#106-59608.eo
|#106-59608.sn
need.detail.lines = need.detail.lines + 4
|#106-59608.en
endif
if hold.255.acln <> save.acln then
|#106-59608.so
| need.detail.lines = need.detail.lines + 1
|#106-59608.eo
|#106-59608.sn
need.detail.lines = need.detail.lines + 3
|#106-59608.so
endif
break
endcase
endif

return(need.detail.lines +12)
}

|******************************************************************************
|* Calculate needed lines for layout: before.header.key.10
|******************************************************************************
function long calculate.before.header.key.10.need.lines()
{
long need.header.lines |* Needed printlines for Header

need.header.lines = 2
if not isspace(refb) then
need.header.lines = need.header.lines + 1
endif
if not isspace(header.dsca) then
need.header.lines = need.header.lines + 1
endif
if text and cisli120.phtx = tcyesno.yes then
need.header.lines = need.header.lines + 1
endif
if atxt and cisli120.patx = tcyesno.yes then
need.header.lines = need.header.lines + 1
endif
return(need.header.lines)
}

|******************************************************************************
|* Calculate needed lines for layouts: after.copy.nr
|******************************************************************************
function long get.needed.lines.for.after.copy.nr(long after.field)
{
long counter |* Counter for needed lines
long rtxt.no.lines |#201747.n
counter = 0
rtxt.no.lines = 0 |#201747.n
on case after.field
| case 20: if cisli205.inii <> 0 then |#201164.o
case 22: if cisli205.inii <> 0 then |#201164.n
counter = counter + 1
endif
case 25: if cisli205.tbii <> 0 then
counter = counter + 1
endif
case 30: if cisli205.aaai <> 0 then
counter = counter + 1
endif
case 35: if cisli205.opai <> 0 then
counter = counter + 1
endif
case 40: if cisli205.aaai <> 0 or cisli205.opai <> 0 then
counter = counter + 3
endif
| case 45: if cisli205.atbi <> 0 then
case 31: if cisli205.atbi <> 0 then
counter = counter + 1
endif
case 70: if lattr.break and not isspace(cisli120.sttf) then
counter = counter + 1
endif
case 80: if cisli120.rtxt <> 0 then |#201747.sn
text.present.in.language(cisli120.rtxt,
language$,
rtxt.no.lines)
counter = counter + rtxt.no.lines
endif |#201747.en
endcase
return(counter)
}
|#85244-1.sn
|******************************************************************************
|* Validate textline
|******************************************************************************
|* Information:
|* In the text editor it is possible to enter internal and external
|* text.
|* If the first line of a text starts with a '<' sign the text must
|* be handeled as an internal text. If the line starts '>' sign the
|* text must be handeled as an external text.
|* Example:
|* line 1:< This is an internal text and must not be printed on external
|* documents
|* line 2:> This is an external text and must be printed on interalal as
|* well as on external documents
|* line 3: This generic text an should be printed in all occassions.
|******************************************************************************
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
}
|#85244-1.en

function void read.terms.of.delivery.desc(domain tccdec i.cdec) |#Gem_INC.sn
{
select tcmcs041.txta, tcmcs041.dsca
from tcmcs041
where tcmcs041._index1 = {:i.cdec}
as set with 1 rows
selectdo
endselect
}

function void read.point.of.title.passage(domain tcptpa i.ptpa)
{
select tcmcs042.dsca,tcmcs042.txta
from tcmcs042
where tcmcs042._index1 = {:i.ptpa}
as set with 1 rows
selectdo
endselect
} |#Gem_INC.en
function domain tcbool eu.country(domain tccom.cadr i.ofad, |#201164.sn
domain tcncmp slcp.245)
{
select tccom130.ccty
from tccom130
where tccom130._index1 = :i.ofad
selectdo
selectempty
return(false)
endselect

select tcmcs010.meec
from tcmcs010
where tcmcs010._index1 ={:tccom130.ccty}
and tcmcs010._compnr = :slcp.245
and tcmcs010.meec = tcyesno.yes
as set with 1 rows
selectempty
return(false)
endselect

return(true)
} |#201164.en
function domain tcbool grand.tot.rnd.factor.defined( |#203578.sn
domain tcccur i.ccur)
{
select tcmcs002.gtrf
from tcmcs002
where tcmcs002._index1 = {:i.ccur}
as set with 1 rows
selectdo
if double.cmp(tcmcs002.gtrf, 0.000000, 0.0000001) = 1 then
return(true)
else
return(false)
endif
selectempty
return(false)
endselect

return(true)
}
function read.gtro.param(domain tcncmp i.sfcp,
ref domain tcyesno o.gtro)
{
select tccom000.gtro:o.gtro
from tccom000
where tccom000._index1 = { 0, :i.sfcp}
as set with 1 rows
selectdo
selectempty
endselect

} |#203578.en
function initialize.definition.qss.lot.pos() |#212390.sn
{
|**********************************************************************
|* This function defines the way the function qss.search should search
|* a variable in an array
|**********************************************************************

domain tcmcs.long domain.type
domain tcmcs.st41 pos.str.lot

cisli.dll2089.determine.type.and.length.of.domain(
domainof(pos.str.lot),
domain.length.lot,
domain.type )
qss.start(def.lot, 1, 1)
qss.way(def.lot, 1, QSS.UP)
qss.type(def.lot, 1, domain.type)
qss.length(def.lot, 1, domain.length.lot)
}
function domain tcmcs.long get.row.no( domain tcorno lot.slso,
domain tcpono lot.pono,
domain whinh.shpm lot.shpm,
domain tcdeln lot.dlyn)
{
|**********************************************************************
|* This function returns the element number of the array which contains
|* the order no and position for the sales order and position that
|* is being printed at the moment. If The sales order and position is
|* not already used, a new element number will be assigned
|**********************************************************************

domain tcmcs.long element.txid
domain tcmcs.long counter
domain tcmcs.st41 str.lot
domain tcmcs.long ret

element.txid = 0
counter = 1
str.lot = strip$(lot.slso) & str$(lot.pono) & lot.shpm & lot.dlyn
ret = tt.align.according.domain(str.lot, str.lot, "tcmcs.st41")

element.txid = qss.search(QSS.EQUAL, str.lot, lot.array, def.lot,
max.lot.element)

if element.txid <= 0 then
max.lot.element = (max.lot.element + 1)
element.txid = max.lot.element
if max.lot.element > (counter * 50) then
while( true )
if ((counter + 1)*50 > max.lot.element) then
alloc.mem(lot.array,
domain.length.lot,
((counter + 1)*50))
break |#222281.n
else
counter = (counter + 1)
endif
endwhile
endif
lot.array(1, max.lot.element) = str.lot
endif

return(element.txid)
} |#212390.en

function initialize.definition.qss.disc.pos() |#212790.sn
{
|**********************************************************************
|* This function defines the way the function qss.search should search
|* a variable in an array
|**********************************************************************

domain tcmcs.long domain.type
domain tcmcs.st45 pos.str.disc
max.disc.element = 0
no.of.lines = 0

cisli.dll2089.determine.type.and.length.of.domain(
domainof(pos.str.disc),
domain.length.disc,
domain.type )
qss.start(def.disc, 1, 1)
qss.way(def.disc, 1, QSS.UP)
qss.type(def.disc, 1, domain.type)
qss.length(def.disc, 1, domain.length.disc)
alloc.mem(disc.arr, domain.length.disc, 5)
}
function domain tcmcs.long get.row.no.for.disc(
domain cisli.ortp disc.ortp,
domain tckoor disc.koor,
domain tcorno disc.slso,
domain tcpono disc.pono,
domain whinh.shpm disc.shpm,
domain tcdeln disc.dlyn)
{
|**********************************************************************
|* This function returns the element number of the array which contains
|* the order no and position for the sales order and position that
|* is being printed at the moment. If The sales order and position is
|* not already used, a new element number will be assigned
|**********************************************************************

domain tcmcs.long element.disc
domain tcmcs.long counter
domain tcmcs.st45 str.disc

element.disc = 0
counter = 1
str.disc = str$(disc.ortp) & str$(disc.koor) & strip$(disc.slso) &
str$(disc.pono) & disc.shpm & disc.dlyn
ret = tt.align.according.domain(str.disc, str.disc, "tcmcs.st45")
element.disc = qss.search(QSS.EQUAL, str.disc, disc.arr, def.disc,
max.disc.element)

if element.disc <= 0 then
max.disc.element = (max.disc.element + 1)
element.disc = max.disc.element
if max.disc.element > (counter * 5) then
while( true )
if ((counter + 1)*5 > max.disc.element) then
alloc.mem(disc.arr,
domain.length.disc,
((counter + 1)*5))
break
else
counter = (counter + 1)
endif
endwhile
endif
disc.arr(1, max.disc.element) = str.disc
endif

return(element.disc)
} |#212790.en
|****************************** END OF REPORTSCRIPT ***************************

|tambahan function baru

function domain tcmcs.str300m Dec.to.Hex(long dec.num)
{

domain tcmcs.str300m res.hex


if dec.num = 0 then return("0") endif

res.hex = ""
while dec.num <> 0

res.hex = Dec.to.Hex.digit(dec.num\16) & res.hex | mod
dec.num = dec.num /16 | div

endwhile
return (res.hex)

}


function domain tcmcs.str1 Dec.to.Hex.digit(long dec.num)
{
string res.hex(1)

on case dec.num

case 10: res.hex = "A"
break
case 11: res.hex = "B"
break
case 12: res.hex = "C"
break
case 13: res.hex = "D"
break
case 14: res.hex = "E"
break
case 15: res.hex = "F"
break
default: res.hex = str$(dec.num)
break
endcase

return(res.hex)
}

HakanT
19th December 2008, 14:23
Try the following:
not isspace(cisli205.vtal)

Elrodyn
20th December 2008, 14:44
Hi Hakant,

thanks for the reply, i'll try your solution and give you feedback.

Elrodyn
18th March 2009, 11:13
Hello,

sorry for the long respond, the problem is already solved^^

i was wrong putting the condition for the lattr.print=false code, thank you