Quantcast
Channel: Baanboard.com
Viewing all articles
Browse latest Browse all 4216

Recport Script guidance

$
0
0
Hi,

Am new to programming, with small guidance of my colleague am writing this code but am getting so many errors could any please check and tell wether this script is correct or not.

Code:

|******************************************************************************
|* tdsls340501000 VRC B50  a
|* Print sales contract confirmation
|* Raj / Willem van Diermen
|* 28-01-91
|******************************************************************************
|* Main Table : tdsls300 Sales Contract Headers
|* Form Type  : 4
|* Description: This script supports the printing of the contract acknowledge-
|*                ments.
|****************************** modification section **************************
|*        Rev.No. 3  tdB50asys6  02 Dec 97 thenzen
|* Cleanup report script.
|*        Rev.No. 2  tdB50asy10  07 Jan 98 thenzen
|* added currency expression for bapr
|*        Rev.No. 2  tdB50asy11  16 Jan 98 thenzen
|* Changed dates
|*        Rev.No. 2  tdB50asy18  18 Mar 98 nicog
|* Some layout changes / sold-to bp to 9 positions.
|*        Rev.No. 3  tdB50asy18  18 Mar 98 nicog
|* Enlarged sold-to BP field to 9 positions on layout 8.
|*        Rev.No. 3  tdB50asy19  27 Mar 98 hansp
|* Checked in by session ttadv6200m000
|*        Rev.No. 4  tdB50asy19  27 Mar 98 cvhinue
|* Checked in by session ttadv6200m000
|*        Rev.No. 8  tdB50asy19  27 Mar 98 janhof
|* Checked in by session ttadv6200m000
|*        Rev.No. 2  tdB50bsy08  10 Jul 98 mtamura
|* Right aligned price.
|*        Rev.No. 3  tdB50bsy08  16 Jul 98 steich
|* Checked in by session ttadv6200m000
|*        Rev.No. 2  tdB51asy28  04 Jun 99 lshew
|* fixed compilation error.
|*        Rev.No. 2  tdB60asy02  04 Jan 00 snagalin
|* Compilation errors due to tdprg000.brty solved
|*        Rev.No. 2  tdB52asy20  10 Oct 01 bsp
|* Revision created during conversion descriptions to labels
|*        Rev.No. 3  tdB52asy20  14 Nov 01 pwiersma
|* VSC warnings solved.
|*        Rev.No. 2  tdB52bsy04  25 Oct 02 ejbosch
|* BR1-101906: mnemonics change.
|*        Rev.No. 3  tdB52bsy04  31 Oct 02 msivasub
|* BR1-101906: inventory unit
|*        Rev.No. 4  tdB52bsy04  01 Nov 02 bvwijk
|* BR1-101906: mnemonics change: cqan removed as input field.
|*        Rev.No. 2  tdB60asy05  11 Dec 02 bvwijk
|* 106-127930. Created some more space for labels with 'hard coded sentences'.
|*        Rev.No. 3  tdB60asy05  04 Feb 03 msivasub
|* Scopus Solution 131712 ported from Corelli.
|* Several fields are missing from the Sales Contract Acknowledgment (when
|* comparing with Sales Order Acknowledgment):
|* - Terms of Payment Code and Terms of Delivery Code
|* - Alternative Item Code
|* - Revision Code
|* The above fields are added in the existing/new layouts.
|*        Rev.No. 2  tdB60asy09  27 May 03 ckrauss
|* Label fields maximized
|*        Rev.No. 2  tdB60asy14  02 Sep 03 ejbosch
|* Solution 135773 ported
|*        Rev.No. 3  tdB60asy14  04 Sep 03 avdkolk
|* TCS remark 800-134426 solved
|*        Rev.No. 2  tdB60asy20  09 Mar 04 awouters
|* Remark 800-138176 solved. Dynamic Link Faillure when deleting contract with
|* status free. Reportfieldnames "quan.unit" and "price.unit" changed into
|* "quan.unt" and "price.unt".
|*        Rev.No. 3  tdB60asy20  11 Mar 04 awouters
|* Solved remark 800-138012 :
|* - Contracttext was printed twice.
|* - Discount was not initialized but taken over from previous record.
|* - Discount Method was printed while there was no discount.
|*        Rev.No. 2  tdB60asy23  11 Nov 04 akamstee
|* A.Kamsteeg, 2004-11-11, Ported SOL 146893 (Richard Buitenhuis, 2004-09-30)
|* Need ability to print Purchase Contract or Contract Changes/Acknowledgements
|* before any contract line items are added. Boeing CR - 52. (DF 150563)
|*        Rev.No. 2  tdB60asy26  26 Apr 05 akamstee
|* A.Kamsteeg, 2005-04-26, TCS800-146626, Printing of item data didnot work
|* correctly.
|*        Rev.No. 2  tdB60asy26  27 Apr 05 akamstee
|* A.Kamsteeg, 2005-04-27, TCS800-146626, Item lines not printed.
|*        Rev.No. 2  tdB60asy28  27 Sep 05 bsp
|* TIV number of component set to 1050
|*        Rev.No. 2  tdB60asy29  15 Feb 06 mvputten
|* RGT, variable 'orco' is external declared several times, made lenght equal
|* for sales scripts.
|*        Rev.No. 2  tdB60asy32  12 Sep 06 rvdlinde
|* 800-154677 Obsolete tdsls300.ccty, tdsls300.cvyn removed.
|*        Rev.No. 2  tdB60asy38  22 Jun 07 awouters
|* Ported solution 217531.
|* TECH-00000-01922.
|* Fatal error (Dynamic link failure) could occur when automatically processing
|* sales orders and working with contracts, due to different length declaration
|* of the 'orco' report variable.
|*        Rev.No. 3  tdB60asy38  12 Sep 07 mvaessen
|* SOL 223744: correct page numbering.
|*        Rev.No. 2  tdB60asy40  29 Oct 07 mvaessen
|* BR00PUR7, Print Final Contract
|*        Rev.No. 2  tdB60asy44  13 Jun 08 bvwijk
|* 800-166320. Description of Terms of Payment and Terms of Delivery is printed
|* too.
|*        Rev.No. 3  tdB60asy44  13 Jun 08 bvwijk
|* 800-166320. Small improvement in layout.
|*        Rev.No. 2  tdB60asy48  20 Mar 09 djoling
|* AUTO-DJ: Added Customer Item field.
|*        Rev.No. 3  tdB60asy48  23 Mar 09 djoling
|* AUTO-DJ: Added Customer Item Field.
|*        Rev.No. 2  tdB60asy60  24 May 11 nvdknaap
|* PRIC-REV2nk: Modifications with regards to the topic 'Sales Contract Price
|* Revisions'. The functional area is print sessions. FD: #51019.
|*        Rev.No. 2  tdB60asy61  02 Nov 11 wnaberma
|* #800-179611 Date not fully shown on report in before.field sls.contract.orco
|* no.5
|*        Rev.No. 3  tdB60asy61  04 Nov 11 wnaberma
|* #800-179610 Revision Price unit was not displayed. Changed price.unt to
|* tdpcg100.cupr.
|*        Rev.No. 4  tdB60asy61  30 Nov 11 wnaberma
|* Added tdpcg021.dscp to input fields.
|*        Rev.No. 2  tdB60asy73  15 Apr 13 ngreven
|* Customer item (tdsls301.citm) has been added to layout detail 1. This field
|* already existed as an input field.
|*        Rev.No. 2  tdB60asy77  05 Mar 14 wnaberma
|* #wn-mpr02 Material Pricing #52559.
|*        Rev.No. 2  tdB60asy84  07 Nov 14 ngreven
|* Removal of label tdgen.mat.price length 15
|*        Rev.No. 2  tdB61O10test  11 Sep 18 bsp
|*  ,.
|*        Rev.No. 3  tdB61O10test  11 Sep 18 bsp
|*  ,.
|*        Rev.No. 4  tdB61O10test  11 Sep 18 girija
|*  ,.
|*        Rev.No. 5  tdB61O10test  11 Sep 18 girija
|* ,.
|*        Rev.No. 6  tdB61O10test  12 Sep 18 girija
|*  ,.
|******************************************************************************

