shambhavi
14th August 2018, 08:23
|******************************************************************************
|* cisli44350100p VRC B61O 10 dttt
|* Pragati Customs Invoice
|* kiranbab
|* 08-08-18 [15:28]
|******************************************************************************
|* Rev.No. 3 ciB61O10test 08 Aug 18 kiranbab
|* ...
|******************************************************************************

|****************************** declaration section ***************************

declaration:

table ttccom000
table ttccom130
table ttccom100
table ttdsls400
table ttcmcs013
table ttcibd006
table ttcibd943
table twhinh431
table ttdsls401
table twhinh433
table ttcibd401
table ttimfc011

extern domain tcmcs.str100 ln1, ln2, ln3, ln4, ln5, ln6, r.nama
extern domain tcncmp r.comp
extern domain tcrefb cont.name
extern domain tccom.bpid r.pre.carrier
extern domain tcmcs.str30 r.plc.rec, r.cont.org
extern domain tcccty r.cont.fd
extern domain tccom.cadr r.prt.ld, r.prt.ds
extern domain tcdsca r.dsca
extern domain tccitt r.citt
extern domain tcscod.l r.hsn
extern domain tcpono r.pos, r.itml, r.sqnc
extern domain tcitem r.item
extern domain tcdsca r.idsca
extern domain tcqiv1 r.qua
extern domain tccuni r.qun
extern domain tcamnt r.amnt, r.lamnt, r.total
extern domain tcaitm r.citm
extern domain tcmcs.str70 v.serl
extern domain tcmcs.st30m r.corn
extern domain tcscod.l r.hsn
extern domain tccdec r.cdec
extern domain tcmcs.str30 serials(1) based
extern domain tcmcs.str70 o.serials(1) based
domain tcmcs.long no.of.serial
domain tcmcs.long pr.serl.cnt, serl.print
extern domain tcmcs.str70 con.slno,con.slno.new,v.serl
extern domain tcmcs.s512 r.serial.all

before.program:
r.comp = get.compnr()

header.5:
before.layout:
get.comp.addr()
get.supp.addr()
get.contact.name()

detail.5:
before.layout:
get.order.details()
serl.print=0
get.serial.no()

detail.10:
before.layout:
if serl.print <pr.serl.cnt then
serl.print = serl.print + 1
v.serl =o.serials(1,serl.print)
endif

| v.serl =o.serials(1, serl.print)

after.layout:
if serl.print <pr.serl.cnt then
layout.again()
endif

functions:

function get.comp.addr()
{
select tccom000.*
from tccom000
where tccom000.ncmp = {:r.comp}
as set with 1 rows
selectdo
select tccom100.*
from tccom100
where tccom100.cadr = {:tccom000.cadr}
selectdo
r.nama = tccom100.nama
endselect

select tccom130.*
from tccom130
where tccom130.cadr = {:tccom100.cadr}
selectdo
ln1 = tccom130.ln01
ln2 = tccom130.ln02
ln3 = tccom130.ln03
ln4 = tccom130.ln04
ln5 = tccom130.ln05
ln6 = tccom130.ln06
endselect
endselect
}

function get.supp.addr()
{
select tccom100.*
from tccom100
where tccom100.bpid = {:cisli435.itbp}
selectdo
bp.nama = tccom100.nama
endselect

select tccom130.*
from tccom130
where tccom130.cadr = {:tccom100.cadr}
selectdo
bp1 = tccom130.ln01
bp2 = tccom130.ln02
bp3 = tccom130.ln03
bp4 = tccom130.ln04
bp5 = tccom130.ln05
bp6 = tccom130.ln06
endselect

}

function get.contact.name()
{
select tdsls400.*
from tdsls400
where tdsls400.orno = {:g.order.number}
selectdo
cont.name = tdsls400.refb
r.pre.carrier = tdsls400.prcb.l
r.plc.rec = tdsls400.plre.l
r.cont.org = tdsls400.cuha.l
r.cont.fd = tdsls400.ctyd.l
r.prt.ld = tdsls400.ptld.l
r.prt.ds = tdsls400.ptds.l
endselect

select tcmcs013.*
from tcmcs013
where tcmcs013.cpay={:tdsls400.cpay}
selectdo
r.dsca=tcmcs013.dsca
endselect
}

function get.order.details()
{
select whinh431.*
from whinh431
where whinh431.shpm={:g.shipment}
selectdo
r.pos=g.position
r.item=g.item
r.idsca=g.item.dsca
r.qua=g.quantity
r.qun=g.unit
r.itml=g.position
get.serial.no()
endselect

select tdsls401.*
from tdsls401
where tdsls401.orno={:tdsls400.orno}
selectdo
r.citt=tdsls401.citt
r.citm=tdsls401.citm
| r.sqnc=tdsls401.sqnb
r.corn=tdsls401.corn
r.hsn=tdsls401.hcod.l
r.cdec=tdsls401.cdec
r.amnt=g.amount
r.lamnt=(r.amnt*r.qua)
r.total= r.total+r.lamnt
endselect
}

function get.serial.no()
{
no.of.serial = 0
pr.serl.cnt = 0
long ii, stp
domain tcmcs.str70 two.serl
if r.qua<> 0 then
alloc.mem(serials, 30, r.qua)
select whinh433.*
from whinh433
where whinh433._index1={:whinh431.shpm, :whinh431.pono}
and whinh433.reje = tcyesno.no
and whinh433.cser <> ""
selectdo
no.of.serial = no.of.serial + 1
serials(1, no.of.serial) = strip$(whinh433.cser)
endselect
stp = 0
two.serl = ""
if no.of.serial <> 0 then
alloc.mem(o.serials, 70, no.of.serial)
endif

for ii = 1 to no.of.serial
stp = stp + 1
if ii = 1 then
two.serl = "Serial No." & " " & strip$(serials(1, ii)) & ","
else
two.serl = two.serl & strip$(serials(1, ii)) & ","
endif
if stp = 2 then
pr.serl.cnt = pr.serl.cnt + 1
stp = 0
o.serials(1, pr.serl.cnt) = strip$(two.serl)
two.serl = ""
endif

endfor
if not isspace(two.serl) and no.of.serial = 1 then
o.serials(1, no.of.serial) = strip$(two.serl)
endif

if not isspace(two.serl) and no.of.serial > 2 then
pr.serl.cnt = pr.serl.cnt + 1
o.serials(1, pr.serl.cnt) = strip$(two.serl)
endif
endif

}

mark_h
14th August 2018, 14:52
Can you give us more details? Which field are you talking about - or what is not appearing on the report. For 4c4 I always make sure declared extern and that the field included on the input fields.

shambhavi
16th August 2018, 07:46
In this GST invoice print report i have to print item serial number, i have taken whinh431.cser field in array, if it has multiple quantity it should print all item serial numbers respect to particular shipment.

mark_h
16th August 2018, 20:12
In detail.10 are you printing v.serl? Put it in debug mode and step thru it right off hand I am not seeing anything standing out in the code - I would role thru get.serial.no and make the arrays are loaded correctly.