E-Invoice Json File Creation in Tally ERP 9

Discussion in 'Free Source Codes' started by Devendra_Rawat, Jan 9, 2021.

    
  1. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    This group of TDL files, which are uploaded here, can be used for generating e-Invoice json file (version 1.03)
    Note : This code has not been tested on Tally Prime yet.

    What it does :

    It just creates e-Invoice Json file as mentioned above. Json file thus generated above has been tested with e-Invoice portal and proper response was generated and IRN was received.

    What it doesn't do:
    a. code doesn't show methods to load it e-Invoice Portal (as it depends on a number factors like, ASP you are using)
    b. It Doesn't let you know the error in json file in advance.
    c. a lot of other things which you will know when you try to upload the json file.

    How it Works:
    On voucher screen it adds two buttons :
    [Button : EinvWrite]
    Title : "E-Write Invoice"

    ;; This method will directly write json file as per EInv Specification 1.03 which can used for uploading

    [Button : EinvExport]
    Title : "E-Exp Invoice"
    ;; This method will create Tally report (EInv Specification 1.03 ), which can be used for sending it to E-Invoice portal using HTTP Post.


    Requisites:

    Proper Information in voucher... means all required information for creating Json file as per specification:

    How to know whether voucher fulfills this condition ??
    if e-Way bill is generated successfully using Tally Default , then you can assume that Invoice is perfect for exporting in Json file

    -Coder : Ria Sharma



    Code Starts here..

    File Name : eInv_Menu.tdl
    __________________________________________________________________


    Code:
    ;;File Name : eInv_Menu.tdl
    
    
    [#Form : Sales Color]
    
        Add    : Option : Export JSON on Save : @@EInvoicingEnabled ;AND $$IsSales:##svVoucherType
    
    [!Form : Export JSON on Save]
    
        Add    : Button    : EinvRefrersh,  EinvWrite, EinvExport
        On    : Form Accept     : Yes    : Call    : Taxo_Einv_Write ; TxoWriteToJson
        On    : Form Accept    : Yes    : Alter Object
        On    : Form Accept    : Yes    : Form Accept
    
    [Button    : EinvRefrersh]
    
        Key        : Alt + R
        Action    : REfresh TDL
        Title    : "Refresh"
    
    
    ;; This method will directly write json file as per EInv Specification 1.03
    [Button    : EinvWrite]
    
        Key    : Ctrl + E
        Action    : Call: Txo_EInv_WriteToList
        Title    : "E-Write Invoice"
    
    ;; This method will create Tally report (EInv Specification 1.03 ), which can be used for sending it to E-Invoice portal using HTTP Post.
    
    [Button    : EinvExport]
    
        Key    : Ctrl + X
        Action    : Call: Taxo_Einv_Export
        Title    : "E-Exp Invoice"
    
    
    [Function    : Taxo_Einv_Export]
    
        001: Set: SVExportFormat : $$SysName:UTF8JSON    ;ANSIJSON ;UTF16JSON
        002: Set: SVExportLanguage : $$SysName:UTF8JSON ;ANSIJSON UTF16JSON
        003    : Call: Txo_EInv_WriteToList
        004: Set: SVPrintFileName : @@eInv_ExportName1.03
        005: Export:eInv_Json1.03 : Yes:Yes
    
    [Function    : Taxo_Einv_Write]
        010        :    Call    : Txo_EInv_WriteToList
        020        :     Call    : TxoWriteToJson
    
    
    
    [System : Formula]
    
    
        eInv_WriteName1.03  :  "D:\TDL\EInvWrite.json"
        eInv_ExportName1.03  :"D:\TDL\EInvExpot.json"
    
    
    [Include    : eInv_Json.tdl]
    [Include    : eInv_JsonObject.tdl]
    [Include    : eInv_ListStructure.tdl]
    [Include    : eInv_Settings.tdl]
    [Include    : eInv_JsonWrite.tdl]
    
    
    File : eInv_Json.tdl
    __________________________________________________________________


    Code:
    ;;File : eInv_Json.tdl
    
    [Report: eInv_Json1.03]        ; This report will come in Remote Request in POST method of HTTP Jsone
        Form    : eInv_Json1.03
        Plain JSON    : No
        Export Empty Fields    : Yes
    
    [Form:  eInv_Json1.03]
        Part    : eInv_Json1.03
        Delete  : XML Tag
        Full Object    : Yes
        Belongs To    : Yes
    
    
    
    [Part: eInv_Json1.03]
        Line        : eInv_Version
        Repeat        : eInv_Version : TxoLvEinvoiceSrc
        Scroll        : Vertical
    
        [Line        : eInv_Version]
            Field    : eInv_Version
            Explode        : eInv_Body
    
        [Part        : eInv_Body]
        ;    Part    :  eInv_Version
            Part    :  eInv_TranDtls
            Part    :  eInv_DocDtls
            Part    :  eInv_SellerDtls
            Part    :  eInv_BuyerDtls
            Part    :  eInv_DispDtls
            Part    :  eInv_ShipDtls
            Part    :  eInv_ItemList
            Part    :  eInv_ValDtls
            Part    :  eInv_PayDtls
            Part    :  eInv_RefDtls
            Part    :  eInv_AddlDocDtls
            Part    :  eInv_ExpDtls
            Part    :  eInv_EwbDtls
       
    
       
        [Part    : eInv_Version]
            Line    : eInv_Version
        ;    Repeat    : eInv_Version : TxoLvEinvoiceObj; TxoLvEinvoice
        ;    Scroll  : Vertical
        ;    Set     : 1
    
    ;    [Line: eInv_Version]
    ;       Field   :  eInv_Version
    
           ;Map    : Version         :$Version         : TxoLvEinvoiceSrc     ; Main Collection
       
            [Field    :eInv_Version]
                Use    : Name Field
                Set as: "1.1";$Version
                JSONTag    :"Version"
    
            [Part: eInv_TranDtls]
    
                Line    : eInv_TranDtls
             ;  Repeat  : eInv_TranDtls    ; : TranDtls
                Scroll  : Vertical
                Set        : 1
    
                [Line    : eInv_TranDtls]
                    Fields    : eInv_TrnDet_TaxSch, eInv_TrnDet_SupTyp, eInv_TrnDet_RegRev, eInv_TrnDet_EcmGstin , eInv_TrnDet_IgstOnIntra
                    JSONTag    : "TranDtls"
               
               
                [Field    :eInv_TrnDet_TaxSch]
                    Use        :     Name Field
                    Set As    :     $TranDtls[1].TaxSch
                    JSONTag    :    "TaxSch"
       
                [Field: eInv_TrnDet_SupTyp]
                    Use        :     Name Field
                    Set As    :    $TranDtls[1].SupTyp
                    JsonTag    :    "SupTyp"
           
                [Field: eInv_TrnDet_RegRev]
                    Use        : Name Field
                    Set as    :    $TranDtls[1].RegRev
                    JSONTag    :    "RegRev"
               
                [Field: eInv_TrnDet_EcmGstin]
                    Type    : NumSet
                    Set by Condition    : NOT $TranDtls[1].EcmGstin = "Null" :   $TranDtls[1].EcmGstin
                    JSONTag    : "EcmGstin"
               
               
                [Field: eInv_TrnDet_IgstOnIntra]
    
                    Use        :    Name Field
                    Set As    :    $TranDtls[1].IgstOnIntra
                    JSONTag    :    "IgstOnIntra"
    
    [Part    : eInv_DocDtls]
        Line    : eInv_DocDtls
    ;    Repeat    : eInv_DocDtls    : DocDtls
        Scroll    : Vertical
        Set        : 1
    
        [Line    :    eInv_DocDtls]
            Fields    : eInv_DocDet_Typ, eInv_DocDet_No, eInv_DocDet_Dt
             JSONTag    : DocDtls
       
                [Field    : eInv_DocDet_Typ]
                    Use    : Name Field
                    Set    As: $DocDtls[1].Typ
                    JSONTag    : "Typ"
               
                [Field    : eInv_DocDet_No]
                    Use        : Name field
                    Set as    : $DocDtls[1].No
                    JSONTag    : "No"
               
                [Field    : eInv_DocDet_Dt]
                    Use    : Name Field
                    Set as    : If $$IsEmpty:$DocDtls[1].Dt then "" Else ($$DDMMYYYYDateFormat:$DocDtls[1].Dt:"/")
                    JSONTag    : "Dt"
                ;    TempDt    :
                ;---- Pending From here"
               
    
    [Part    : eInv_SellerDtls]
        Line    :eInv_SellerDtls
        ;Repeat    :eInv_SellerDtls:SellerDtls
        Scroll    : Vertical
    
    
        [Line    :eInv_SellerDtls]               
            Fields :    eInv_SelDet_Gstin,  eInv_SelDet_LglNm,  eInv_SelDet_TrdNm, eInv_SelDet_Addr1, eInv_SelDet_Addr2, eInv_SelDet_Loc, eInv_SelDet_Pin, eInv_SelDet_Stcd, eInv_SelDet_Ph, eInv_SelDet_Em   
            JSONTag    : "SellerDtls"
       
        [Field :eInv_SelDet_Gstin]
            Use : Name Field   
            Set As :    $SellerDtls[1].Gstin
            jSonTag :    "Gstin"
       
        [Field :eInv_SelDet_LglNm]
            Use : Name Field   
            Set As :    $SellerDtls[1].LglNm
            jSonTag :    "LglNm"
       
        [Field :eInv_SelDet_TrdNm]
            Use : Name Field   
            Set As :    $SellerDtls[1].TrdNm
            jSonTag :    "TrdNm"
       
        [Field :eInv_SelDet_Addr1]
            Use : Name Field   
            Set As :    $SellerDtls[1].Addr1
            jSonTag :    "Addr1"
       
        [Field :eInv_SelDet_Addr2]
            Use : Name Field   
            Set As :    $SellerDtls[1].Addr2
            jSonTag :    "Addr2"
       
        [Field :eInv_SelDet_Loc]
            Use : Name Field   
            Set As :    $SellerDtls[1].Loc
            jSonTag :    "Loc"
       
        [Field :eInv_SelDet_Pin]
            Use : Number Field   
            Set As :    $SellerDtls[1].Pin
            jSonTag :    "Pin"
       
        [Field :eInv_SelDet_Stcd]
            Use : Name Field   
            Set As :    $SellerDtls[1].Stcd
            jSonTag :    "Stcd"
       
        [Field :eInv_SelDet_Ph]   
            Use : Name Field   
            Set As :    $SellerDtls[1].Ph
            jSonTag :    "Ph"
       
        [Field :eInv_SelDet_Em]   
            Use : Name Field
            Set As :    $SellerDtls[1].Em
            jSonTag :    "Em"
                            
                           
    [Part    : eInv_BuyerDtls]
        Line    : eInv_BuyerDtls
    ;    Repeat    : eInv_BuyerDtls : BuyerDtls
        Scroll    : Vertical
    
        [Line    : eInv_BuyerDtls]               
            Fields :    eInv_BuyDet_Gstin, eInv_BuyDet_LglNm, eInv_BuyDet_TrdNm, eInv_BuyDet_Pos, eInv_BuyDet_Addr1, eInv_BuyDet_Addr2, eInv_BuyDet_Loc, eInv_BuyDet_Pin, eInv_BuyDet_Stcd, eInv_BuyDet_Ph, eInv_BuyDet_Em   
             JSONTag:    "BuyerDtls"
        
        [Field :eInv_BuyDet_Gstin]
            Use     : Name Field   
            Set As :    $BuyerDtls[1].Gstin
            jSonTag :    "Gstin"
       
        [Field :eInv_BuyDet_LglNm]
            Use : Name Field   
            Set As :    $BuyerDtls[1].LglNm
            jSonTag :    "LglNm"
       
        [Field :eInv_BuyDet_TrdNm]
            Use : Name Field   
            Set As :    $BuyerDtls[1].TrdNm
            jSonTag :    "TrdNm"
       
        [Field :eInv_BuyDet_Pos]
            Use : Name Field   
            Set As :    $BuyerDtls[1].Pos
            jSonTag :    "Pos"
       
        [Field :eInv_BuyDet_Addr1]
            Use : Name Field   
            Set As :    $BuyerDtls[1].Addr1
            jSonTag :    "Addr1"
       
        [Field :eInv_BuyDet_Addr2]
            Use : Name Field   
            Set As :    $BuyerDtls[1].Addr2
            jSonTag :    "Addr2"
       
        [Field :eInv_BuyDet_Loc]
            Use : Name Field   
            Set As :    $BuyerDtls[1].Loc
            jSonTag :    "Loc"
       
        [Field :eInv_BuyDet_Pin]
            Use : Number Field   
            Set As :    $BuyerDtls[1].Pin
            jSonTag :    "Pin"
       
        [Field :eInv_BuyDet_Stcd]
            Use : Name Field   
            Set As :    $BuyerDtls[1].Stcd
            jSonTag :    "Stcd"
       
        [Field :eInv_BuyDet_Ph]   
            Use : Name Field   
            Set As :    $BuyerDtls[1].Ph
            jSonTag :    "Ph"
       
        [Field :eInv_BuyDet_Em]   
            Use : Name Field   
            Set As :    $BuyerDtls[1].Em
            jSonTag :    "Em"
                           
                              
    [Part    : eInv_DispDtls]
            Line    :eInv_DispDtls
        ;    Repeat    :eInv_DispDtls : DispDtls
            Scroll    : Vertical
       
        [Line    :    eInv_DispDtls]
            Fields :eInv_DisDet_Nm, eInv_DisDet_Addr1, eInv_DisDet_Addr2, eInv_DisDet_Loc, eInv_DisDet_Pin, eInv_DisDet_Stcd   
            JSONTag    : "DispDtls"
       
        [Field :eInv_DisDet_Nm]   
            Use : Name Field   
            Set As :    $DispDtls[1].Nm
            jSonTag :    "Nm"
       
        [Field :eInv_DisDet_Addr1]
            Use : Name Field   
            Set As :    $DispDtls[1].Addr1
            jSonTag :    "Addr1"
       
        [Field :eInv_DisDet_Addr2]
            Use : Name Field   
            Set As :    $DispDtls[1].Addr2
            jSonTag :    "Addr2"
       
        [Field :eInv_DisDet_Loc]
            Use : Name Field   
            Set As :    $DispDtls[1].Loc
            jSonTag :    "Loc"
       
        [Field :eInv_DisDet_Pin]
            Use : Number Field   
            Set As :    $DispDtls[1].Pin
            jSonTag :    "Pin"
       
        [Field :eInv_DisDet_Stcd]
            Use : Name Field   
            Set As :    $DispDtls[1].Stcd
            jSonTag :    "Stcd"
                           
                             
    [Part    : eInv_ShipDtls]                   
            Line    :eInv_ShipDtls
        ;    Repeat    :eInv_ShipDtls : ShipDtls
            Scroll    : Vertical
            Set        : 1
       
            [Line    :eInv_ShipDtls]               
                Fields : eInv_ShpDet_Gstin, eInv_ShpDet_LglNm, eInv_ShpDet_TrdNm, eInv_ShpDet_Addr1, eInv_ShpDet_Addr2, eInv_ShpDet_Loc, eInv_ShpDet_Pin, eInv_ShpDet_Stcd   
                JsonTag    :"ShipDtls"
               
        [Field :eInv_ShpDet_Gstin]
            Use : Name Field   
            Set As :    $ShipDtls[1].Gstin
            jSonTag :    "Gstin"
       
        [Field :eInv_ShpDet_LglNm]
            Use : Name Field   
            Set As :    $ShipDtls[1].LglNm
            jSonTag :    "LglNm"
       
        [Field :eInv_ShpDet_TrdNm]
            Use : Name Field   
            Set As :    $ShipDtls[1].TrdNm
            jSonTag :    "TrdNm"
       
        [Field :eInv_ShpDet_Addr1]
            Use : Name Field   
            Set As :    $ShipDtls[1].Addr1
            jSonTag :    "Addr1"
       
        [Field :eInv_ShpDet_Addr2]
            Use : Name Field   
            Set As :    $ShipDtls[1].Addr2
            jSonTag :    "Addr2"
       
        [Field :eInv_ShpDet_Loc]
            Use : Name Field   
            Set As :    $ShipDtls[1].Loc
            jSonTag :    "Loc"
       
        [Field :eInv_ShpDet_Pin]
            Use : Number Field   
            Set As :    $ShipDtls[1].Pin
            jSonTag :    "Pin"
       
        [Field :eInv_ShpDet_Stcd]
            Use : Name Field   
            Set As :    $ShipDtls[1].Stcd
            jSonTag :    "Stcd"
                           
                           
    [Part    : eInv_ItemList]
        Line    :eInv_ItemList
        Repeat    :eInv_ItemList : ItemList
        Scroll    : Vertical
        Set        : 1
    
        [Line    :eInv_ItemList]           
            Fields :  eInv_ItmDet_SlNo, eInv_ItmDet_PrdDesc, eInv_ItmDet_IsServc, eInv_ItmDet_HsnCd, eInv_ItmDet_Barcde
            Fields :  eInv_ItmDet_Qty, eInv_ItmDet_FreeQty, eInv_ItmDet_Unit, eInv_ItmDet_UnitPrice, eInv_ItmDet_TotAmt
            Fields :  eInv_ItmDet_Discount, eInv_ItmDet_PreTaxVal, eInv_ItmDet_AssAmt, eInv_ItmDet_GstRt, eInv_ItmDet_IgstAmt
            Fields :  eInv_ItmDet_CgstAmt, eInv_ItmDet_SgstAmt, eInv_ItmDet_CesRt, eInv_ItmDet_CesAmt
            Fields :  eInv_ItmDet_CesNonAdvlAmt, eInv_ItmDet_StateCesRt, eInv_ItmDet_StateCesAmt, eInv_ItmDet_StateCesNonAdvlAmt
            Fields :  eInv_ItmDet_OthChrg, eInv_ItmDet_TotItemVal, eInv_ItmDet_OrdLineRef, eInv_ItmDet_OrgCntry,
            Fields :  eInv_ItmDet_PrdSlNo   
       
       
            JsonTag    :"ItemList"
            Explode    : eInv_ItmDet_BchDtls
            Explode    : eInv_ItmDet_AttribDtls
           
         [Field :eInv_ItmDet_SlNo]   
            Use : Name Field   
            Set As :    $SlNo
            jSonTag :    "SlNo"
       
        [Field :eInv_ItmDet_PrdDesc]
            Use : Name Field   
            Set As :    $PrdDesc
            jSonTag :    "PrdDesc"
       
        [Field :eInv_ItmDet_IsServc]
            Use : Name Field   
            Set As :    $IsServc
            jSonTag :    "IsServc"
       
        [Field :eInv_ItmDet_HsnCd]   
            Use : Name Field   
            Set As :    $HsnCd
            jSonTag :    "HsnCd"
       
        [Field :eInv_ItmDet_Barcde]   
            Use : Name Field   
            Set As :    $Barcde
            jSonTag :    "Barcde"
       
        [Field :eInv_ItmDet_Qty]   
            Use : Number Field   
            Set As :    $Qty
            jSonTag :    "Qty"
       
        [Field :eInv_ItmDet_FreeQty]
            Use : Number Field   
            Set As :    $FreeQty
            jSonTag :    "FreeQty"
       
        [Field :eInv_ItmDet_Unit]   
            Use: Name Field   
            Set As :    $Unit
            jSonTag :    "Unit"
       
        [Field :eInv_ItmDet_UnitPrice]
            Use: Number Field           
            Set As :    $UnitPrice
            jSonTag :    "UnitPrice"
       
        [Field :eInv_ItmDet_TotAmt]   
            Use: Number Field           
            Set As :    $TotAmt
            jSonTag :    "TotAmt"
       
        [Field :eInv_ItmDet_Discount]
            Use: Number Field           
            Set As :    $Discount
            jSonTag :    "Discount"
       
        [Field :eInv_ItmDet_PreTaxVal]
            Use: Number Field           
            Set As :    $PreTaxVal
            jSonTag :    "PreTaxVal"
       
        [Field :eInv_ItmDet_AssAmt]   
            Use: Number Field           
            Set As :    $AssAmt
            jSonTag :    "AssAmt"
       
        [Field :eInv_ItmDet_GstRt]   
            Use: Number Field           
            Set As :    $GstRt
            jSonTag :    "GstRt"
       
        [Field :eInv_ItmDet_IgstAmt]
            Use: Number Field           
            Set As :    $IgstAmt
            jSonTag :    "IgstAmt"
       
        [Field :eInv_ItmDet_CgstAmt]
            Use: Number Field           
            Set As :    $CgstAmt
            jSonTag :    "CgstAmt"
       
        [Field :eInv_ItmDet_SgstAmt]
            Use: Number Field           
            Set As :    $SgstAmt
            jSonTag :    "SgstAmt"
       
        [Field :eInv_ItmDet_CesRt]   
            Use: Number Field           
            Set As :    $CesRt
            jSonTag :    "CesRt"
       
        [Field :eInv_ItmDet_CesAmt]   
            Use: Number Field           
            Set As :    $CesAmt
            jSonTag :    "CesAmt"
       
            [Field :eInv_ItmDet_CesNonAdvlAmt]
                Use : Number Field
                Set As :    $CesNonAdvlAmt
                jSonTag :    "CesNonAdvlAmt"           
       
            [Field :eInv_ItmDet_StateCesRt]
                Use : Number Field
                Set As :    $StateCesRt
                jSonTag :    "StateCesRt"           
       
            [Field :eInv_ItmDet_StateCesAmt]
                Use : Number Field
                Set As :    $StateCesAmt
                jSonTag :    "StateCesAmt"           
       
            [Field :eInv_ItmDet_StateCesNonAdvlAmt]
                Use : Number Field
                Set As :    $StateCesNonAdvlAmt
                jSonTag :    "StateCesNonAdvlAmt"           
       
            [Field :eInv_ItmDet_OthChrg]
                Use : Number Field
                Set As :    $OthChrg
                jSonTag :    "OthChrg"           
       
            [Field :eInv_ItmDet_TotItemVal]
                Use : Number Field
                Set As :    $TotItemVal
                jSonTag :    "TotItemVal"           
       
            [Field :eInv_ItmDet_OrdLineRef]
                Use : Name Field
                Set As :    $OrdLineRef
                jSonTag :    "OrdLineRef"           
       
            [Field :eInv_ItmDet_OrgCntry]
                Use : Name Field
                Set As :    $OrgCntry
                jSonTag :    "OrgCntry"           
       
            [Field :eInv_ItmDet_PrdSlNo]
                Use : Name Field
                Set As :    $PrdSlNo
                jSonTag :    "PrdSlNo"           
    
                                       
    
        [Part    : eInv_ItmDet_BchDtls]
            Line    : eInv_ItmDet_BchDtls
        ;    repeat    : eInv_ItmDet_BchDtls : BchDtls
       
            Scroll    : Vertical
       
            [Line    :eInv_ItmDet_BchDtls]
                Fields : eInv_ItmDet_BtcDet_Nm, eInv_ItmDet_BtcDet_ExpDt, eInv_ItmDet_BtcDet_WrDt                   
                JsonTag    : "BchDtls"                   
       
            [Field :eInv_ItmDet_BtcDet_Nm]
                Use : Name Field
                Set As :    $BchDtls[1].Nm
                jSonTag :    "Nm"           
       
            [Field :eInv_ItmDet_BtcDet_ExpDt]
                Use : Name Field
                Set As :    If $$IsEmpty:$BchDtls[1].ExpDt Then "" Else  ($$DDMMYYYYDateFormat:$BchDtls[1].ExpDt:"/")
                jSonTag :    "ExpDt"           
       
            [Field :eInv_ItmDet_BtcDet_WrDt]
                Use : Name Field
                Set As :    If $$IsEmpty:$BchDtls[1].WrDt then "" Else ($$DDMMYYYYDateFormat:$BchDtls[1].WrDt:"/")
                jSonTag :    "WrDt"           
                                           
        [Part    : eInv_ItmDet_AttribDtls]
            Line    : eInv_ItmDet_AttribDtls
            Repeat    : eInv_ItmDet_AttribDtls : AttribDtls
            Scroll    : Vertical
            Set        : 1
       
            [Line    : eInv_ItmDet_AttribDtls]
                Fields :    eInv_ItmDet_AttDet_Nm, eInv_ItmDet_AttDet_Val                   
                JsonTag    : "AttribDtls"
       
            [Field :eInv_ItmDet_AttDet_Nm]
                Use : Name Field
                Set As :    $Nm
                jSonTag :    "Nm"           
       
            [Field :eInv_ItmDet_AttDet_Val]
                Use : Name Field
                Set As :    $Val
                jSonTag :    "Val"
           
                                               
                                           
    [Part    : eInv_ValDtls]
        Line    :eInv_ValDtls
    ;    Repeat    :eInv_ValDtls :ValDtls
        Scroll    : Vertical
    
        [Line    :eInv_ValDtls]                               
            Fields : eInv_ValDet_AssVal, eInv_ValDet_CgstVal, eInv_ValDet_SgstVal, eInv_ValDet_IgstVal, eInv_ValDet_CesVal, eInv_ValDet_StCesVal, eInv_ValDet_Discount, eInv_ValDet_OthChrg, eInv_ValDet_RndOffAmt, eInv_ValDet_TotInvVal, eInv_ValDet_TotInvValFc                   
            JsonTag    :"ValDtls"
       
            [Field :eInv_ValDet_AssVal]
                Use: Number Field   
                Set As :    $ValDtls[1].AssVal
                jSonTag :    "AssVal"           
       
            [Field :eInv_ValDet_CgstVal]
                Use: Number Field   
                Set As :    $ValDtls[1].CgstVal
                jSonTag :    "CgstVal"           
       
            [Field :eInv_ValDet_SgstVal]
                Use: Number Field   
                Set As :    $ValDtls[1].SgstVal
                jSonTag :    "SgstVal"           
       
            [Field :eInv_ValDet_IgstVal]
                Use: Number Field   
                Set As :    $ValDtls[1].IgstVal
                jSonTag :    "IgstVal"           
       
            [Field :eInv_ValDet_CesVal]
                Use: Number Field   
                Set As :    $ValDtls[1].CesVal
                jSonTag :    "CesVal"           
       
            [Field :eInv_ValDet_StCesVal]
                Use: Number Field   
                Set As :    $ValDtls[1].StCesVal
                jSonTag :    "StCesVal"           
       
            [Field :eInv_ValDet_Discount]
                Use: Number Field   
                Set As :    $ValDtls[1].Discount
                jSonTag :    "Discount"           
       
            [Field :eInv_ValDet_OthChrg]
                Use: Number Field   
                Set As :    $ValDtls[1].OthChrg
                jSonTag :    "OthChrg"           
       
            [Field :eInv_ValDet_RndOffAmt]
                Use: Number Field   
                Set As :    $ValDtls[1].RndOffAmt
                jSonTag :    "RndOffAmt"           
       
            [Field :eInv_ValDet_TotInvVal]
                Use: Number Field   
                Set As :    $ValDtls[1].TotInvVal
                jSonTag :    "TotInvVal"           
       
            [Field :eInv_ValDet_TotInvValFc]
                Use: Number Field   
                Set As :    $ValDtls[1].TotInvValFc
                jSonTag :    "TotInvValFc"           
                                           
                                            
    [Part : eInv_PayDtls]
        Line    :eInv_PayDtls
    ;    Repeat    :eInv_PayDtls : PayDtls
        Scroll    :Vertical
    
        [Line    :eInv_PayDtls]                               
            Fields : eInv_PayDet_Nm, eInv_PayDet_AccDet, eInv_PayDet_Mode, eInv_PayDet_FinInsBr, eInv_PayDet_PayTerm, eInv_PayDet_PayInstr, eInv_PayDet_CrTrn, eInv_PayDet_DirDr, eInv_PayDet_CrDay, eInv_PayDet_PaidAmt, eInv_PayDet_PaymtDue                   
            JsonTag    :"PayDtls"
           
            [Field :eInv_PayDet_Nm]
                Use : Name Field
                Set As :    $PayDtls[1].Nm
                jSonTag :    "Nm"           
       
            [Field :eInv_PayDet_AccDet]
                Use : Name Field
                Set As :    $PayDtls[1].AccDet
                jSonTag :    "AccDet"           
       
            [Field :eInv_PayDet_Mode]
                Use : Name Field
                Set As :    $PayDtls[1].Mode
                jSonTag :    "Mode"           
       
            [Field :eInv_PayDet_FinInsBr]
                Use : Name Field
                Set As :    $PayDtls[1].FinInsBr
                jSonTag :    "FinInsBr"           
       
            [Field :eInv_PayDet_PayTerm]
                Use : Name Field
                Set As :    $PayDtls[1].PayTerm
                jSonTag :    "PayTerm"           
       
            [Field :eInv_PayDet_PayInstr]
                Use : Name Field
                Set As :    $PayDtls[1].PayInstr
                jSonTag :    "PayInstr"           
       
            [Field :eInv_PayDet_CrTrn]
                Use : Name Field
                Set As :    $PayDtls[1].CrTrn
                jSonTag :    "CrTrn"           
       
            [Field :eInv_PayDet_DirDr]
                Use : Name Field
                Set As :    $PayDtls[1].DirDr
                jSonTag :    "DirDr"           
       
            [Field :eInv_PayDet_CrDay]
                Use : Number Field
                Set As :    $PayDtls[1].CrDay
                jSonTag :    "CrDay"           
       
            [Field :eInv_PayDet_PaidAmt]
                Use : Number Field
                Set As :    $PayDtls[1].PaidAmt
                jSonTag :    "PaidAmt"           
       
            [Field :eInv_PayDet_PaymtDue]
                Use : Number Field
                Set As :    $PayDtls[1].PaymtDue
                jSonTag :    "PaymtDue"           
                                           
                                           
    [Part    : eInv_RefDtls]
        Line    : eInv_RefDtls
        Repeat    : eInv_RefDtls : RefDtls
    
        Scroll    : Vertical
        JsonTag     : "RefDtls"
        Vertical: Yes
    
        [Line    :eInv_RefDtls]                               
                Field    : eInv_RefDet_InvRm
                Explode    : eInv_RefDet_DocPerdDtls                               
                Explode    : eInv_RefDet_PrecDocDtls                               
                Explode    : eInv_RefDet_ContrDtls
           
           
            [Field : eInv_RefDet_InvRm]                                   
                Use : Name Field
                Set As :    $InvRm
                jSonTag :    "InvRm"                       
                                           
                                           
        [Part    : eInv_RefDet_DocPerdDtls]
            Line    : eInv_RefDet_DocPerdDtls
        ;    Repeat    : eInv_RefDet_DocPerdDtls : DocPerdDtls
            Scroll    : Vertical
       
            [Line    : eInv_RefDet_DocPerdDtls]
                Fields :    eInv_RefDet_DocDet_InvStDt, eInv_RefDet_DocDet_InvEndDt               
                JsonTag: "DocPerdDtls"
    
            [Field :eInv_RefDet_DocDet_InvStDt]
                Use : Name Field
                Set As :    If $$IsEmpty:$DocPerdDtls[1].InvStDt then "" Else($$DDMMYYYYDateFormat:$DocPerdDtls[1].InvStDt:"/")
                jSonTag :    "InvStDt"           
    
            [Field :eInv_RefDet_DocDet_InvEndDt]
                Use : Name Field
                Set As :    If $$IsEmpty:$DocPerdDtls[1].InvEndDt then "" Else($$DDMMYYYYDateFormat:$DocPerdDtls[1].InvEndDt:"/")
                jSonTag :    "InvEndDt"           
                                           
        [Part    : eInv_RefDet_PrecDocDtls]
            Line    : eInv_RefDet_PrecDocDtls
            Repeat    : eInv_RefDet_PrecDocDtls : RefDtls[1].PrecDocDtls
            Scroll    : Vertical
           
                [Line    : eInv_RefDet_PrecDocDtls]
                    Fields : eInv_RefDet_PreDet_InvNo, eInv_RefDet_PreDet_InvDt, eInv_RefDet_PreDet_OthRefNo                       
                    Jsontag    : "PrecDocDtls"
    
            [Field :eInv_RefDet_PreDet_InvNo]
                Use : Name Field
                Set As :    $InvNo
                jSonTag :    "InvNo"           
    
            [Field :eInv_RefDet_PreDet_InvDt]
                Use : Name Field
                Set As :    If $$IsEmpty:$InvDt then "" Else($$DDMMYYYYDateFormat:$InvDt:"/")
                jSonTag :    "InvDt"           
    
            [Field :eInv_RefDet_PreDet_OthRefNo]
                Use : Name Field
                Set As :    $OthRefNo
                jSonTag :    "OthRefNo"           
                                           
        [Part    : eInv_RefDet_ContrDtls]                               
            Line    : eInv_RefDet_ContrDtls
            Repeat    : eInv_RefDet_ContrDtls : RefDtls[1].ContrDtls
            Scroll    : Vertical
       
                [Line    : eInv_RefDet_ContrDtls]                               
                    Fields :eInv_RefDet_ContDet_RecAdvRefr, eInv_RefDet_ContDet_RecAdvDt, eInv_RefDet_ContDet_TendRefr, eInv_RefDet_ContDet_ContrRefr, eInv_RefDet_ContDet_ExtRefr, eInv_RefDet_ContDet_ProjRefr, eInv_RefDet_ContDet_PORefr, eInv_RefDet_ContDet_PORefDt                    
                    JsonTag    : "ContrDtls"
       
                [Field :eInv_RefDet_ContDet_RecAdvRefr]
    
                Use : Name Field
                Set As :    $RecAdvRefr
                jSonTag :    "RecAdvRefr"           
       
            [Field :eInv_RefDet_ContDet_RecAdvDt]
                Use : Name Field
                Set As :    If $$IsEmpty:$RecAdvDt then "" Else($$DDMMYYYYDateFormat:$RecAdvDt:"/")
                jSonTag :    "RecAdvDt"           
       
            [Field :eInv_RefDet_ContDet_TendRefr]
                Use : Name Field
                Set As :    $TendRefr
                jSonTag :    "TendRefr"           
       
            [Field :eInv_RefDet_ContDet_ContrRefr]
                Use : Name Field
                Set As :    $ContrRefr
                jSonTag :    "ContrRefr"           
       
            [Field :eInv_RefDet_ContDet_ExtRefr]
                Use : Name Field
                Set As :    $ExtRefr
                jSonTag :    "ExtRefr"           
       
            [Field :eInv_RefDet_ContDet_ProjRefr]
                Use : Name Field
                Set As :    $ProjRefr
                jSonTag :    "ProjRefr"           
       
            [Field :eInv_RefDet_ContDet_PORefr]
                Use : Name Field
                Set As :    $PORefr
                jSonTag :    "PORefr"           
       
            [Field :eInv_RefDet_ContDet_PORefDt]
                Use : Name Field
                Set As :    If $$IsEmpty:$PORefDt then "" Else($$DDMMYYYYDateFormat:$PORefDt:"/")
                jSonTag :    "PORefDt"           
                                               
                                           
    [Part    : eInv_AddlDocDtls]                                   
        Line    :eInv_AddlDocDtls
        Repeat    :eInv_AddlDocDtls : AddlDocDtls
        Scroll    : Vertical
    
        [Line    :eInv_AddlDocDtls]                               
                Fields    : eInv_AddDet_Url, eInv_AddDet_Docs, eInv_AddDet_Info
                JsonTag    : "AddlDocDtls"
           
            [Field:eInv_AddDet_Url]
                Use : Name Field
                Set As :    $url
                jSonTag :    "Url"           
       
            [Field:eInv_AddDet_Docs]
                Use : Name Field
                Set As :    $Docs
                jSonTag :    "Docs"           
       
            [Field:eInv_AddDet_Info]
                Use : Name Field
                Set As :    $Info
                jSonTag :    "Info"           
                                               
                                           
    [Part    : eInv_ExpDtls]
        Line    :eInv_ExpDtls
    ;    Repeat    :eInv_ExpDtls : ExpDtls
        Scroll    : Vertical
       
        [Line    :eInv_ExpDtls]                                   
            Fields :    eInv_ExpDet_ShipBNo, eInv_ExpDet_ShipBDt, eInv_ExpDet_Port, eInv_ExpDet_RefClm, eInv_ExpDet_ForCur, eInv_ExpDet_CntCode, eInv_ExpDet_ExpDuty                   
            JsonTag    :"ExpDtls"
       
            [Field:eInv_ExpDet_ShipBNo]
                Use : Name Field
                Set As :    $ExpDtls[1].ShipBNo
                jSonTag :    "ShipBNo"           
       
            [Field:eInv_ExpDet_ShipBDt]
                Use : Name Field
                Set As :    If $$IsEmpty:$ExpDtls[1].ShipBDt then "" Else($$DDMMYYYYDateFormat:$ExpDtls[1].ShipBDt:"/")
                jSonTag :    "ShipBDt"           
       
            [Field:eInv_ExpDet_Port]
                Use : Name Field
                Set As :    $ExpDtls[1].Port
                jSonTag :    "Port"           
       
            [Field:eInv_ExpDet_RefClm]
                Use : Name Field
                Set As :    $ExpDtls[1].RefClm
                jSonTag :    "RefClm"           
       
            [Field:eInv_ExpDet_ForCur]
                Use : Name Field
                Set As :    $ExpDtls[1].ForCur
                jSonTag :    "ForCur"           
       
            [Field:eInv_ExpDet_CntCode]
                Use : Name Field
                Set As :    $ExpDtls[1].CntCode
                jSonTag :    "CntCode"           
       
            [Field:eInv_ExpDet_ExpDuty]
                Type    : Aggregate
                Set By condition :    NOT ExpDtls[1].ExpDuty ="Null" : $ExpDtls[1].ExpDuty
                jSonTag :    "ExpDuty"           
                ;Fixed    : Yes
                ;Inactive    :Yes;  $$IsEmpty:$ExpDtls[1].ExpDuty
                ;Set as    : $$SysName:Empty
           
    [Part    : eInv_EwbDtls]
        Line    :    eInv_EwbDtls
    ;    Repeat    :    eInv_EwbDtls : EwbDtls
    
        Scroll    : Vertical
       
        [Line    :    eInv_EwbDtls]                   
            Fields :    eInv_EwbDet_TransId, eInv_EwbDet_TransName, eInv_EwbDet_Distance, eInv_EwbDet_TransDocNo, eInv_EwbDet_TransDocDt, eInv_EwbDet_VehNo, eInv_EwbDet_VehType, eInv_EwbDet_TransMode
            JsonTag    :    "EwbDtls"
           
            [Field:eInv_EwbDet_TransId]
                Use : Name Field
                Set As :    $EwbDtls[1].TransId
                jSonTag :    "TransId"   
       
            [Field:eInv_EwbDet_TransName]
                Use : Name Field
                Set As :    $EwbDtls[1].TransName
                jSonTag :    "TransName"   
       
            [Field:eInv_EwbDet_Distance]
                Use : Number Field
                Set As :    $EwbDtls[1].Distance
                jSonTag :    "Distance"   
       
            [Field:eInv_EwbDet_TransDocNo]
                Use : Name Field
                Set As :    $EwbDtls[1].TransDocNo
                jSonTag :    "TransDocNo"
       
            [Field:eInv_EwbDet_TransDocDt]
                Use     : Name Field
                Set As :    If $$IsEmpty:$EwbDtls[1].TransDocDt then "" Else ($$DDMMYYYYDateFormat:$EwbDtls[1].TransDocDt:"/")
                jSonTag :    "TransDocDt"
       
            [Field:eInv_EwbDet_VehNo]
                Use : Name Field
                Set As :    $EwbDtls[1].VehNo
                jSonTag :    "VehNo"   
       
            [Field:eInv_EwbDet_VehType]
                Use : Name Field
                Set As :    $EwbDtls[1].VehType
                jSonTag :    "VehType"
       
            [Field:eInv_EwbDet_TransMode]
                Use : Name Field
                Set As :    $EwbDtls[1].TransMode
                jSonTag :    "TransMode"
    
    File : Einv_JsonObject.tdl
    __________________________________________________________________


    Code:
    [Collection    : TxoLvEinvoiceObj]
        Data Source    : File JSON: @@eInv_WriteName1.03
        JSON Object    : TxoLvEinvoicesObj
        Fetch         : *.*
        Client Only    :Yes
    
    
    ;    Object    : TxoLvEinvoicesObj
    ;    Fetch    : *.*
    ;    Fetch    : Version
    
    
    [Object    : TxoLvEinvoicesObj]
    
        Storage        : Version       : String
        Collection  : TranDtls     : TranDtlsObj
        Collection  : DocDtls       : DocDtlsObj
        Collection  : SellerDtls   : SellerDtlsObj
        Collection  : BuyerDtls       : BuyerDtlsObj
        Collection  : DispDtls     : DispDtlsObj
        Collection  : ShipDtls     : ShipDtlsObj
        Collection  : ItemList     : ItemListObj
        Collection  : ValDtls      : ValDtlsObj
        Collection  : PayDtls      : PayDtlsObj
        Collection  : RefDtls      : RefDtlsObj
        Collection  : AddlDocDtls  : AddlDocDtlsObj
        Collection  : ExpDtls      : ExpDtlsObj
        Collection  : EwbDtls      : EwbDtlsObj
    
    [Object :     TranDtlsObj]
       Storage :  TaxSch        :  String
       Storage :  SupTyp        :  String
       Storage :  RegRev        :  String
       Storage :  EcmGstin        :  String
       Storage :  IgstOnIntra    :  String
    
    [Object :DocDtlsObj]
         Storage : Typ        :String
         Storage : No        :String
         Storage : Dt        :String
       
    [Object    :SellerDtlsObj]
            Storage     :Gstin         : String
            Storage     :LglNm         : String
            Storage     :TrdNm         : String
            Storage     :Addr1         : String
            Storage     :Addr2         : String
            Storage     :Loc         : String
            Storage     :Pin         : String
            Storage     :Stcd         : String
            Storage     :Ph             : String
            Storage     :Em             : String
                                  
    
    [Object    :BuyerDtlsObj]
            Storage        :    Gstin        : String
            Storage        :    LglNm        : String
            Storage        :    TrdNm        : String
            Storage        :    Pos            : String
            Storage        :    Addr1        : String
            Storage        :    Addr2        : String
            Storage        :    Loc            : String
            Storage        :    Pin            : String
            Storage        :    Stcd        : String
            Storage        :    Ph            : String
            Storage        :    Em            : String
       
    
    [Object    :DispDtlsObj]
             Storage    :    Nm        : String
             Storage    :    Addr1    : String
             Storage    :    Addr2    : String
             Storage    :    Loc        : String
             Storage    :    Pin        : String
             Storage    :    Stcd    : String
                               
    
    [Object    :ShipDtlsObj]
            Storage    :     Gstin        : String
            Storage    :     LglNm        : String
            Storage    :     TrdNm        : String
            Storage    :     Addr1        : String
            Storage    :     Addr2        : String
            Storage    :     Loc        : String
            Storage    :     Pin        : String
            Storage    :     Stcd        : String
    
    [Object    :ItemListObj]
              Storage    :SlNo                : String
             Storage    :PrdDesc            : String
             Storage    :IsServc            : String
             Storage    :HsnCd                : String
             Storage    :Barcde                : String
             Storage    :Qty                : String
             Storage    :FreeQty            : String
             Storage    :Unit                : String
             Storage    :UnitPrice            : String
             Storage    :TotAmt                : String
             Storage    :Discount            : String
             Storage    :PreTaxVal            : String
             Storage    :AssAmt                : String
             Storage    :GstRt                : Number
             Storage    :IgstAmt            : String
             Storage    :CgstAmt            : String
             Storage    :SgstAmt            : String
             Storage    :CesRt                : Number
             Storage    :CesAmt                : String
             Storage    :CesNonAdvlAmt        : String
             Storage    :StateCesRt            : String
             Storage    :StateCesAmt        : String
             Storage    :StateCesNonAdvlAmt : String
             Storage    :OthChrg            : String
             Storage    :TotItemVal            : String
             Storage    :OrdLineRef            : String
             Storage    :OrgCntry            : String
             Storage    :PrdSlNo            : String
            Collection  : BchDtls      : BchDtlsObj
            Collection  : AttribDtls   : AttribDtlsObj
       
        [Object    :BchDtlsObj]
             Storage    : Nm         : String
             Storage    : ExpDt         : String
             Storage    : WrDt         : String
    
        [Object    :AttribDtlsObj    ]
             Storage     :    Nm     : String
             Storage     :    Val     : String
    
    
    [Object    :ValDtlsObj]
             Storage    :    AssVal        : Amount
             Storage    :    CgstVal         : Amount
             Storage    :    SgstVal         : Amount
             Storage    :    IgstVal        : Amount
             Storage    :    CesVal        : Amount
             Storage    :    StCesVal    : Amount
             Storage    :    Discount    : Amount
             Storage    :    OthChrg         : Amount
             Storage    :    RndOffAmt    : Amount
             Storage    :    TotInvVal    : Amount
             Storage    :    TotInvValFc : Amount
    
    [Object    :PayDtlsObj]    
            Storage : Nm        : String
            Storage : AccDet    : String
            Storage : Mode        : String
            Storage : FinInsBr    : String
            Storage : PayTerm    : String
            Storage : PayInstr    : String
            Storage : CrTrn        : String
            Storage : DirDr        : String
            Storage : CrDay        : Number
            Storage : PaidAmt    : Number
            Storage : PaymtDue    : Number
       
    
    [Object    :RefDtlsObj]
            Storage        : InvRm        : String
            Collection    : DocPerdDtls   : DocPerdDtlsObj
            Collection    : PrecDocDtls   : PrecDocDtlsObj
            Collection    : ContrDtls     : ContrDtlsObj
       
            [Object    :DocPerdDtlsObj]
                Storage:  InvStDt    : String
                Storage:  InvEndDt    : String
       
            [Object        : PrecDocDtlsObj]
                Storage     : InvNo        :  String
                Storage     : InvDt        :  String
                Storage     : OthRefNo    :  String
       
            [Object    :ContrDtlsObj]
                Storage : RecAdvRefr    : String
                Storage : RecAdvDt        : String
                Storage : TendRefr        : String
                Storage : ContrRefr        : String
                Storage : ExtRefr        : String
                Storage : ProjRefr        : String
                Storage : PORefr        : String
                Storage : PORefDt        : String
    
    
    [Object    :AddlDocDtlsObj]
          Storage    : Url        : String
         Storage    : Docs        : String
         Storage    : Info        : String
    
    
    [Object    :ExpDtlsObj]
            Storage    :    ShipBNo    :  String
            Storage    :    ShipBDt    :  String
            Storage    :    Port    :  String
            Storage    :    RefClm    :  String
            Storage    :    ForCur    :  String
            Storage    :    CntCode    :  String
            Storage    :    ExpDuty    :  String
    
    
    [Object    :EwbDtlsObj]
        Storage        :    TransId        : String
        Storage        :    TransName    : String
        Storage        :    Distance    : Number
        Storage        :    TransDocNo    : String
        Storage        :    TransDocDt    : String
        Storage        :    VehNo        : String
        Storage        :    VehType        : String
        Storage        :    TransMode    : String
    
    ;---------------------------------------------------------------------------------------
    
    [Object : TxoLvEinvoiceIRN ]
            Storage        : status       : String
            Storage        : Data            : String
        ;    Collection    : Data           : eInvInrDataObj
            Collection    : ErrorDetails : eInvErrDet
            Collection    : InfoDtls       : eInvInfoDet
       
        [Object    : eInvInrDataObj]
            Storage : AckNo            : Number
            Storage : AckDt            : DateTime
            Storage : Irn              : String
            Storage : SignedInvoice    : String
            Storage : SignedQRCode    : String
            Storage : Status        : String
            Storage : EwbNo            : String
            Storage : EwbDt            : String
            Storage : EwbValidTill    : String
            Storage : Remarks        : String
       
            Collection    : ExtractedSignedInvoiceData : ExtractedSignedInvoiceDataObj
       
       
        [Object    : eInvErrDet]
            Storage    : ErrorCode        :String
            Storage    : ErrorMessage    :String
    
        [Object    : eInvInfoDet]
            Storage    : alertmessage    :String
       
    
    
    [Object    : ExtractedSignedInvoiceDataObj]
    
        Storage        : AckNo        : String
        Storage        : AckDt        : String
        Storage        : Version    : String
        Storage        : Irn        : String
    
        Collection  : TranDtls     : TranDtlsObj
        Collection  : DocDtls       : DocDtlsObj
        Collection  : SellerDtls   : SellerDtlsObj
        Collection  : BuyerDtls       : BuyerDtlsObj
        Collection  : DispDtls     : DispDtlsObj
        Collection  : ShipDtls     : ShipDtlsObj
        Collection  : ValDtls      : ValDtlsObj
        Collection  : PayDtls      : PayDtlsObj
        Collection  : ExpDtls      : ExpDtlsObj
        Collection  : RefDtls      : RefDtlsObj
    
        Collection  : ItemList     : ItemListObj
    
    ;    Collection  : AddlDocDtls  : AddlDocDtlsObj
    ;    Collection  : EwbDtls      : EwbDtlsObj
    
        Collection     : ExtractedSignedQrCode : ExtractedSignedQrCodeObj
       
        Storage     : QrCodeImage    : String
        Storage     : wtIssuer        :  string
    
    
        [Object    : ExtractedSignedQrCodeObj ]
                Storage     : SellerGstin    : String
                Storage     : BuyerGstin    : String
                Storage     : DocNo        : String
                Storage     : DocTyp        : String
                Storage     : DocDt        : String
                Storage     : TotInvVal    : Amount
                Storage     : ItemCnt        : Number
                Storage     : MainHsnCode    : String
                Storage     : Irn            : String
          
      
    File : eInv_ListStructure.tdl
    __________________________________________________________________


    Code:
    [Collection    : TxoLvEinvoiceSrc]
            Data Source    :  Variable    : Txo_EInvoice
            Fetch    : Version
            Fetch    : TranDtls.*
            Fetch    : DocDtls.*
            Fetch    : SellerDtls.*
            Fetch    : BuyerDtls.*
            Fetch    : DispDtls.*
            Fetch    : ShipDtls.*
            Fetch    : ItemList.*
            Fetch    : ValDtls.*
            Fetch    : PayDtls.*
            Fetch    : RefDtls.*
            Fetch    : AddlDocDtls.*
            Fetch    : ExpDtls.*
            Fetch    : EwbDtls.*
    
    [Collection    : TxoLvEinvoice]
        Source Collection    : TxoLvEinvoiceSrc
        Fetch    : *.*
        Compute    :  Version : $..Version
        Is ODBC Table    : Yes
    
    [Object    : Txo_EInvoice]
        [Object : TranDtls ]
        [Object : DocDtls]
        [Object : SellerDtls]
        [Object : BuyerDtls]
        [Object : DispDtls]
        [Object : ShipDtls]
        [Object : ItemList]
            [Object : BchDtls]
            [Object :AttribDtls]
        [Object : ValDtls]      
        [Object : PayDtls]
        [Object : RefDtls]
            [Object    : DocPerdDtls]
            [Object    : PrecDocDtls]
            [Object    : ContrDtls]
        [Object : AddlDocDtls]
        [Object : ExpDtls]
        [Object : EwbDtls]
    
    
    
    [System    : Variable]
    ;        List Variable : TxoLvEinvoiceList
    ;    [Variable    : TxoLvEinvoiceList]
    ;        Variable        : InvMasterId    : String
        List Variable    : Txo_EInvoice
    
    [Variable    : Txo_EInvoice]
        Variable      :    InvMasterId    : String
        Variable       : Version    : String: "1.1"
        List Variable : TranDtls
        List Variable : DocDtls
        List Variable : SellerDtls
        List Variable : BuyerDtls
        List Variable : DispDtls
        List Variable : ShipDtls
        List Variable : ItemList
        List Variable : ValDtls
        List Variable : PayDtls
        List Variable : RefDtls
        List Variable : AddlDocDtls
        List Variable : ExpDtls
        List Variable : EwbDtls
    
    [Variable :     TranDtls]
        Variable    : TaxSch        : String
        Variable    : SupTyp        : String
        Variable    : RegRev        : String
        Variable    : EcmGstin        : String
        Variable    : IgstOnIntra    : String
    
    [Variable        :DocDtls]
        Variable    : Typ            : String
        Variable    : No            : String
        Variable    : Dt            : Date
       
    [Variable    :SellerDtls]
            Variable    : Gstin        : String
            Variable    : LglNm        : String
            Variable    : TrdNm        : String
            Variable    : Addr1        : String
            Variable    : Addr2        : String
            Variable    : Loc        : String
            Variable    : Pin        : Number
            Variable    : Stcd        : String
            Variable    : Ph        : String
            Variable    : Em        : String
    
    [Variable    :BuyerDtls]
            Variable    : Gstin        : String
            Variable    : LglNm        : String
            Variable    : TrdNm        : String
            Variable    : Pos        : String
            Variable    : Addr1        : String
            Variable    : Addr2        : String
            Variable    : Loc        : String
            Variable    : Pin        : String
            Variable    : Stcd        : String
            Variable    : Ph        : String
            Variable    : Em        : String
       
    
    [Variable    :DispDtls]
            Variable    : Nm        : String
            Variable    : Addr1        : String
            Variable    : Addr2        : String
            Variable    : Loc        : String
            Variable    : Pin        : Number
            Variable    : Stcd        : String
    
    
    [Variable    :ShipDtls]
            Variable    : Gstin        : String
            Variable    : LglNm        : String
            Variable    : TrdNm        : String
            Variable    : Addr1        : String
            Variable    : Addr2        : String
            Variable    : Loc        : String
            Variable    : Pin        : Number
            Variable    : Stcd        : String
       
    
    [Variable    :ItemList]
             Variable    : SlNo                : String
            Variable    : PrdDesc            : String
            Variable    : IsServc            : String
            Variable    : HsnCd                : String
            Variable    : Barcde            : String
            Variable    : Qty                : Number
            Variable    : FreeQty            : Number
            Variable    : Unit                : String
            Variable    : UnitPrice            : Number
            Variable    : TotAmt            : Number
            Variable    : Discount            : Number
            Variable    : PreTaxVal            : Number
            Variable    : AssAmt            : Number
            Variable    : GstRt                : Number
            Variable    : IgstAmt            : Number
            Variable    : CgstAmt            : Number
            Variable    : SgstAmt            : Number
            Variable    : CesRt                : Number
            Variable    : CesAmt            : Number
            Variable    : CesNonAdvlAmt        : Number
            Variable    : StateCesRt        : Number
            Variable    : StateCesAmt        : Number
            Variable    : StateCesNonAdvlAmt: Number
            Variable    : OthChrg            : Number
            Variable    : TotItemVal        : Number
            Variable    : OrdLineRef        : String
            Variable    : OrgCntry            : String
            Variable    : PrdSlNo            : String
            List Variable : BchDtls
            List Variable : AttribDtls
       
        [Variable    :BchDtls    ]
            Variable    : Nm        : String
            Variable    : ExpDt        : Date
            Variable    : WrDt        : Date
    
        [Variable    :AttribDtls    ]
            Variable    : Nm        : String
            Variable    : Val        : String
    
    
    [Variable    :ValDtls]
            Variable    : AssVal        : Number
            Variable    : CgstVal        : Number
            Variable    : SgstVal        : Number
            Variable    : IgstVal        : Number
            Variable    : CesVal        : Number
            Variable    : StCesVal        : Number
            Variable    : Discount        : Number
            Variable    : OthChrg        : Number
            Variable    : RndOffAmt        : Number
            Variable    : TotInvVal        : Number
            Variable    : TotInvValFc    : Number
    
    [Variable    :PayDtls]
            Variable    : Nm        : String
            Variable    : AccDet    : String
            Variable    : Mode        : String
            Variable    : FinInsBr    : String
            Variable    : PayTerm    : String
            Variable    : PayInstr    : String
            Variable    : CrTrn        : String
            Variable    : DirDr        : String
            Variable    : CrDay        : Number
            Variable    : PaidAmt    : Number
            Variable    : PaymtDue    : Number
       
    
    [Variable    :RefDtls]
            Variable    : InvRm        : String
            List Var    : DocPerdDtls
            List Var    : PrecDocDtls
            List Var    : ContrDtls
       
            [Variable    :DocPerdDtls]
                Variable        : InvStDt    : Date
                Variable        : InvEndDt    : Date
       
            [Variable        : PrecDocDtls]
                Variable    : InvNo        : String
                Variable    : InvDt        : Date
                Variable    : OthRefNo    : String
       
            [Variable    :ContrDtls]
                Variable    : RecAdvRefr    : String
                Variable    : RecAdvDt        : Date    
                Variable    : TendRefr        : String
                Variable    : ContrRefr        : String
                Variable    : ExtRefr        : String
                Variable    : ProjRefr        : String
                Variable    : PORefr        : String
                Variable    : PORefDt        : Date    
    
    
    [Variable    :AddlDocDtls]
         Variable    : Url        : String
        Variable    : Docs        : String
        Variable    : Info        : String
    
    
    [Variable    :ExpDtls]
        Variable    : ShipBNo    : String
        Variable    : ShipBDt    : Date
        Variable    : Port        : String
        Variable    : RefClm    : String
        Variable    : ForCur    : String
        Variable    : CntCode    : String
        Variable    : ExpDuty    : String
    
    
    [Variable    :EwbDtls]
        Variable    : TransId        : String
        Variable    : TransName        : String
        Variable    : Distance        : String
        Variable    : TransDocNo    : String
        Variable    : TransDocDt    : Date
        Variable    : VehNo            : String
        Variable    : VehType        : String
        Variable    : TransMode        : String
      

    File : eInv_Settings.tdl
    __________________________________________________________________


    Code:
    [#Part : CMP TallyShopFeaturesTitle]
    
        Add    : Line    : After        : CMP TallyShopFeaturesTitle    : AES Enable EInvoice
    [Line : AES Enable EInvoice]
    
        Field    : Long Prompt, AES EnableEInvoice
        Local    : Field    : Long Prompt    : Info    : $$LocaleString:"Enable E-Invoicing?"
        Local    : Field    : Long Prompt    : Width    : 50
    
    [Field : AES Enable E Invoice]
    
        Use         : Logical Field
        Storage        : Udf_EInvoice_IsEnabled
    
    
    [System    : UDF]
        Udf_EInvoice_IsEnabled : Logical    : 1200
    
    [System : Formula]
    
        EInvoicingEnabled : $Udf_EInvoice_IsEnabled:Company:##SVCurrentCompany
    
    
    File : eInv_JsonWrite.tdl
    __________________________________________________________________


    This contains List Structure and also the code to write json file

    Code:
    [Function: Txo_EInv_WriteToList]
    
        Parameter   : pVchrMSTId                : Number    : $MasterID
    
        Variable    : vGSTeWayBillValidationErr : String    : ""
        Variable    : ORIGVchNum                : String
        Variable    : VARVchDate                : Date
        Variable    : VoucherID                 : String
        Variable    : vIsGSTeWayDtlsExported    : Logical   : No
        Variable    : vIsPurchaseFromURD        : Logical   : No
        Variable    : vEwayBillDate             : Date
        Variable    : vEwayPartyName            : String
        Variable    : vVchAmt                   : Amount
        Variable    : vFirstGSTTransNature      : String    : ""
        Variable    : vEInvMstIdx                : Number
    
    
        List Var    : lvGSTAnalysisDetails
    
        Object      : Voucher   : $$Sprintf:"ID:%s":##pVchrMSTId
    
        00  : Do If : NOT ##ICFGEditeWayBill OR $GSTVchTransTypeCode NOT IN (2,3) OR ($$IsEmptyCollection:EWayBillDetails)  : Return
    
        10  : Set   : VoucherID : $$Sprintf:"ID:%s":##pVchrMSTId
    
        15  : List Delete   : lvGSTAnalysisDetails
        20  : Call          : LoadGSTInvDtlsLV
        25  : Call          : UpdGSTeWayVchDtlsVar
    
    ;    30  : Do If     : NOT ##IsVchWGSTeWayItmExcep   : Set   : vGSTeWayBillValidationErr : $$GSTVchEWayBillValidationErr
    
    ;    35  : Do If     : (##IsVchWGSTeWayItmExcep OR NOT $$IsEmpty:##vGSTeWayBillValidationErr)    : Return
    
        40  : Set       : ORIGVchNum    : $VoucherNumber
        45  : Set       : VARVchDate    : $Date
        50  : Set       : vEwayBillDate : If $$IsEmpty:$GSTeWayBillDate Then $Date Else $GSTeWayBillDate
        55  : Set       : vEwayPartyName: @@GSTPartyLedgerNameRecon
        60  : Set       : vVchAmt       : $Amount
    
        70  : Set       : IsGSTeWayVchLevelExp  : Yes
            ;; Export to json/excel for the proper data
    
       ; 80 :  Alter : GSTeWayBillUpdateNoDt
    
    
    
        90    : Call        : Txo_WriteListDetails:##VoucherID
    
    
    /*
    [#Collection: GSTeWayBillPrintSummary]
        Add        : Compute    :   GSTInvoice_GSTAssesableQty        : $GSTInvoice_GSTAssesableQty
        Add        : Compute    :     GSTInvoice_ItemHSNCode             : $GSTInvoice_ItemHSNCode
        Add        : Compute    :     GSTInvoice_CessValGSTClsTaxAmt  : $GSTInvoice_CessValGSTClsTaxAmt
        Add        : Compute    :   GSTInvoice_CessQtyGSTClsTaxAmt  : $GSTInvoice_CessQtyGSTClsTaxAmt
        Add        : Compute    :     GSTVchOthersAmount                : $GSTVchOthersAmount
        Add        : Compute    :     GSTInvoice_ItemLedRate             : $GSTInvoice_ItemLedRate
        Add        : Compute    :     GSTInvoice_GSTAssesableQty        : $GSTInvoice_GSTAssesableQty
       
        Is ODBC Table    : Yes
    */
    
    [Function    : Txo_WriteListDetails]
    
        Parameter    : pVoucherID    : String
    
        Object      : Voucher   : ##pVoucherID
       
            Variable : IdxTranDtls        : Number
            Variable : IdxDocDtls        : Number
            Variable : IdxSellerDtls    : Number
            Variable : IdxBuyerDtls        : Number
            Variable : IdxDispDtls      : Number
            Variable : IdxShipDtls      : Number
            Variable : IdxItemList      : Number
            Variable : IdxValDtls       : Number
            Variable : IdxPayDtls       : Number
            Variable : IdxRefDtls       : Number
            Variable : IdxAddlDocDtls   : Number
            Variable : IdxExpDtls       : Number
            Variable : IdxEwbDtls       : Number
       
            Variable : vItemListSrNo    : Number
            Variable : vEInvItemKey        : String
            Variable : idxBchDtls        : Number
            Variable : idxAttribDtls    : Number
            Variable : idxDocPerdDtls    : Number
            Variable : idxPrecDocDtls    : Number
            Variable : idxContrDtls        : Number
    
        01    : List Delete Ex    :Txo_EInvoice
        10    : Do If        : NOT( $$ListFind:Txo_EInvoice:##pVchrMSTId ): List Add:Txo_EInvoice:##pVchrMSTId                       
        20    : Set        : vEInvMstIdx : $$ListIndex:Txo_EInvoice:##pVchrMSTId                       
        30    : Set        : Txo_EInvoice[##vEInvMstIdx].InvMasterId :##pVchrMSTId                       
        40    : Set        : Txo_EInvoice[##vEInvMstIdx].Version     : "1.1"                   
                                           
        50    : List Add    : Txo_EInvoice[##vEInvMstIdx].TranDtls     :##pVchrMSTId                       
        60    : Set        : IdxTranDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].TranDtls:##pVchrMSTId                       
                                           
        80    : Set        : Txo_EInvoice[##vEInvMstIdx].TranDtls[##IdxTranDtls].TaxSch        :  "GST"               
        90    : Set        : Txo_EInvoice[##vEInvMstIdx].TranDtls[##IdxTranDtls].SupTyp        :  "B2B"               
        100    : Set        : Txo_EInvoice[##vEInvMstIdx].TranDtls[##IdxTranDtls].RegRev        :  "Y"               
        110    : Set        : Txo_EInvoice[##vEInvMstIdx].TranDtls[##IdxTranDtls].EcmGstin        :  "Null"
        120    : Set        : Txo_EInvoice[##vEInvMstIdx].TranDtls[##IdxTranDtls].IgstOnIntra    :  "N"                       
                                           
        130    : List Add    : Txo_EInvoice[##vEInvMstIdx].DocDtls     :##pVchrMSTId                       
        140    : Set        : IdxDocDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].DocDtls:##pVchrMSTId                       
                                           
                                           
        150    : Set        : Txo_EInvoice[##vEInvMstIdx].DocDtls[##IdxDocDtls].Typ            : If $$IsSales:$VoucherTypeName then "INV" else If $$IsDebitNote:$VoucherTypeName then "DBN" Else If  $$IsCreditNoteNote:$VoucherTypeName Then "CDN" Else ""
        160    : Set        : Txo_EInvoice[##vEInvMstIdx].DocDtls[##IdxDocDtls].No            : $VoucherNumber
        170    : Set        : Txo_EInvoice[##vEInvMstIdx].DocDtls[##IdxDocDtls].Dt            : $Date
                                           
        180    : List Add    : Txo_EInvoice[##vEInvMstIdx].SellerDtls     :##pVchrMSTId                       
        190    : Set        : IdxSellerDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].SellerDtls:##pVchrMSTId                       
        191    : Log: "Hi"
    
        195    : Walk         : EwayBillDetails
        200    :        Set        : Txo_EInvoice[##vEInvMstIdx].SellerDtls[##IdxSellerDtls].Gstin     : $ConsignorGSTIN
        210    :        Set        : Txo_EInvoice[##vEInvMstIdx].SellerDtls[##IdxSellerDtls].LglNm     : $ConsignorName
        220    :        Set        : Txo_EInvoice[##vEInvMstIdx].SellerDtls[##IdxSellerDtls].TrdNm     : $ConsignorName
        230    :        Set        : Txo_EInvoice[##vEInvMstIdx].SellerDtls[##IdxSellerDtls].Addr1     : $ConsignorAddress[1].ConsignorAddress
        240    :        Set        : Txo_EInvoice[##vEInvMstIdx].SellerDtls[##IdxSellerDtls].Addr2     : $ConsignorAddress[2].ConsignorAddress
        250    :        Set        : Txo_EInvoice[##vEInvMstIdx].SellerDtls[##IdxSellerDtls].Loc     : $ConsignorPlace
        260    :        Set        : Txo_EInvoice[##vEInvMstIdx].SellerDtls[##IdxSellerDtls].Pin     : $ConsignorPincode
        270    :        Set        : Txo_EInvoice[##vEInvMstIdx].SellerDtls[##IdxSellerDtls].Stcd     : $$GetGSTStateCode:$ConsignorStateName
        280    :        Set        : Txo_EInvoice[##vEInvMstIdx].SellerDtls[##IdxSellerDtls].Ph     : @@EInvSellerPh;$(Ledger, $ConsignorName).LedgerPhone               
        290    :        Set        : Txo_EInvoice[##vEInvMstIdx].SellerDtls[##IdxSellerDtls].Em     : @@EInvSellerEmail;$(Ledger, $ConsignorName).Email                   
    
    
        300    : List Add    : Txo_EInvoice[##vEInvMstIdx].BuyerDtls     :##pVchrMSTId                       
        310    : Set        : IdxBuyerDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].BuyerDtls:##pVchrMSTId                       
                                           
                                           
        320    : Set        : Txo_EInvoice[##vEInvMstIdx].BuyerDtls[##IdxBuyerDtls].Gstin     : $ConsigneeGSTIN
        330    : Set        : Txo_EInvoice[##vEInvMstIdx].BuyerDtls[##IdxBuyerDtls].LglNm     : $ConsigneeName
        340    : Set        : Txo_EInvoice[##vEInvMstIdx].BuyerDtls[##IdxBuyerDtls].TrdNm     : $ConsigneeName
        350    : Set        : Txo_EInvoice[##vEInvMstIdx].BuyerDtls[##IdxBuyerDtls].Pos         : $ConsigneeStateName                
        360    : Set        : Txo_EInvoice[##vEInvMstIdx].BuyerDtls[##IdxBuyerDtls].Addr1     : $ConsigneeAddress[1].ConsigneeAddress
        370    : Set        : Txo_EInvoice[##vEInvMstIdx].BuyerDtls[##IdxBuyerDtls].Addr2     : $ConsigneeAddress[2].ConsigneeAddress
        380    : Set        : Txo_EInvoice[##vEInvMstIdx].BuyerDtls[##IdxBuyerDtls].Loc         : $ConsigneePlace
        390    : Set        : Txo_EInvoice[##vEInvMstIdx].BuyerDtls[##IdxBuyerDtls].Pin         : $ConsigneePincode
        400    : Set        : Txo_EInvoice[##vEInvMstIdx].BuyerDtls[##IdxBuyerDtls].Stcd     : $$GetGSTStateCode:$ConsigneeStateName                
        410    : Set        : Txo_EInvoice[##vEInvMstIdx].BuyerDtls[##IdxBuyerDtls].Ph         : $(Ledger,  $ConsigneeName).LedgerPhone           
        420    : Set        : Txo_EInvoice[##vEInvMstIdx].BuyerDtls[##IdxBuyerDtls].Em         : $(Ledger,  $ConsigneeName).Email                   
    
        425 : End Walk
    
        430    : List Add    : Txo_EInvoice[##vEInvMstIdx].DispDtls     :##pVchrMSTId                       
        440    : Set        : IdxDispDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].DispDtls:##pVchrMSTId                       
                                           
        450    : Set        : Txo_EInvoice[##vEInvMstIdx].DispDtls[##IdxDispDtls].Nm        :  $PartyName                
        460    : Set        : Txo_EInvoice[##vEInvMstIdx].DispDtls[##IdxDispDtls].Addr1        :  $Address[1].Address                
        470    : Set        : Txo_EInvoice[##vEInvMstIdx].DispDtls[##IdxDispDtls].Addr2        :  $Address[2].Address                                    
        480    : Set        : Txo_EInvoice[##vEInvMstIdx].DispDtls[##IdxDispDtls].Loc        :  $PartyLocation                
        490    : Set        : Txo_EInvoice[##vEInvMstIdx].DispDtls[##IdxDispDtls].Pin        :  ""           
        500    : Set        : Txo_EInvoice[##vEInvMstIdx].DispDtls[##IdxDispDtls].Stcd        :  ""       
                                           
        510    : List Add    : Txo_EInvoice[##vEInvMstIdx].ShipDtls     :##pVchrMSTId                   
        520    : Set        : IdxShipDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].ShipDtls:##pVchrMSTId                   
                                       
        530    : Set        : Txo_EInvoice[##vEInvMstIdx].ShipDtls[##IdxShipDtls].Gstin        : ""
        540    : Set        : Txo_EInvoice[##vEInvMstIdx].ShipDtls[##IdxShipDtls].LglNm        : ""   
        550    : Set        : Txo_EInvoice[##vEInvMstIdx].ShipDtls[##IdxShipDtls].TrdNm        : ""
        560    : Set        : Txo_EInvoice[##vEInvMstIdx].ShipDtls[##IdxShipDtls].Addr1        : ""       
        570    : Set        : Txo_EInvoice[##vEInvMstIdx].ShipDtls[##IdxShipDtls].Addr2        : ""
        580    : Set        : Txo_EInvoice[##vEInvMstIdx].ShipDtls[##IdxShipDtls].Loc        : ""
        590    : Set        : Txo_EInvoice[##vEInvMstIdx].ShipDtls[##IdxShipDtls].Pin        : ""
        600    : Set        : Txo_EInvoice[##vEInvMstIdx].ShipDtls[##IdxShipDtls].Stcd        : ""
    
        605    : Set        : vItemListSrNo    : 1
    
        610    : Walk Collection    : GSTeWayBillPrintSummary
        611    : Set        : vEInvItemKey    : ($$String:##pVchrMSTId+"#"+$$String:$GSTInvoice_StockItemName)
        615    : List Add    : Txo_EInvoice[##vEInvMstIdx].ItemList:##vEInvItemKey           
        620    : Set        : IdxItemList : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].ItemList:##vEInvItemKey       
    
        626    : Log:$GSTInvoice_StockItemName + "Dev --" + ($$String:##vItemListSrNo)    +" --"+($$String:##pVchrMSTId)+"#"+($$String:##vItemListSrNo)
        627    : Log:##IdxItemList
        630    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].SlNo                 : $$String:##vItemListSrNo
    
        640    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].PrdDesc             :$GSTInvoice_StockItemName   
        650    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].IsServc             :if $(StockItem, $STInvoice_StockItemName).Gsttypeofsupply = "Service" Then "Y" Else "N"
        660    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].HsnCd                 :$GSTInvoice_ItemHSNCode
        670    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].Barcde             :""        
        675 : Log        : $$String:$GSTInvoice_GSTAssesableQty
        680    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].Qty                 :$GSTInvoice_GSTAssesableQty  ;$$Number:$ActualQty   
        690    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].FreeQty             :"";$$Number:($$NettQty:$ActualQty:$BilledQty)
        700    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].Unit                 :$GSTInvoice_GSTStockItemUOM ;$(StockItem, $StockItemName).BaseUnit    
        710    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].UnitPrice             :$$Number:@@GSTeWayBillTaxRate;$$Number:$Rate        
        720    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].TotAmt             :$$Number:@@GSTeWayBillDocValue;$Amount+$Discount        
        730    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].Discount             :"";$Discount
        740    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].PreTaxVal             :"";$AssessableValue
        750    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].AssAmt             :$$Number:$GSTInvoice_GSTAssesableValue;;9978.84        
        760    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].GstRt                 :$$Number:$GSTInvoice_CGSTClsfnRate+$GSTInvoice_SGSTClsfnRate+$GSTInvoice_IGSTClsfnRate;$IgstRate
        770    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].CgstAmt             :$$Number:$GSTInvoice_CGSTClsTaxAmt   
        780    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].SgstAmt             :$$Number:$GSTInvoice_SGSTClsTaxAmt
        790    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].IgstAmt             :$$Number:$GSTInvoice_IGSTClsTaxAmt
        800    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].CesRt                 :$$Number:$GSTInvoice_CessGSTClsfnRate 
        810    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].CesAmt             :$$Number:$GSTInvoice_CessValGSTClsTaxAmt
        820    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].CesNonAdvlAmt         : ""
        830    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].StateCesRt         :$$Number:$GSTItemTaxStateCessRate    
        840    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].StateCesAmt         :$$Number:$GSTItemTaxStateCessAmt
        850    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].StateCesNonAdvlAmt : ""                   
        860    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].OthChrg             :$$Number:@@GSTeWayBillOthersAmtVal   
        870    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].TotItemVal         :$$Number:@@GSTeWayBillDocValue            
        880    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].OrdLineRef         : ""            
        890    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].OrgCntry             : ""        
        900    : Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].PrdSlNo             : ""        
                                       
                                       
        910    :        List Add    : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].BchDtls     : ($$String:##pVchrMSTId)+"#"+($$String:##vItemListSrNo)
        920    :        Set        : IdxBchDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].BchDtls:($$String:##pVchrMSTId)+"#"+($$String:##vItemListSrNo)
                                           
        930    :        Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].BchDtls[##IdxBchDtls].Nm         : ""       
        940    :        Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].BchDtls[##IdxBchDtls].ExpDt     : ""                
        950    :        Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].BchDtls[##IdxBchDtls].WrDt     : ""               
                                           
        960    :        List Add    : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].AttribDtls     : ($$String:##pVchrMSTId)+"#"+($$String:##vItemListSrNo)
        970    :        Set        : IdxAttribDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].AttribDtls:($$String:##pVchrMSTId)+"#"+($$String:##vItemListSrNo)
                                           
        980    :        Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].AttribDtls[##IdxAttribDtls].Nm    : ""               
        990    :        Set        : Txo_EInvoice[##vEInvMstIdx].ItemList[##IdxItemList].AttribDtls[##IdxAttribDtls].Val    : ""               
    
        996    : Increment :  vItemListSrNo
    
    
        998    : End Walk
    
        1000    : List Add    : Txo_EInvoice[##vEInvMstIdx].ValDtls     :##pVchrMSTId                   
        1010    : Set        : IdxValDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].ValDtls:##pVchrMSTId                   
                                       
        1020    : Set        : Txo_EInvoice[##vEInvMstIdx].ValDtls[##IdxValDtls].AssVal        : @@GSTeWayBillTotAssessable           
        1030    : Set        : Txo_EInvoice[##vEInvMstIdx].ValDtls[##IdxValDtls].CgstVal        : @@GSTeWayBillTotCGSTAmt            
        1040    : Set        : Txo_EInvoice[##vEInvMstIdx].ValDtls[##IdxValDtls].SgstVal        : @@GSTeWayBillTotSGSTAmt            
        1050    : Set        : Txo_EInvoice[##vEInvMstIdx].ValDtls[##IdxValDtls].IgstVal        : @@GSTeWayBillTotIGSTAmt           
        1060    : Set        : Txo_EInvoice[##vEInvMstIdx].ValDtls[##IdxValDtls].CesVal        : @@GSTeWayBillTotCessValAmt       
        1070    : Set        : Txo_EInvoice[##vEInvMstIdx].ValDtls[##IdxValDtls].StCesVal    : ""               
        1080    : Set        : Txo_EInvoice[##vEInvMstIdx].ValDtls[##IdxValDtls].Discount    : ""                
        1090    : Set        : Txo_EInvoice[##vEInvMstIdx].ValDtls[##IdxValDtls].OthChrg        : @@GSTeWayBillTotOthersAmount   
        1100    : Set        : Txo_EInvoice[##vEInvMstIdx].ValDtls[##IdxValDtls].RndOffAmt    : @@GSTeWayBillTotOthersAmount                       
        1110    : Set        : Txo_EInvoice[##vEInvMstIdx].ValDtls[##IdxValDtls].TotInvVal    : @@GSTeWayBillTotDocumentValue           
        1120    : Set        : Txo_EInvoice[##vEInvMstIdx].ValDtls[##IdxValDtls].TotInvValFc    : ""               
                                       
        1130    : List Add    : Txo_EInvoice[##vEInvMstIdx].PayDtls     :##pVchrMSTId                   
        1140    : Set        : IdxPayDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].PayDtls:##pVchrMSTId                   
                                       
                                       
        1150    : Set        : Txo_EInvoice[##vEInvMstIdx].PayDtls[##IdxPayDtls].Nm            :  ""
        1160    : Set        : Txo_EInvoice[##vEInvMstIdx].PayDtls[##IdxPayDtls].AccDet        :  ""       
        1170    : Set        : Txo_EInvoice[##vEInvMstIdx].PayDtls[##IdxPayDtls].Mode        :  ""
        1180    : Set        : Txo_EInvoice[##vEInvMstIdx].PayDtls[##IdxPayDtls].FinInsBr    :  ""       
        1190    : Set        : Txo_EInvoice[##vEInvMstIdx].PayDtls[##IdxPayDtls].PayTerm        :  ""
        1200    : Set        : Txo_EInvoice[##vEInvMstIdx].PayDtls[##IdxPayDtls].PayInstr    :  ""   
        1210    : Set        : Txo_EInvoice[##vEInvMstIdx].PayDtls[##IdxPayDtls].CrTrn        :  ""
        1220    : Set        : Txo_EInvoice[##vEInvMstIdx].PayDtls[##IdxPayDtls].DirDr        :  ""
        1230    : Set        : Txo_EInvoice[##vEInvMstIdx].PayDtls[##IdxPayDtls].CrDay        :  ""
        1240    : Set        : Txo_EInvoice[##vEInvMstIdx].PayDtls[##IdxPayDtls].PaidAmt        :  ""
        1250    : Set        : Txo_EInvoice[##vEInvMstIdx].PayDtls[##IdxPayDtls].PaymtDue    :  ""
                                       
        1300    : List Add    : Txo_EInvoice[##vEInvMstIdx].RefDtls:##pVchrMSTId                       
        1310    : Set        : IdxRefDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].RefDtls:##pVchrMSTId                   
        1320    : Set        : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].InvRm        : "TEST"            
                                       
        1330    :         List Add    : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].DocPerdDtls     :##pVchrMSTId               
        1340    :         Set        : IdxTranDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].DocPerdDtls:##pVchrMSTId               
                                           
        1350    :         Set        : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].DocPerdDtls[##IdxDocPerdDtls].InvStDt    : $Date                 
        1360    :         Set        : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].DocPerdDtls[##IdxDocPerdDtls].InvEndDt    : $Date + 30           
                                           
        1370    :         List Add    : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].PrecDocDtls     :##pVchrMSTId               
        1380    :         Set        : IdxPrecDocDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].PrecDocDtls:##pVchrMSTId               
                                           
        1390    :         Set        : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].PrecDocDtls[##IdxPrecDocDtls].InvNo        :  $VoucherNumber   
        1400    :         Set        : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].PrecDocDtls[##IdxPrecDocDtls].InvDt        :  $Date        
        1410    :         Set        : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].PrecDocDtls[##IdxPrecDocDtls].OthRefNo    :  ""           
                                           
        1420    :         List Add    : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].ContrDtls     :##pVchrMSTId               
        1430    :         Set        : IdxContrDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].ContrDtls:##pVchrMSTId               
                                           
        1440    :         Set        : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].ContrDtls[##IdxContrDtls].RecAdvRefr    :  ""   
        1450    :         Set        : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].ContrDtls[##IdxContrDtls].RecAdvDt        :  ""        
        1460    :         Set        : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].ContrDtls[##IdxContrDtls].TendRefr        :  ""   
        1470    :         Set        : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].ContrDtls[##IdxContrDtls].ContrRefr        :  ""
        1480    :         Set        : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].ContrDtls[##IdxContrDtls].ExtRefr        :  ""
        1490    :         Set        : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].ContrDtls[##IdxContrDtls].ProjRefr        :  ""   
        1500    :         Set        : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].ContrDtls[##IdxContrDtls].PORefr        :  ""
        1510    :         Set        : Txo_EInvoice[##vEInvMstIdx].RefDtls[##IdxRefDtls].ContrDtls[##IdxContrDtls].PORefDt        :  ""   
    
    
    
        1520    : List Add    : Txo_EInvoice[##vEInvMstIdx].AddlDocDtls     :##pVchrMSTId                       
        1530    : Set        : IdxAddlDocDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].AddlDocDtls:##pVchrMSTId                       
                                           
         1540    : Set        : Txo_EInvoice[##vEInvMstIdx].AddlDocDtls[##idxAddlDocDtls].Url            : "https://einv-apisandbox.nic.in"            
        1550    : Set        : Txo_EInvoice[##vEInvMstIdx].AddlDocDtls[##idxAddlDocDtls].Docs        : "Test Doc"                
        1560    : Set        : Txo_EInvoice[##vEInvMstIdx].AddlDocDtls[##idxAddlDocDtls].Info        : "Document Test"               
    
    
                                               
        1570    : List Add    : Txo_EInvoice[##vEInvMstIdx].ExpDtls     :##pVchrMSTId                       
        1580    : Set        : IdxExpDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].ExpDtls:##pVchrMSTId                       
                                           
        1590    : Set        : Txo_EInvoice[##vEInvMstIdx].ExpDtls[##IdxExpDtls].ShipBNo    :  ""       
        1600    : Set        : Txo_EInvoice[##vEInvMstIdx].ExpDtls[##IdxExpDtls].ShipBDt    :  ""               
        1610    : Set        : Txo_EInvoice[##vEInvMstIdx].ExpDtls[##IdxExpDtls].Port    :  ""           
        1620    : Set        : Txo_EInvoice[##vEInvMstIdx].ExpDtls[##IdxExpDtls].RefClm    :  ""   
        1630    : Set        : Txo_EInvoice[##vEInvMstIdx].ExpDtls[##IdxExpDtls].ForCur    :  ""       
        1640    : Set        : Txo_EInvoice[##vEInvMstIdx].ExpDtls[##IdxExpDtls].CntCode    :  ""       
        1650    : Set        : Txo_EInvoice[##vEInvMstIdx].ExpDtls[##IdxExpDtls].ExpDuty    :  ""       
                                           
                                           
        1660    : List Add    : Txo_EInvoice[##vEInvMstIdx].EwbDtls     :##pVchrMSTId                       
        1670    : Set        : IdxEwbDtls : $$ListIndex:Txo_EInvoice[##vEInvMstIdx].EwbDtls:##pVchrMSTId                       
                                           
        1680    : Set        : Txo_EInvoice[##vEInvMstIdx].EwbDtls[##idxEwbDtls].TransId        :  @@GSTeWayMVchTransID               
        1690    : Set        : Txo_EInvoice[##vEInvMstIdx].EwbDtls[##idxEwbDtls].TransName    :  @@GSTeWayMVchTransName                    
        1700    : Set        : Txo_EInvoice[##vEInvMstIdx].EwbDtls[##idxEwbDtls].Distance    :  @@GSTeWayMVchDistance                   
        1710    : Set        : Txo_EInvoice[##vEInvMstIdx].EwbDtls[##idxEwbDtls].TransDocNo    :  @@GSTeWayMVchTransDocNo               
        1720    : Set        : Txo_EInvoice[##vEInvMstIdx].EwbDtls[##idxEwbDtls].TransDocDt    :  @@GSTeWayMVchTransDate                   
        1730    : Set        : Txo_EInvoice[##vEInvMstIdx].EwbDtls[##idxEwbDtls].VehNo        :  @@GSTeWayMVchVehicleNo           
        1740    : Set        : Txo_EInvoice[##vEInvMstIdx].EwbDtls[##idxEwbDtls].VehType        :  @@GSTeWayMVchVehicleType                
        1750    : Set        : Txo_EInvoice[##vEInvMstIdx].EwbDtls[##idxEwbDtls].TransMode    :  @@GSTeWayMVchTransMode               
                                                                         
    
    
    ;    100 : Do If     : ##vIsGSTeWayDtlsExported  : Alter : GSTeWayBillUpdateNoDt
    
    
    [System    : Formulae]
    
        GSTeWayBillTotDocumentValue        : $$CollAmtTotal:GSTeWayBillPrintSummary:$GSTeWayDocumentValue
        GSTeWayBillTotOthersAmount        : $$CollAmtTotal:GSTeWayBillPrintSummary:$GSTVchOthersAmount
    
    [System : Formula]
    
        EInvSellerPh        : $(Company, ##svCurrentCompany).PhoneNumber
        EInvSellerEmail         : $(Company, ##svCurrentCompany).Email
    
    [Function    : TxoWriteToJson]
    
        ;05    : Log : OPening file
    
        Fetch Object    : Voucher    : ##CurrentVCHID
    
    ;    eInv_Json1.03
    
    ;    001: Set: SVExportFormat : $$SysName:JSON
    ;    002: Set: SVExportLanguage : $$SysName:JSON
    ;    003: Set: SVPrintFileName : "D:\TDL\Development\E-Invoice\Export.json"
    ;    004: Export:eInv_Json1.03 : Yes:Yes
    ;    005: Log: "Hi Dev"
    ;;    006: Return
    
    
        000010     :  OPEN FILE : @@eInv_WriteName1.03  : Text : Write : ASCII
        000011    :    Truncate File    :@@eInv_WriteName1.03
        000015    :     Write File Line     : "{"
    
        000020    :    Walk Collection : TxoLvEinvoiceSrc
    
        000025    :     Write File Line        :     '  "' + "Version" + '"' + ': "' + $Version            + '",'   
    
        000030    :     Walk :TranDtls
        000040    :             Write File Line        : '        "' + "TranDtls"     + '"'    + ': {'
        000050    :            Write File Line        : '     "' + "TaxSch"        + '"'    + ': "' + $TaxSch        + '",'   
        000060    :             Write File Line        : '     "' + "SupTyp"         + '"'    + ': "' + $SupTyp        + '",'   
        000070    :             Write File Line        : '     "' + "RegRev"         + '"'     + ': "' + $RegRev        + '",'
        000080    :             Write File Line        : '     "' + "EcmGstin"         + '"'    + ':  ' + $EcmGstin        + ','   
        000090    :             Write File Line        : '     "' + "IgstOnIntra"     + '"'   + ': "' + $IgstOnIntra    + '"'
        000100    :             Write File Line        : '  },'
        000105    :    End Walk
    
    
        000110    :     Walk :DocDtls
        000120  :         Write File Line            : '  "' + "DocDtls" + '"'     + ': {'
        000130    :         Write File Line            : '     "' + "Typ"     + '"'     + ': "' + $Typ    + '",'                              ;VoucherType
        000140    :         Write File Line            : '     "' + "No"     + '"'   + ': "' + $No     + '",'                          ;VoucherNumber
        000150    :         Write File Line            : '     "' + "Dt"     + '"'   + ': "' + ($$DDMMYYYYDateFormat:$Dt:"/")    + '" '
        000160    :          Write File Line            : '  },'
        000170    :     End Walk
    
        000180    :     Walk :SellerDtls
        000185    :         Write File Line            : '        "' + "SellerDtls" + '"' + ': {'
        000190    :         Write File Line            : '     "' + "GSTIN" + '"'    + ': "' + $GSTIN     + '",'                         ;GST Number
        000195    :         Write File Line            : '     "' + "LglNm" + '"'     + ': "' + $LglNm     + '",'                         ;Legal Name
        000200    :         Write File Line            : '     "' + "TrdNm" + '"'     + ': "' + $TrdNm     + '",'                     ;Trd Name
        000205    :         Write File Line            : '     "' + "Addr1" + '"'     + ': "' + $Addr1     + '",'                         ;Address Line 1
        000210    :         Write File Line            : '     "' + "Addr2" + '"'     + ': "' + $Addr2     + '",'                         ;Address Line 2
        000215    :         Write File Line            : '     "' + "Loc"     + '"'     + ': "' + $Loc         + '",'                                     ;Location
        000220    :         Write File Line            : '     "' + "Pin"      + '"'     + ':  ' +  (If $$Isempty:$Pin then "0" Else $$RemoveBrackets:($$string:($Pin:'no comma')    ))    +','            ;Rate
        000225    :         Write File Line            : '     "' + "Stcd"  + '"'     + ': "' + $Stcd      + '",'                                        ;Stcd
        000230    :         Write File Line            : '     "' + "Ph"      + '"'     + ': "' + $Ph          + '",'                            ;Phone Number
        000235    :         Write File Line            : '     "' + "Em"      + '"'     + ': "' + $Em          + '" '                             ;Email ID
        000240    :        Write File Line            : '  },'
        000250    :     End Walk
    
        000340    :     Walk :BuyerDtls
        000345    :         Write File Line    : '        "' + "BuyerDtls"      + '"' + ': {'
        000350    :         Write File Line    : '     "' + "Gstin"         + '"' + ': "' + $Gstin         + '",'            ;GST Number
        000355    :         Write File Line    : '     "' + "LglNm"          + '"' + ': "' + $LglNm            + '",'           ;Legal Name
        000360    :         Write File Line    : '     "' + "TrdNm"          + '"' + ': "' + $TrdNm            + '",'             ;Trd Name
        000365    :         Write File Line    : '     "' + "Pos"              + '"' + ': "' + $Pos            + '",'            ;Pos
        000370    :         Write File Line    : '     "' + "Addr1"          + '"' + ': "' + $Addr1         + '",'          ;Address Line 1
        000375    :         Write File Line    : '     "' + "Addr2"         + '"' + ': "' + $Addr2         + '",'                  ;Address Line 2
        000380    :         Write File Line    : '     "' + "Loc"             + '"' + ': "' + $Loc            + '",'                     ;Location
        000385    :         Write File Line    : '     "' + "Pin"             + '"' + ':  ' + (If $$Isempty:$Pin then "0" Else $$RemoveBrackets:($$string:($Pin:'no comma')    ))    +','            ;Rate
        000390    :         Write File Line    : '     "' + "Stcd"          + '"' + ': "' + $Stcd            + '",'                             ;GST Number
        000395    :         Write File Line    : '     "' + "Ph"             + '"' + ': "' + $Ph             + '",'                     ;GST Number
        000400    :         Write File Line    : '     "' + "Em"             + '"' + ': "' + $Em            + '" '                    ;GST Number
        000405    :         Write File Line    : '  },    '
        000410    :     End Walk
    
        000415    :     Walk :DispDtls
        000420    :         Write File Line    : '     "' + "DispDtls"         + '"' + ': {'
        000425    :         Write File Line    : '     "' + "Nm"              + '"' + ': "'+ $Nm              + '",'             ;Name
        000430    :         Write File Line    : '     "' + "Addr1"          + '"' + ': "'+ $Addr1            + '",'   ;Address Line 1
        000440    :         Write File Line    : '     "' + "Addr2"          + '"' + ': "'+ $Addr2          + '",'                 ;Address Line 2
        000450    :         Write File Line    : '     "' + "loc"              + '"' + ': "'+ $loc            + '",'                     ;Location
        000460    :         Write File Line    : '     "' + "Pin"              + '"' + ':  '+ (If $$Isempty:$Pin then "0" Else $$RemoveBrackets:($$string:($Pin:'no comma')    ))    +','            ;Rate
        000470    :         Write File Line    : '     "' + "Stcd"          + '"' + ': "'+ $Stcd            + '"'                ;Stcd
        000480    :         Write File Line    : '  },    '
        000485    :     End Walk
    
        000490    :     Walk :ShipDtls
        000495    :         Write File Line    : '     "' + "ShipDtls"     + '"' + ': {'
        000500    :         Write File Line    : '     "' + "Gstin"         + '"' + ': "'+ $Gstin            + '",'             ;GST Number
        000510    :         Write File Line    : '     "' + "LglNm"         + '"' + ': "'+ $LglNm             + '",'         ;
        000520    :         Write File Line    : '     "' + "TrdNm"        + '"' + ': "'+ $TrdNm            + '",'                 ;
        000530    :         Write File Line    : '     "' + "Addr1"        + '"' + ': "'+ $Addr1            + '",'   ;Address Line 1
        000540    :         Write File Line    : '     "' + "Addr2"           + '"' + ': "'+ $Addr2            + '",'                 ;Address Line 2
        000550    :         Write File Line    : '     "' + "loc"            + '"' + ': "'+ $loc                + '",'                     ;Location
        000560    :         Write File Line    : '     "' + "Pin"             + '"' + ':  '+ (If $$Isempty:$Pin then "0" Else $$RemoveBrackets:($$string:($Pin:'no comma')    ))    +','            ;Rate
        000570    :         Write File Line    : '     "' + "Stcd"            + '"' + ': "'+ $Stcd             + '"'                ;Stcd
        000575    :         Write File Line    : '  },'
        000580    :     End Walk
    
    
    
        000585    : Walk :ItemList
        000590    :        Write File Line    : '  "' + "Item List" + '"' + ': ['
        000610    :        Write File Line    : '    {'
        000620    :        Write File Line    : '     "' + "SlNo"                 + '"' + ': "'+$SlNo                    + '",'                             ;Item Name
        000630    :        Write File Line    : '     "' + "PrdDesc"                 + '"' + ': "'+$PrdDesc                 + '",'                         ;Item Desc
        000640    :        Write File Line    : '     "' + "IsServc"                 + '"' + ': "'+$IsServc                + '",'                             ;IsServiceItem
        000650    :        Write File Line    : '     "' + "HsnCd"                 + '"' + ': "'+$HsnCd                 + '",'                           ;HSN Code
        000660    :        Write File Line    : '     "' + "Barcde"                 + '"' + ': "'+$Barcde                + '",'                     ;Bar Code
        000670    :        Write File Line    : '     "' + "Qty"                     + '"' + ':  '+ (If $$Isempty:$Qty Then "0" Else $$RemoveBrackets:($$string:($Qty:'no comma')    ))    +','            ;Rate
        000680    :        Write File Line    : '     "' + "FreeQty"                 + '"' + ':  '+ (If $$Isempty:$FreeQty Then "0"     Else $$RemoveBrackets:($$string:($FreeQty:'no comma')    ))    +','    ;Rate
        000690    :        Write File Line    : '     "' + "Unit"                 + '"' + ': "'+$Unit                    + '",'                             ;Unit
        000700    :        Write File Line    : '     "' + "UnitPrice"            + '"' + ':  '+ (If $$Isempty:$UniPrice      Then "0"     Else $$RemoveBrackets:($$string:($UniPrice:'no comma')    ))    +','    ;Rate
        000710    :        Write File Line    : '     "' + "TotAmt"                 + '"' + ':  '+ (If $$Isempty:$TotAmt      Then "0"    Else $$RemoveBrackets:($$string:($TotAmt:'no comma')    ))    +','
        000720    :        Write File Line    : '     "' + "Discount"             + '"' + ':  '+ (If $$Isempty:$Discount     Then "0"    Else $$RemoveBrackets:($$string:($Discount:'no comma')    ))    +','
        000730    :        Write File Line    : '     "' + "PreTaxVal"            + '"' + ':  '+ (If $$Isempty:$PreTaxVal     Then "0"    Else $$RemoveBrackets:($$string:($PreTaxVal:'no comma')    ))    +','
        000740    :        Write File Line    : '     "' + "AssAmt"                 + '"' + ':  '+ (If $$Isempty:$AssAmt     Then "0"    Else $$RemoveBrackets:($$string:($AssAmt:'no comma')    ))    +','
        000750    :        Write File Line    : '     "' + "GSTRt"                 + '"' + ':  '+ (If $$Isempty:$GSTRt      Then "0"    Else $$RemoveBrackets:($$string:($GSTRt:'no comma')    ))    +','
        000760    :        Write File Line    : '     "' + "IGSTAmt"                 + '"' + ':  '+ (If $$Isempty:$IGSTAmt     Then "0"    Else $$RemoveBrackets:($$string:($IGSTAmt:'no comma')    ))    +','
        000770    :        Write File Line    : '     "' + "CGSTAmt"                 + '"' + ':  '+ (If $$Isempty:$CGSTAmt      Then "0"    Else $$RemoveBrackets:($$string:($CGSTAmt:'no comma')    ))    +','
        000780    :        Write File Line    : '     "' + "SGSTAmt"                 + '"' + ':  '+ (If $$Isempty:$SGSTAmt      Then "0"    Else $$RemoveBrackets:($$string:($SGSTAmt:'no comma')    ))    +','
        000790    :        Write File Line    : '     "' + "CesRt"                 + '"' + ':  '+ (If $$Isempty:$CesRt      Then "0"    Else $$RemoveBrackets:($$string:($CesRt:'no comma')    ))    +','
        000800    :        Write File Line    : '     "' + "CesAmt"                 + '"' + ':  '+ (If $$Isempty:$CesAmt      Then "0"    Else $$RemoveBrackets:($$string:($CesAmt:'no comma')    ))    +','
        000810    :        Write File Line    : '     "' + "CesNonAdvlAmt"         + '"' + ':  '+ (If $$Isempty:$CesNonAdvlAmt  Then "0"        Else $$RemoveBrackets:($$string:($CesNonAdvlAmt:'no comma')    ))    +','
        000820    :        Write File Line    : '     "' + "StateCesRt"            + '"' + ':  '+ (If $$Isempty:$StateCesRt     Then "0"         Else $$RemoveBrackets:($$string:($StateCesRt:'no comma')    ))    +','
        000830    :        Write File Line    : '     "' + "StateCesAmt"             + '"' + ':  '+ (If $$Isempty:$StateCesAmt     Then "0"          Else $$RemoveBrackets:($$string:($StateCesAmt:'no comma')    ))    +','
        000840    :        Write File Line    : '     "' + "StateCesNonAdv1Amt"    + '"' + ':  '+ (If $$Isempty:$StateCesNonAdv1Amt Then "0"    Else $$RemoveBrackets:($$string:($StateCesNonAdv1Amt:'no comma')    ))    +','
        000850    :        Write File Line    : '     "' + "OthChrg"                 + '"' + ':  '+ (If $$Isempty:$OthChrg         Then "0"         Else $$RemoveBrackets:($$string:($OthChrg:'no comma')    ))    +','
        000860    :        Write File Line    : '     "' + "TotItemVal"             + '"' + ':  '+ (If $$Isempty:$TotItemVal     Then "0"         Else $$RemoveBrackets:($$string:($TotItemVal:'no comma')    ))    +','
        000870    :        Write File Line    : '     "' + "OrdLineRef"            + '"' + ': "'+$OrdLineRef             + '",'                    
        000880    :        Write File Line    : '     "' + "OrgCntry"                + '"' + ': "'+$OrgCntry                 + '",'                    
        000885    :        Write File Line    : '     "' + "PrdSlNo"                 + '"' + ': "'+$PrdSlNo                 + '", '                            
    
        000890    :         Walk Collection    :  BchDtls
        000900    :            Write File Line    : '     "' + "BchDtls"                 + '"' + ': {'
        000930    :            Write File Line    : '         "' + "Nm"                 + '"' + ': "'+$Nm         + '",'                        
        000940    :            Write File Line    : '         "' + "ExpDt"             + '"' + ': "'+ ($$DDMMYYYYDateFormat:$ExpDt:"/")    + '",'
        000950    :            Write File Line    : '         "' + "WrDt"              + '"' + ': "'+ ($$DDMMYYYYDateFormat:$WrDt:"/")    + '"'
        000960    :            Write File Line    : '          },'
        000965    :        End Walk
    
        000990    :         Walk Collection    : AttribDtls
        000995    :             Write File Line    : '     "' + "AttribDtls" + '"' + ': ['                        
        001000    :             Write File Line    : '            {'
        001010    :             Write File Line    : '             "' + "Nm"                 + '"' + ': "'+$Nm        + '",'                        
        001020    :             Write File Line    : '         "' + "Val"                 + '"' + ': "'+$Val        + '"'                                                    
        001030    :             Write File Line    : '        }'
        001040    :             Write File Line    : '         ]'
        001050    :             Write File Line    : '      }'
        001060    :             Write File Line    : '     ], '
        001065    :        End Walk
    
        001070    :     End Walk
    
        001075    :     Walk :ValDtls
        001080    :         Write File Line    : '     "' + "ValDtls"        + '"' + ': {'
        001085    :         Write File Line    : '     "' + "AssVal"         + '"' + ':  '+ (If $$Isempty:$AssVal  Then "0"        Else $$RemoveBrackets:($$string:($AssVal:'no comma')    ))    +','   
        001090    :         Write File Line    : '     "' + "CgstVal"         + '"' + ':  '+ (If $$Isempty:$CgstVal  Then "0"        Else $$RemoveBrackets:($$string:($CgstVal:'no comma')    ))    +','   
        001100    :         Write File Line    : '     "' + "SgstVal"        + '"' + ':  '+ (If $$Isempty:$SgstVal   Then "0"    Else $$RemoveBrackets:($$string:($SgstVal:'no comma')    ))    +','
        001110    :         Write File Line    : '     "' + "IgstVal"        + '"' + ':  '+ (If $$Isempty:$IgstVal   Then "0"    Else $$RemoveBrackets:($$string:($IgstVal:'no comma')    ))    +','
        001120    :         Write File Line    : '     "' + "CesVal"         + '"' + ':  '+ (If $$Isempty:$CesVal   Then "0"        Else $$RemoveBrackets:($$string:($CesVal:'no comma')    ))    +','    
        001130    :         Write File Line    : '     "' + "StCesVal"     + '"' + ':  '+ (If $$Isempty:$StCesVal  Then "0"    Else $$RemoveBrackets:($$string:($StCesVal:'no comma')    ))    +','
        001140    :         Write File Line    : '     "' + "Discount"      + '"' + ':  '+ (If $$Isempty:$Discount   Then "0"    Else $$RemoveBrackets:($$string:($Discount:'no comma')    ))    +',' 
        001150    :         Write File Line    : '     "' + "OthChrg"         + '"' + ':  '+ (If $$Isempty:$OthChrg       Then "0"    Else $$RemoveBrackets:($$string:($OthChrg:'no comma')    ))    +','    
        001160    :         Write File Line    : '     "' + "RndOffAmt"     + '"' + ':  '+ (If $$Isempty:$RndOffAmt   Then "0"    Else $$RemoveBrackets:($$string:($RndOffAmt:'no comma')    ))    +','
        001170    :         Write File Line    : '     "' + "TotInvVal"     + '"' + ':  '+ (If $$Isempty:$TotInvVal   Then "0"    Else $$RemoveBrackets:($$string:($TotInvVal:'no comma')    ))    +','
        001180    :         Write File Line    : '     "' + "TotInvValFc"  + '"' + ':  '+ (If $$Isempty:$TotInvValFc  Then "0" Else $$RemoveBrackets:($$string:($TotInvValFc:'no comma')    ))+''     
        001190    :         Write File Line    : '      },'
        001195    :     End Walk
    
        001200    :     Walk :PayDtls
        001205    :        Write File Line    : '     "' + "PayDtls"         + '"' + ': {'
        001210    :        Write File Line    : '     "' + "Nm"            + '"' + ': "'+$Nm            + '",'
        001220    :        Write File Line    : '     "' + "AccDet"         + '"' + ': "'+$AccDet         + '",'
        001230    :        Write File Line    : '     "' + "Mode"         + '"' + ': "'+$Mode         + '",'
        001240    :        Write File Line    : '     "' + "FinInsBr"     + '"' + ': "'+$FinInsBr      + '",'
        001250    :        Write File Line    : '     "' + "PayTerm"        + '"' + ': "'+$PayTerm        + '",'
        001260    :        Write File Line    : '     "' + "PayInstr"     + '"' + ': "'+$PayInstr     + '",'
        001270    :        Write File Line    : '     "' + "CrTrn"         + '"' + ': "'+$CrTrn         + '",'
        001280    :        Write File Line    : '     "' + "DirDr"         + '"' + ': "'+$DirDr         + '",'
        001290    :        Write File Line    : '     "' + "CrDay"         + '"' + ':  '+ (If $$Isempty:$CrDay   Then "0" Else $$RemoveBrackets:($$string:($CrDay:'no comma')    ))    +','     
        001300    :        Write File Line    : '     "' + "PaidAmt"         + '"' + ':  '+ (If $$Isempty:$PaidAmt   Then "0" Else $$RemoveBrackets:($$string:($PaidAmt:'no comma')    ))    +','     
        001310    :        Write File Line    : '     "' + "PaymtDue"     + '"' + ':  '+ (If $$Isempty:$PaymtDue    Then "0" Else $$RemoveBrackets:($$string:($PaymtDue:'no comma')    ))    +'' 
        001320    :        Write File Line    : '      },'                                       
        001325    :     End Walk
    
        001350    :     Walk :RefDtls
        001400    :         Write File Line    : '     "' + "RefDtls"         + '"' + ': {'
        001410    :         Write File Line    : '     "' + "InvRm"         + '"' + ': "'+$InvRm + '",'
    
        001415    :         Walk : DocPerdDtls
    
        001420    :             Write File Line    : '     "' + "DocPerdDtls"    + '"' + ': {'
        001430    :             Write File Line    : '     "' + "InvStDt"         + '"' + ': "'+($$DDMMYYYYDateFormat:$InvStDt:"/")    + '",'
        001440    :             Write File Line    : '     "' + "InvEndDt"        + '"' + ': "'+($$DDMMYYYYDateFormat:$InvEndDt:"/")    + '"'
        001445    :             Write File Line    : '      },'
        001450    :         End Walk
    
        001455    :         Walk : PrecDocDtls
        001460    :             Write File Line    : '     "' + "PrecDocDtls" + '"' + ': ['
        001470    :             Write File Line    : '        { '
        001480    :             Write File Line    : '     "' + "InvNo"         + '"' + ': "'+$InvNo         + '",'
        001490    :             Write File Line    : '     "' + "InvDt"        + '"' + ': "'+($$DDMMYYYYDateFormat:$InvDt:"/")    + '",'
        001500    :             Write File Line    : '     "' + "OthRefNo"        + '"' + ': "'+$OthRefNo     + '" '
        001510    :             Write File Line    : '      }'
        001520    :             Write File Line    : '      ],'
        001525    :         End Walk     
    
        001530    :         Walk : ContrDtls
        001535    :             Write File Line    : '     "' + "ContrDtls" + '"' + ': ['
        001540    :             Write File Line    : '        { '
        001550    :             Write File Line    : '     "' + "RecAdvRefr"     + '"' + ': "'+$RecAdvRefr     + '",'
        001560    :             Write File Line    : '     "' + "RecAdvDt"     + '"' + ': "'+($$DDMMYYYYDateFormat:$RecAdvDt:"/")    + '",'
        001570    :             Write File Line    : '     "' + "TendRefr"     + '"' + ': "'+$TendRefr     + '",'
        001580    :             Write File Line    : '     "' + "ContrRefr"     + '"' + ': "'+$ContrRefr     + '",'
        001590    :             Write File Line    : '     "' + "ExtRefr"         + '"' + ': "'+$ExtRefr        + '",'
        001600    :             Write File Line    : '     "' + "ProjRefr"     + '"' + ': "'+$ProjRefr     + '",'
        001610    :             Write File Line    : '     "' + "PORefr"         + '"' + ': "'+$PORefr        + '",'
        001620    :             Write File Line    : '     "' + "PORefDt"         + '"' + ': "'+($$DDMMYYYYDateFormat:$PORefDt:"/")    + '"'
        001630    :             Write File Line    : '        }'
        001640    :             Write File Line    : '       ]'
        001645    :             Write File Line    : '      },'
        001650    :         End Walk
    
        001655    :     End Walk
    
        001660    :     Walk : AddlDocDtls
        001665    :         Write File Line    : '     "' + "AddlDocDtls"     + '"' + ': ['
        001670    :         Write File Line    : '        { '
        001680    :         Write File Line    : '     "' + "Url"             + '"' + ': "'+$Url             + '",'
        001690    :         Write File Line    : '     "' + "Docs"         + '"' + ': "'+$Docs            + '",'
        001700    :         Write File Line    : '     "' + "Info"         + '"' + ': "'+$Info            + '" '
        001710    :         Write File Line    : '        }'
        001720    :         Write File Line    : '       ],'
        001725    :     End Walk
    
        001730    :     Walk : ExpDtls
        001735    :         Write File Line    : '     "' + "ExpDtls"          + '"' + ': {'
        001740    :         Write File Line    : '     "' + "ShipBNo"         + '"' + ': "'+$ShipBNo     + '",'
        001750    :         Write File Line    : '     "' + "ShipBDt"         + '"' + ': "'+($$DDMMYYYYDateFormat:$ShipBDt:"/")    + '",'
        001760    :         Write File Line    : '     "' + "Port"          + '"' + ': "'+$Port        + '",'
        001770    :         Write File Line    : '     "' + "RefClm"          + '"' + ': "'+$RefClm        + '",'
        001780    :         Write File Line    : '     "' + "ForCur"          + '"' + ': "'+$ForCur         + '",'
        001790    :         Write File Line    : '     "' + "CntCode"          + '"' + ': "'+$CntCode     + '",'
        001800    :         Write File Line    : '     "' + "ExpDuty"         + '"' + ': "'+$ExpDuty        + '"  '
        001810    :         Write File Line    : '        },'
        001815    :     End Walk
    
    
        001910    :     Walk : EwbDtls
        002000    :         Write File Line    : '     "' + "EwbDtls"          + '"' + ': {'
        002010    :         Write File Line    : '     "' + "TransId"          + '"' + ': "'+$TransId     + '",'
        002020    :         Write File Line    : '     "' + "TransName"     + '"' + ': "'+$TransName    + '",'
        002030    :         Write File Line    : '     "' + "Distance"      + '"' + ':  '+$Distance     + ' ,'
        002040    :         Write File Line    : '     "' + "TransDocNo"      + '"' + ': "'+$TransDocNo     + '",'
        002050    :         Write File Line    : '     "' + "TransDocDt"     + '"' + ': "'+($$DDMMYYYYDateFormat:$TransDocDt:"/")    + '",'
        002060    :         Write File Line    : '     "' + "VehNo"         + '"' + ': "'+$VehNo        + '",'
        002070    :         Write File Line    : '     "' + "VehType"          + '"' + ': "'+$VehType     + '",'
        002080    :         Write File Line    : '     "' + "TransMode"      + '"' + ': "'+$TransMode     + '"'
        002090    :         Write File Line    : '        }'
        002100    :         Write File Line    : '        }'
        002110    :    End Walk
    
        002120    : End Walk
    
        002300     : CLOSE TARGET FILE
    
    
    
     


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Very Good efforts ....... to yourself and Ria Sharma..........

    Gold Medal for fantastic utility. :);)
     
    Jaydeep Shah and ASHOK like this.


  3. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Ha Ha..
    Members /Viewer don't even give "Likes"
    and you are giving "Gold Medal"...

    :oops::oops:
     
    Jenny and mukesh1984 like this.


  4. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    LOL ......... gave you a LIKE .........

    Forget about likes ........ MOST do not even bother to say thanks or give a positive feedback once their purpose is solved or queries answered. This only makes me add their names to "Ignore in future" list.
     


  5. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    :D:D:D:D:D:D:D:D:D:D:D:D..

    ha ha.. thanks and you are correct ..thanks for feed back
     
    mukesh1984 and TaxOffice like this.


  6. Taufeeq Shaikh

    Taufeeq Shaikh Active Member


    It really takes a great amount of time to develop such a valuable and effort saving tool..... Thinking Out of Box rather than by default availables...

    Keep it Up Devendra Ji....
     
    Devendra_Rawat likes this.


  7. Sanjeev S

    Sanjeev S Active Member


    Great efforts Boss.

    Like is really a small appreciation. This is much more than that.

    Kudos for the systematic efforts.

    Thanks once again.
     
    Devendra_Rawat likes this.


  8. balajimg

    balajimg Active Member


    truely gr8
     
    Devendra_Rawat likes this.


  9. rajiv jaiswal

    rajiv jaiswal Member


    Amazing work. great sir ji
     
    Devendra_Rawat likes this.



  10. Very Nice

    All you guys are really doing great job.
     
    Devendra_Rawat likes this.


  11. Chandresh J Geria

    Chandresh J Geria New Member


    hats off to you both ,good thing is that you have shared your code ,
    good job ..

    Dear admin ,we have to start some reward like option in this blog ,its encouragement to developer ..
     
    Devendra_Rawat likes this.


  12. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Encouragement to Developer is aplenty vide this Forum .... this forum is exactly for that purpose ......

    As for reward like options...... that can be done only if this FORUM turns into a paid FORUM e.g. INR 1000/- per annum. How else would the reward amount be generated. As it is the cost of maintaining this site is increasing year by year.
     
    Jaydeep Shah likes this.


  13. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    To share code or not to share is a Member's prerogative ...... given that many are collectors and leechers ........... and are simply here to collect codes and distribute hacked codes for free or sell in the open market.
     
    Jaydeep Shah likes this.


  14. yacob

    yacob New Member


    superb
     
    Devendra_Rawat likes this.



  15. Excellent that the word and more over a big heart to share the codes and details
     
    Devendra_Rawat likes this.


  16. Jaydeep Shah

    Jaydeep Shah Member


    very very excellent efforts sirjee.......superb
     
    Devendra_Rawat likes this.


  17. Devendra_Rawat

    Devendra_Rawat Well-Known Member

    Last edited: Jan 27, 2021
    mukesh1984 and TaxOffice like this.


  18. Bipin Damania

    Bipin Damania Active Member


    Devandraji
    Thank you for sharing...
    And also thanks to Riaji
     
    Devendra_Rawat likes this.


  19. ROHIT JAISWAR

    ROHIT JAISWAR Member


    Fantastic & Awesome Work Ever in Tally.ERP 9
    Thank you for sharing...
    And also thanks to Riaji
    One Request Please Upload Json File also
     
    Devendra_Rawat likes this.


  20. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Ha ha.. :cool::cool:.. Thoda jyada ho gaya.. :D:D. Thank you very much.
     
    TaxOffice likes this.


  21. Jay kumar tailor

    Jay kumar tailor Well-Known Member


    :D
     


  22. anish

    anish Member


    Thank you so much and appreciate your great effort for making such a useful utility ....... Keep sharing
     


  23. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    @Amit Kamdar surprisingly ... :eek::eek: this code just needs two more likes to make it to the top of Popular Content.. thanks to the complaint made to you..:D:D
     
    Amit Kamdar likes this.


  24. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Influence at the TOP....always helps....... :););):)

    None of my threads --- are on any of the Lists :rolleyes::mad:

    ;);)
     
    Last edited: Apr 22, 2021
    Devendra_Rawat likes this.


  25. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    " Influence at the TOP....always helps....... :););):) ".....
    and now it's on TOP ... in the list.. and Influence at the TOP has helped again.. :D:D:D .. thanks to @love @Samiksha


    "None of my threads --- are on any of the Lists :rolleyes::mad:"... "Isi ko Shastro me "Maya" kaha gaya hai... "Being at the TOP but still not is list of TOPs"
    ;):(
     
    Last edited: Apr 22, 2021
    tejeet and Amit Kamdar like this.


Share This Page