|****************************** declaration section ***************************
declaration:
#ident "@(#)tdsls340501000  tdB60asy77  nlbaudv3  Rev.No. 2  05 Mar 14  wnaberma"
#ident "@(#)tdsls340501000  tdB60asy60  nlbaudv1  Rev.No. 2  24 May 11  nvdknaap"
#ident "@@(#)ID10227874, Bryan Motley, 1997-02-03, B40_c_sys"

        table        ttdsls000        |* SLS parameters                |#131712.n       
        table        ttdsls301       
        table        ttctax941

       

|        long                        array.length                        |#WN-MSRS.so
|        long                        disc.ind
        long                        i, r.cnt                                |#WN-MSRS.eo
|        long                        selected                        |#WN-MSRS2.so
        long                        dummy.long                        |#WN-MSRS2.eo

        string                        date(10)                |* current date
|        string                        dummy.string(1)                        |#WN-MSRS2.o

|        domain  tcdisc                discount                        |#WN-MSRS.o
|        domain  tcpric                disc                                |#WN-MSRS2.o
        extern domain        tccono                hold.cono
        extern domain        tcpono                hold.pono
        extern domain  tdpcg.dssc        hold.dile
|        domain        tcmcs.str12        disc.expr        fixed                |#WN-MSRS.o
|        domain        tcmcs.str30        disc.difo                        |#WN-MSRS2.so
|        domain        tcmcs.str30        pric.difo                        |#WN-MSRS2.eo
                long                dummy.ret
        extern domain        tcbool                tax.code.found
                domain        tccvat                r.tax.code.array.l(10),       
                domain        tcamnt                r.tax.amount.array.l(10)
        extern domain        tccvat                r.lnd.tax.code.array.l(10), ss.cvat,
        extern domain        tcamnt                r.lnd.tax.amount.array.l(10)
        extern domain        tccvat                ss.tax.code.array.l(10)       
        extern domain        tcamnt                ss.tax.amount.array.l(10), report.igst.rate, report.cgst.rate, report.sgst.rate,
        extern domain        tcamnt                  report.cgst.amnt, report.sgst.amnt, report.igst.amnt, report.utgst.amnt, report.gstce.amnt, report.tax.val
        extern domain tccono ss.cono
        extern domain tcpono ss.pono
        extern domain tccwoc ss.cofc
        extern domain tcccty ss.ccty
        extern domain tcdate ss.cdat
        long  tax.count,tax.print
        extern domain        tcamnt  ss.gst.asv, s.tot.sgst, s.tot.cgst, s.tot.igst, s.tot.gstcess, report.tax.val, report.total
        extern domain        tcamnt        tt.igst, tt.cgst, tt.sgst, tt.amount, tt.utgst, tt.gstcess, tt.taxable.val, tt.inv.val
        extern domain tcamnt        total.amount, total.sgst, total.igst, total.utgst, total.gstcess, total.cgst, totl.ordr.amnt, totl.ladm.amnt, line.tot

|****************************** program section *******************************
before.program:
        dummy.ret = tcmcs.dll0095.read.parm("tdsls000")                |#131712.n
        date = sprintf$("%D001," & lattr.language$,date.num())
|        array.length = tdsls.dll0022.array.length()                |#WN-MSRS.o
                                                                |#WN-MSRS2.so
|        rdi.domain("tcdisc",disc.difo,dummy.string,dummy.string,dummy.long,
|                  dummy.string,dummy.long)
                                                                |#220088.so
|        rdi.domain("tcdiam",pric.difo,dummy.string,dummy.string,dummy.long,
                                                                |#220088.eo
|                                                                |#220088.sn
|        rdi.domain("tddiam",pric.difo,dummy.string,dummy.string,dummy.long,
|                                                                |#220088.en
|                  dummy.string,dummy.long)
                                                                |#WN-MSRS2.eo

        hold.cono = ""
        totl.ordr.amnt=0
        totl.ladm.amnt=0
        set.mem(r.tax.code.array.l,"")
        set.mem(r.tax.amount.array.l,0)
        tax.count = 0
        r.cnt=0
        tax.print = 0
        rpt.labels()



|****************************** field section *********************************
|after.orco.1:                                                        |#217531.o
after.sls.contract.orco.1:                                        |#217531.n
before.layout:
|        skip.to(spool.pg.length - 6)                                |#800-166320.o
        skip.to(spool.pg.length - 8)                                |#800-166320.n
after.layout:
|        lattr.pageno = 1                                        |#223744.o
        lattr.pageno = 0                                        |#223744.n

field.tdsls300.txta:
before.print:
        validate.textline()

field.tdsls300.txtb:
before.print:
        validate.textline()

field.txtn.ptr:
before.print:
        validate.textline()


header.1:
before.layout:
calc.tax.tot()


detail.1:                                                        |#WN-MSRS.so
before.layout:               
report.tax.val = tdsls301.tasg.l       
report.total = tdsls301.camt       
report.cgst.amnt = 0       
report.sgst.amnt = 0       
report.igst.amnt = 0       
report.utgst.amnt = 0       
report.gstce.amnt = 0       
get.tex.detail.2()
line.tot = report.tax.val + report.cgst.amnt + report.sgst.amnt + report.igst.amnt + report.utgst.amnt + report.gstcs.amnt

after.layout:
        total.amount = total.amount + report.total
        total.taxable.val = total.taxable.val + report.tax.val
        total.cgst = total.cgst + report.cgst.amnt
        total.sgst = total.sgst + report.sgst.amnt
        total.igst = total.igst + report.igst.amnt
        total.utgst = total.utgst + report.utgst.amnt
        total.gstcess = total.gstcess + report.gstce.amnt       

        tt.igst =  tt.igst + report.igst.amnt
        tt.cgst =  tt.cgst + report.cgst.amnt
        tt.sgst =  tt.sgst + report.sgst.amnt
        tt.utgst = tt.utgst + report.utgst.amnt
        tt.gstcess = tt.gstcess + report.gstce.amnt
        tt.amount = tt.amount + report.total
        tt.taxable.val = tt.taxable.val + report.tax.val       

|        disc.ind = 1
|        discount = 1
|        test.discount.percentage.and.amount()
|
|detail.2:
|before.layout:
|        disc.ind = disc.ind + 1
|        test.discount.percentage.and.amount()
|        if not selected or disc.ind > array.length then
|                lattr.print = false
|        endif
|after.layout:
|        if disc.ind + 1 <= array.length then
|                layout.again()
|        endif                                                        |#WN-MSRS.eo

|detail.24:                                                        |#WN-MSRS2.so
|before.layout:
|        if tdpcg021.dscp <> 0 then
|                disc = tdpcg021.dscp
|                disc.expr = sprintf$("%@"&disc.difo&"@",disc)
|                disc.expr = shiftr$(disc.expr)
|        else
|                disc  = tdpcg021.damt
|                disc.expr = pric.difo & "," & tdsls300.ccur
|                disc.expr = sprintf$(disc.expr,disc)
|        endif                                                        |#WN-MSRS2.eo

|****************************** function section ******************************
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 test.discount.percentage.and.amount()                        |#WN-MSRS.so
|{
|        selected = false
|        disc.expr = ""
|        for i = disc.ind to array.length
|                disc.ind = i
|                if tdsls301.disc(disc.ind) <> 0 or
|                  tdsls301.ldam(disc.ind) <> 0 then
|                        selected = true
|                        break
|                endif
|        endfor
|        if selected then
|                if tdsls301.disc(disc.ind) <> 0 then
|                        discount  = tdsls301.disc(disc.ind)
|                        disc.expr = sprintf$("%@"&disc.difo&"@",discount)
|                        disc.expr = shiftr$(disc.expr)
|                else
|                        if tdsls301.ldam(disc.ind) <> 0 then
|                                discount  = tdsls301.ldam(disc.ind)
|                                disc.expr = pric.difo & "," & tdsls300.ccur
|                                disc.expr = sprintf$(disc.expr,discount)
|                        endif
|                endif
|        endif
|}                                                                |#WN-MSRS.eo

function get.tex.detail.2()

{

        table        ttctax941
        table        ttccom936

        domain        tcpvat                g.layer.tax.rate.l(1,1)        based
        domain        tcamnt                g.layer.base.amount.array.l(1, 1)based
        domain        tcamnt                g.layer.tax.amount.array.l(1, 1)based
        domain        tccvat                g.layer.tax.code.array.l(1, 1)based       
        domain        tctax.indt.l                g.line.indirect.tax.array.l(1,1) based
        domain        tcyesno                g.expensed.tax.l(1,1)based
        domain        tctax.seqn                dummy.max.sequence
        domain        tcamnt                claimable.tax.amount
        domain        tcamnt                non.claimable.tax.amount
        domain        tcamnt                total.tax.amount
        domain        tcmcs.s250m        dummy.error.msg
        domain        tcamnt                sales.tax
        domain        tcmcs.s250m        comb.output.set(1)based
        long                max.sequence.number, p
        domain        tctax.indt.l        o.duty.type.array.l(1,1) based
        domain        tcamnt                o.duties.array.l(1,1) based
        domain        tccvat        tax.code

       

        select        tdsls301.tasg.l

        from        tdsls301

        where        tdsls301._index1 = {        :tdsls301.cono, :tdsls301.pono, :tdsls301.cofc}       
        as set with 1 rows
        selectdo
        endselect       



|        tcmcs.dll0095.read.parm("tccom936")

|        select        max(_tctax941.seqn) :max.sequence.number

|        from        tctax941 _tctax941

|        where        _tctax941._index1 = {:tdsls401.ccty,  :tdsls401.cvat}

|        and        _tctax941.type = tctax.type.l.tax

|        as set with 1 rows

|        selectdo

|        selectempty

|                max.sequence.number = 1

|        endselect

|        alloc.mem(o.duty.type.array.l,tccom936.nlay,max.sequence.number)

|        alloc.mem(o.duties.array.l, tccom936.nlay,max.sequence.number)

       

        tctax.dll9241.l.calculate.tax.for.aggregate(

                                        tdsls301.ccty,                        |* I

                                        tdsls301.cvat,                        |* I

                                        tdsls301.cdat,                        |* I

                                        report.tax.val, |tdsls301.camt,                        |* I

                                        0.00,                                |* I

                                        0.00,                                |* I

                                        0.00,                                |* I

                                        0.00,                                |* I

                                        tdsls300.ccur,                        |* I

                                        tdsls301.dmrp.l,                        |* I

                                        report.tax.val,                |tdsls301.tasg.l,               

                                        tdsls301.tasg.l,                |* I

                                        tdsls301.cdat,                        |* I

                                        tcyesno.no,                        |* I

                                        tcyesno.no,                        |* I

                                        o.duty.type.array.l,                |* I

                                        o.duties.array.l,                |* I

                                        g.layer.tax.rate.l,                |* O

                                        dummy.max.sequence,                |* O

                                        g.layer.base.amount.array.l,        |* O

                                        g.layer.tax.amount.array.l,        |* O

                                        g.layer.tax.code.array.l,        |* O

                                        g.line.indirect.tax.array.l,        |* O

                                        g.expensed.tax.l,                |* O

                                        claimable.tax.amount,                |* O

                                        non.claimable.tax.amount,        |* O

                                        total.tax.amount,                |* O

                                        sales.tax,                        |* O

                                        comb.output.set,                |* O

                                        dummy.error.msg)                |* O

                                       

        init.tax.details()

       

        select        tctax941.*
        from        tctax941
        where        tctax941._index1 = {:tdsls301.ccty,:tdsls301.cvat}
        and        tctax941.type = tctax.type.l.tax
        and        tctax941.cvat <> ""
        order by tctax941._index1
        selectdo

                if tctax941.cvat = g.layer.tax.code.array.l(1,tctax941.layr, tctax941.seqn) then

                        tax.code.found = false

                        for i = 1 to tax.count               

                                if tctax941.cvat = r.tax.code.array.l(1,i) then

                                        tax.code.found = true

                                        break

                                endif       

                        endfor

                        if tax.code.found then

                                |r.tax.amount.array.l(i) = r.tax.amount.array.l(i) + g.layer.tax.amount.array.l(tctax941.layr, tctax941.seqn)

                        else

                                |tax.count = tax.count + 1

                               

                                tax.code = g.layer.tax.code.array.l(1,tctax941.layr, tctax941.seqn)

                               

                                select        tcmcs036.ccty, tcmcs036.cvat, tcmcs036.indt.l

                                from        tcmcs036

                                where        tcmcs036._index1 = {"IND", :tax.code}

                                as set with 1 rows

                                selectdo

                                selectempty

                                        tcmcs036.indt.l = empty

                                endselect

                               

                                if tcmcs036.indt.l =  tctax.indt.l.sgst then

                                        report.sgst.amnt = g.layer.tax.amount.array.l(tctax941.layr, tctax941.seqn)

                                        report.sgst.rate = g.layer.tax.rate.l(tctax941.layr, tctax941.seqn)

                                endif

                               

                                if tcmcs036.indt.l =  tctax.indt.l.utgst then

                                        report.sgst.amnt = g.layer.tax.amount.array.l(tctax941.layr, tctax941.seqn)

                                        report.sgst.rate = g.layer.tax.rate.l(tctax941.layr, tctax941.seqn)

                                endif

                               

                                if tcmcs036.indt.l =  tctax.indt.l.cgst then

                                        report.cgst.amnt = g.layer.tax.amount.array.l(tctax941.layr, tctax941.seqn)

                                        report.cgst.rate = g.layer.tax.rate.l(tctax941.layr, tctax941.seqn)

                                endif       



                                if tcmcs036.indt.l =  tctax.indt.l.igst then

                                        report.igst.amnt = g.layer.tax.amount.array.l(tctax941.layr, tctax941.seqn)

                                        report.igst.rate = g.layer.tax.rate.l(tctax941.layr, tctax941.seqn)

                                endif

                               

                                if tcmcs036.indt.l =  tctax.indt.l.gstcess then

                                        report.gstce.amnt  = g.layer.tax.amount.array.l(tctax941.layr, tctax941.seqn)

                                endif       
                               
                        endif

                       

                endif       

        endselect

}

function calc.tax.tot()

 {

        ss.cono = ""

        ss.pono = 0

        ss.gst.asv = 0

        |ss.sqnb = 0

        ss.ccty = ""

        ss.cvat = ""

        ss.cdat = 0

        ss.gst.asv = 0

       

        init.tot.tax.details()

 

        select        sls301.cono:ss.cono, sls301.pono:ss.pono, sls301.cofc:ss.cofc,

                sls301.ccty:ss.ccty, sls301.cvat:ss.cvat, sls301.cdat:ss.cdat, sls301.tasg.l:ss.gst.asv

        from        tdsls301

        where        tdsls301.cono = {:tdsls300.cono}

        selectdo

                get.tax.tot()

        endselect

 }

function get.tax.tot()
 {
        table        ttctax941
          table        ttccom936
         
          domain        tcpvat                g.layer.tax.rate.l(1,1)        based
          domain        tcamnt                g.layer.base.amount.array.l(1, 1)based
          domain        tcamnt                g.layer.tax.amount.array.l(1, 1)based
          domain        tccvat                g.layer.tax.code.array.l(1, 1)based       
          domain        tctax.indt.l        g.line.indirect.tax.array.l(1,1) based
          domain        tcyesno                g.expensed.tax.l(1,1)based
          domain        tctax.seqn        dummy.max.sequence
          domain        tcamnt                claimable.tax.amount
          domain        tcamnt                non.claimable.tax.amount
          domain        tcamnt                total.tax.amount
          domain        tcmcs.s250m        dummy.error.msg
          domain        tcamnt                sales.tax
          domain        tcmcs.s250m        comb.output.set(1)based
                  long                max.sequence.number
          domain        tctax.indt.l        o.duty.type.array.l(1,1) based
          domain        tcamnt                o.duties.array.l(1,1) based
        domain        tccvat        tax.code

       
         
 
        tctax.dll9241.l.calculate.tax.for.aggregate(

                                        tdsls301.ccty,                        |* I

                                        tdsls301.cvat,                        |* I

                                        tdsls301.cdat,                        |* I

                                        report.tax.val, |tdsls301.camt,                        |* I

                                        0.00,                                |* I

                                        0.00,                                |* I

                                        0.00,                                |* I

                                        0.00,                                |* I

                                        tdsls300.ccur,                        |* I

                                        tdsls301.dmrp.l,                        |* I

                                        report.tax.val,                |tdsls301.tasg.l,               

                                        tdsls301.tasg.l,                |* I

                                        tdsls301.cdat,                        |* I

                                        tcyesno.no,                        |* I

                                        tcyesno.no,                        |* I

                                        o.duty.type.array.l,                |* I

                                        o.duties.array.l,                |* I

                                        g.layer.tax.rate.l,                |* O

                                        dummy.max.sequence,                |* O

                                        g.layer.base.amount.array.l,        |* O

                                        g.layer.tax.amount.array.l,        |* O

                                        g.layer.tax.code.array.l,        |* O

                                        g.line.indirect.tax.array.l,        |* O

                                        g.expensed.tax.l,                |* O

                                        claimable.tax.amount,                |* O

                                        non.claimable.tax.amount,        |* O

                                        total.tax.amount,                |* O

                                        sales.tax,                        |* O

                                        comb.output.set,                |* O

                                        dummy.error.msg)                |* O

       
        select        tctax941.*
          from        tctax941
          where        tctax941._index1 = {:ss.ccty,:ss.cvat}
          and        tctax941.type = tctax.type.l.tax
          and        tctax941.cvat <> ""
          order by tctax941._index1
          selectdo
                  if tctax941.cvat = g.layer.tax.code.array.l(1,tctax941.layr, tctax941.seqn) then
                        tax.code.found = false
                         
                          for i = 1 to tax.count               
                                  if tctax941.cvat = ss.tax.code.array.l(1,i) then
                                          tax.code.found = true
                                          break
                                  endif       
                          endfor
                          if tax.code.found then
                          else
                                 
                                tax.code = g.layer.tax.code.array.l(1,tctax941.layr, tctax941.seqn)
                               
                                select        tcmcs036.ccty, tcmcs036.cvat, tcmcs036.indt.l
                                from        tcmcs036
                                where        tcmcs036._index1 = {"IND", :tax.code}
                                as set with 1 rows
                                selectdo
                                selectempty
                                        tcmcs036.indt.l = empty
                                endselect
                               
                                if tcmcs036.indt.l =  tctax.indt.l.sgst then
                                        s.tot.sgst = s.tot.sgst + g.layer.tax.amount.array.l(tctax941.layr, tctax941.seqn)
                                endif
                               
                                if tcmcs036.indt.l =  tctax.indt.l.utgst then
                                        s.tot.sgst = s.tot.sgst + g.layer.tax.amount.array.l(tctax941.layr, tctax941.seqn)
                                endif
                               
                                if tcmcs036.indt.l =  tctax.indt.l.cgst then
                                        s.tot.cgst = s.tot.cgst + g.layer.tax.amount.array.l(tctax941.layr, tctax941.seqn)
                                endif       
 
                                if tcmcs036.indt.l =  tctax.indt.l.igst then
                                        s.tot.igst = s.tot.igst + g.layer.tax.amount.array.l(tctax941.layr, tctax941.seqn)
                                endif
                               
                                if tcmcs036.indt.l =  tctax.indt.l.gstcess then
                                        s.tot.gstcess  = s.tot.gstcess + g.layer.tax.amount.array.l(tctax941.layr, tctax941.seqn)
                                endif                                                       
 
                        endif
                  endif
          endselect       
 }
 
 function init.tot.tax.details()
 {
        s.tot.cgst = 0.00
        s.tot.sgst = 0.00
        s.tot.igst = 0.00
        s.tot.gstcess = 0.00
 }
 
 function init.tax.details()
{
        report.cgst.rate = 0.00
        report.sgst.rate = 0.00
        report.igst.rate = 0.00
|        report.gstce.rate = 0.00
        report.cgst.amnt = 0.00
        report.sgst.amnt = 0.00
        report.igst.amnt = 0.00
        report.gstce.amnt = 0.00
}


Viewing all articles
Browse latest Browse all 4216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>