Saturday 28 May 2022

Import 2A into Tally

 

[#Menu: Gateway of Tally]
  
    Add        : Key Item : Before: @@locQuit : GSTR2A RECO  : F : Menu : GSTR2A
    Key Item: BLANK

   
   
[Menu: GSTR2A]
    Title       : $$LocaleString:"GSTR 2A RECO"
   
    ;Indent        : "Master Imports"
    ;Key Item    : "Item Master"             : i : Execute    : GST Item Import
    ;Key Item    : "Ledger Master"         : l : Execute    : GST Ledger Import
    Item        : BLANK
   
    Indent        : "Imports"
    Item        : BLANK
    Key Item    : "IMPORT GSTR2A"         : 2:alter    : Rbc_Jsn_Options :  NOT $$IsEmpty:$$SelectedCmps
    Item        : BLANK
   




[System: Variable]
    Rbc_jsn_Path     : ""
    Rbc_jsn_File     : ""
    Rbc_jsn_PathFile: ""

[Variable: Rbc_jsn_Path]
    Type: String
    Default: ""
    Persist: Yes

[Variable: Rbc_jsn_File]
    Type: String
    Default: ""
    Persist: Yes

[Variable: Rbc_jsn_PathFile]
    Type: String
    Default: ""
    Persist: Yes
    
[Report: Rbc_jsn_Options]
    Form        : Rbc_jsn_Options
    Full Screen    : Yes

[Form: Rbc_jsn_Options]
    No Confirm      : No
    Space Top       : 1
    Space Left      : 1
    Space Right     : 1
    Space Bottom    : 1

    Height        : 30% Page
    Width        : 60% Page
    Vertical Align  : Centre
    Local    : Field    : Rbc_jsn_Import Directory    : Modifies    : Rbc_jsn_Path    : Yes
    Local    : Field    : Rbc_jsn_Import FileName    : Modifies    : Rbc_jsn_File    : Yes
    
    Local: Field: Form SubTitle    : Info    : "Select JSon or Zip file from the List"

    Part: Rbc_jsn_ImportSet
   On    : Form Accept :  Yes:  Call : GSTR2AIMPO
    On    : Form Accept: Yes: Form Accept
[Function    : LogjSonfileName]
    10        : Log: ##Rbc_jsn_PathFile

[Part: Rbc_jsn_ImportSet]
    Parts    : Rbc_jsn_Import Title, Form SubTitle
    Parts    : Rbc_jsn_Import Details
    Vertical     : Yes
    Border            : thin Bottom
[Part: Rbc_jsn_Import Title]
    Lines    : Rbc_jsn_Import, Rbc_jsn_Import Info
    Space Bottom    : 0.20
    Border            : thin Bottom

    [Line: Rbc_jsn_Import]
        Fields          : Form Sub Title
        Local   : Field : Form Sub Title : Info    : $$LocaleString:"RBC JSon file Importing"
            
    [Line: Rbc_jsn_Import Info]
        Field    : Simple Field
  
        Local   : Field : Simple Field : Info       : $$LocaleString:"(Only Zip/JSon (.zip and .json) Format is Supported)"
        Local   : Field : Simple Field : Full Width : Yes
        Local   : Field : Simple Field : Align      : Centre

    
[Part: Rbc_jsn_Import Details]
        Lines    :   Rbc_jsn_Import Directory, Rbc_jsn_Import FileName
        Space Bottom    : 0.10
        Space Bottom    : 0.20
    
    
    [Line: Rbc_jsn_Import Directory]
        Field   : Long Prompt, Rbc_jsn_Import Directory
        Local   : Field : Long Prompt    : Info     : $$LocaleString:"Import Directory :"
        Local   : Field : Long Prompt : Alignment: Left
        Local   : Field : Long Prompt : Width : 40
        Space Bottom    : 0.20
    
    [Line: Rbc_jsn_Import FileName]
        Field   : Long Prompt, Rbc_jsn_Import FileName
        Local   : Field : Long Prompt    : Info     : $$LocaleString:"Import File Name (.zip, .json) :"
        Local   : Field : Long Prompt : Alignment: Left
        Local   : Field : Long Prompt : Width : 40
        Space Bottom    : 0.20
      
    
    [Field: Rbc_jsn_Import Directory]
        Use        : Name Field
        Width   : @@MaxNameWidth
        Set as    : ##Rbc_jsn_Path;##RbcVTopUpExcelPath
        Full Width   : Yes
        Style        : Normal
        Set Always    : Yes
        Storage        : u_RMP_Directory
        Modifies    : Rbc_jsn_Path
        ;Variable    : RbcVTopUpExcelPath
        Validate    : NOT $$IsEmpty:$$Value
    
    [Field: RBC Medium Prompt]
        Use            : Name Field
        Set as        : ""
        Width        : @@NarrWidth
        Full Width    : Yes
        Style        : Normal
        
   [Field: Rbc_jsn_Import FileName]
        Use        : Name Field
        Width   : @@MaxNameWidth
        Full Width   : Yes
        Modifies    : Rbc_jsn_File
        Storage        : u_RMP_FileName
        Style        : Normal
        Set Always    : Yes
        Table        : RbcJSonList of Files
        Show Table : On Blank
        Validate    : NOT $$IsEmpty:$$Value
        On    : Accept:  Yes  : Set:Rbc_jsn_PathFile:##Rbc_jsn_Path+"\"+$$Value
        On     : Accept:  Yes: Field Accept
    

    
[Collection: RbcJSonList of Files]
            Title                : "List of Files : " + ##Rbc_jsn_Path
            Source Collection    : RbcJSon Files Src
            Compute                : Name            : $Name
            Compute                : FileDate        : $LastModifiedDate
            Compute                : FileSize        : $FileSize
            Compute                : IsDirectory    : $IsDirectory

            Format                : $Name, 30
            Format                : $FileDate, 15
            Format              : $FileSize, 8
            Format                : @@FileType
            Sub Title            : "File Name", "System Date", "Size", "Type"
            Full Height            : Yes
            Filter                : RBC_JSonAvailableFormatFilter
            Client Only            : Yes
    
[Collection:RbcJSon Files Src]

    Data Source    : Directory    : ##Rbc_jsn_Path
    Filter        :  RBC_JSonOnlyFilesFilter
    Filter        :  RBC_JSonSelectedFormats
    
    Client Only    : Yes
    Keep Source: Yes

[Function: RbcJSonSupportedFiles]

    Parameter    : InFileName    : String

    0010        : Do If    :  ##InFileName ENDING WITH "zip" OR ##InFileName ENDING WITH "json": Return    : Yes
[System: Formula]

    RBC_JSonOnlyFilesFilter            : NOT $IsDirectory
    RBC_JSonSelectedFormats            :  ($Name ENDING WITH "zip" OR $Name ENDING WITH "json")

    RBC_JSonAvailableFormatFilter    :  If ($Name Containing "~$") Then No Else If ##AutoBRSSFileType = "JSon" +
                                        Then (##IsJSonFormatSupported AND ($Name ENDING WITH "zip" OR $Name ENDING WITH "json")) Else + Yes


[Collection    : INVGSTR2A]
    Data Source    : File JSONZip: ##Rbc_jsn_PathFile
    ;JSON Object Path:b2b:1
    ;JSON Object : GSTR2ATable
    Fetch : *.*
    Client Only:Yes
   


[Object    :GSTR2ATable]
    Collection    :     b2b        : b2bObject

[Object        :    b2bObject]

    Storage    :    ctin    : String ;;;;;;; SUPPLIER GSTN NO
    Storage    :    cfs     : String ;;;;;;;
    Storage    :    cname   : String
    Collection :     inv     : invObject
            
[Object    : invObject]
    
    Storage        :  val        : Amount ;;;;;; INVOICE TOTAL
    Storage        :  inv_typ    : String ;;;;;;; INNOCIE TYPE
    Storage        :  pos        : Number ;;;;;;; STATECODE
    Storage        :  idt        : String ;;;;;;; INVOICE DATE
    Storage        :  rchrg      : String ;;;;;;; IS REVERSE CHARGE
    Storage        :  inum       : String ;;;;;;; INVOICE NUMBER
    Storage        :  chksum     : String ;;;;;;; UNIQUE CODE
    
    Collection     : itms         : itmsObject
            
[Object    : itmsObject]
    Storage    :     num    : Number
    Collection    : itm_det     : itm_detObject
[Object: itm_detObject]
   Storage        :  samt    : Amount ;;;;;; SGST AMOUNT
   Storage        :  rt     : String  ;;;;;; GST RATE
   Storage        :  txval  : Amount    ;;;;;; TAXABLE VALUE
   Storage        :  camt  : Amount    ;;;;;;; CGST AMOUNT
   Storage        :  iamt  : Amount     ;;;;;;; IGST AMOUN
   Storage          :    csamt :Amount        ;;;;;; CESS AMOUNT


[Collection    : GSTR2A_BILLSummary]
    Source Collection: INVGSTR2A
    Title        : "GSTIN-NO LIST"
    Walk         :    b2b
    Compute     : SupplierGSTn          :$ctin
    Compute     : cfs                :$cfs
    Compute     : cname             :$cName
    Compute Var : cvinvcnt             : Number     : $$NumItems
    Compute        :NumberofBills        : $$Number:##cvinvcnt
    Walk        : Inv
    Compute        : VoucherNumber      : $inum
    Compute        : VoucherDate        : $idt
    Compute        :IsReversecharge    :$rchrg
   
    Walk        : itms, itm_det
   
    Compute        : GSTRate            :$$String:$rt
    Compute     : InvoiceTotal         :$$AsAmount:$val
    Compute     :TaxableAmount         :$txval
    Compute     :IGST                :IF $$IsEmpty:$iamt THEN $$AsAmount:"0" ELSE $iamt
    Compute     :CGST                :IF $$IsEmpty:$camt THEN $$AsAmount:"0" ELSE $camt
    Compute     :SGST                :IF $$IsEmpty:$samt THEN $$AsAmount:"0" ELSE $samt
    Compute     :CESS                :IF $$IsEmpty:$csamt THEN $$AsAmount:"0" ELSE $csamt
    Compute        :INVOICETYPE        :"BILL"
   

    Format:$INVOICETYPE
    Format:$CFS
    Format:$PartyName,35
    Format:$SupplierGSTn,10
    Format:$NumberofBills,10
    Format:$VoucherNumber,10
    Format:$VoucherDate,10
    Format:$IsReversecharge,10
    Format:$GSTRate,10
    Format:$InvoiceTotal,10
    Format:$TaxableAmount,10
    Format:$IGST,10
    Format:$CGST,10
    Format:$SGST,10
    Format:$CESS,10
   

[Collection:GSTR2APartywiseSummery]
    Source Collection:GSTR2A_BILLSummary
   
    Fetch        : *.*
   

    By:SupplierGSTn:$SupplierGSTn
    ;By:GSTRATE:$GSTRATE
    By:VoucherNumber:$VoucherNumber
    Sort:@@Default: $SupplierGSTn
   
    Compute:PartyName:$$CollectionFieldByKey:$Name:$SupplierGSTn:RBC_PartyGstnWise
    Aggr Compute:TaxableAmount1:Sum:IF $$IsEmpty:$TaxableAmount THEN $$AsAmount:"0" ELSE  $$AsAmount:$TaxableAmount
    Aggr Compute:IGST1:Sum:IF $$IsEmpty:$IGST THEN $$AsAmount:"0" ELSE $$AsAmount:$IGST
    Aggr Compute:CGST1:Sum:IF $$IsEmpty:$CGST THEN $$AsAmount:"0" ELSE $$AsAmount:$CGST
    Aggr Compute:SGST1:Sum:IF $$IsEmpty:$SGST THEN $$AsAmount:"0" ELSE $$AsAmount:$SGST
    Aggr Compute:CESS1:Sum:IF $$IsEmpty:$CESS THEN $$AsAmount:"0" ELSE $$AsAmount:$CESS
    Compute:TotalVoucherAmt:$TaxableAmount1+$IGST1+$CGST1+$SGST1+$CESS1
    Compute:InvoiceTotal:$InvoiceTotal

    Format:$INVOICETYPE
    Format:$CFS
    Format:$PartyName,35
    Format:$SupplierGSTn,10
    Format:$NumberofBills,10
    Format:$VoucherNumber,10
    Format:$VoucherDate,10
    Format:$IsReversecharge,10
    Format:$$Number:$GSTRate,10
    Format:$InvoiceTotal,10
    Format:$TaxableAmount1,10
    Format:$IGST1,10
    Format:$CGST1,10
    Format:$SGST1,10
    Format:$CESS1,10
   
   

[Collection:GSTR2APartywiserateSummery]
    Source Collection:GSTR2A_BILLSummary
   
    Fetch        : *.*
   

    By:SupplierGSTn:$SupplierGSTn
    By:GSTRATE:$GSTRATE
    ;By:VoucherNumber:$VoucherNumber
    Sort:@@Default: $SupplierGSTn
   
    Compute:PartyName:$$CollectionFieldByKey:$Name:$SupplierGSTn:RBC_PartyGstnWise
    Aggr Compute:TaxableAmount1:Sum:$$AsAmount:$TaxableAmount
    Aggr Compute:IGST1:Sum:$$AsAmount:$IGST
    Aggr Compute:CGST1:Sum:$$AsAmount:$CGST
    Aggr Compute:SGST1:Sum:$$AsAmount:$SGST
    Aggr Compute:CESS1:Sum:$$AsAmount:$CESS
    Compute:TotalVoucherAmt:$TaxableAmount1+$IGST1+$CGST1+$SGST+$CESS
   

    Format:$INVOICETYPE
    Format:$CFS
    Format:$PartyName,35
    Format:$SupplierGSTn,10
    Format:$NumberofBills,10
    Format:$VoucherNumber,10
    Format:$VoucherDate,10
    Format:$IsReversecharge,10
    Format:$$Number:$GSTRate,10
    Format:$InvoiceTotal,10
    Format:$TaxableAmount1,10
    Format:$IGST1,10
    Format:$CGST1,10
    Format:$SGST1,10
    Format:$CESS1,10
    Filter:IspartyGSTnSame
   



[Collection:GSTR2APartywisebILLWISESummery]
    Source Collection:GSTR2A_BILLSummary
   
    Fetch        : *.*
   

    By:SupplierGSTn:$SupplierGSTn
    ;By:GSTRATE:$GSTRATE
    By:VoucherNumber:$VoucherNumber
    Sort:@@Default: $SupplierGSTn
   
    Compute:PartyName:$$CollectionFieldByKey:$Name:$SupplierGSTn:RBC_PartyGstnWise
    Aggr Compute:TaxableAmount1:Sum:$$AsAmount:$TaxableAmount
    Aggr Compute:IGST1:Sum:$$AsAmount:$IGST
    Aggr Compute:CGST1:Sum:$$AsAmount:$CGST
    Aggr Compute:SGST1:Sum:$$AsAmount:$SGST
    Aggr Compute:CESS1:Sum:$$AsAmount:$CESS
    Compute:TotalVoucherAmt:$TaxableAmount1+$IGST1+$CGST1+$SGST+$CESS
   

    Format:$INVOICETYPE
    Format:$CFS
    Format:$PartyName,35
    Format:$SupplierGSTn,10
    Format:$NumberofBills,10
    Format:$VoucherNumber,10
    Format:$VoucherDate,10
    Format:$IsReversecharge,10
    Format:$$Number:$GSTRate,10
    Format:$InvoiceTotal,10
    Format:$TaxableAmount1,10
    Format:$IGST1,10
    Format:$CGST1,10
    Format:$SGST1,10
    Format:$CESS1,10
    Filter:IspartyGSTnSame
   

[Collection:GSTR2ABILLWISERATESummery]
    Source Collection:GSTR2A_BILLSummary
   
    Fetch        : *.*
   

    By:SupplierGSTn:$SupplierGSTn
    By:GSTRATE:$GSTRATE
    By:VoucherNumber:$VoucherNumber
    Sort:@@Default: $SupplierGSTn
   
    Compute:PartyName:$$CollectionFieldByKey:$Name:$SupplierGSTn:RBC_PartyGstnWise
    Aggr Compute:TaxableAmount1:Sum:$$AsAmount:$TaxableAmount
    Aggr Compute:IGST1:Sum:$$AsAmount:$IGST
    Aggr Compute:CGST1:Sum:$$AsAmount:$CGST
    Aggr Compute:SGST1:Sum:$$AsAmount:$SGST
    Aggr Compute:CESS1:Sum:$$AsAmount:$CESS
    Compute:TotalVoucherAmt:$TaxableAmount1+$IGST1+$CGST1+$SGST+$CESS
   

    Format:$INVOICETYPE
    Format:$CFS
    Format:$PartyName,35
    Format:$SupplierGSTn,10
    Format:$NumberofBills,10
    Format:$VoucherNumber,10
    Format:$VoucherDate,10
    Format:$IsReversecharge,10
    Format:$$Number:$GSTRate,10
    Format:$InvoiceTotal,10
    Format:$TaxableAmount1,10
    Format:$IGST1,10
    Format:$CGST1,10
    Format:$SGST1,10
    Format:$CESS1,10
    Filter:IsvOUCERNOSame

[Collection    : RBC_PartyGstnWise]
    Type        : Ledger
    ;Child Of    : $$GroupSundryCreditors; Group would be Sundry Debtors for GSTR1
    Fetch        : PartyGSTIN, Name
 
    Format        : $PartyGSTIN, 20
    Format        : $Name, 25

    Search Key    : $PartyGSTIN
    Sort        : @@Default : $PartyGSTIN
    Filter        : RBCnonEmptyGstin
   



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CREDIT NOTE

[System            : Formulae]
    RBCnonEmptyGstin    : Not $$Isempty:$PartyGSTIN
    IspartyGSTnSame: $SupplierGSTn= ##MPIGSTIN
    IsvOUCERNOSame: $VoucherNumber= ##BillNo



[Collection    : CDNGSTR2A]
    Data Source    : File JSONZip: ##Rbc_jsn_PathFile
    ;JSON Object Path:b2b:1
    ;JSON Object : GSTR2ATable
    Fetch : *.*
    Client Only:Yes
   


[Object    :CDNGSTR2ATable]
    Collection    :     cdn        : CDNb2bObject

[Object        :    CDNb2bObject]

    Storage    :    ctin    : String ;;;;;;; SUPPLIER GSTN NO
    Storage    :    cfs     : String ;;;;;;;
    Storage    :    cname   : String
    Collection :     nt     : CDNObject
            
[Object    : CDNObject]
    
    Storage        :  val        : Number ;;;;;; CREDIT NOTE TOTAL
    Storage        :  ntty    : String ;;;;;;; NOTE TYPE
    ;Storage        :  pos        : Number ;;;;;;; STATECODE
    Storage        :  idt        : String ;;;;;;; INVOICE DATE
    Storage            : nt_dt        : String ;;;;;Note Date
    Storage        :  p_gst      : String ;;;;;;; ISPOSTGST
    Storage        :  inum       : String ;;;;;;; INVOICE NUMBER
    Storage           : nt_num:String    ;;;;;Note number
    Storage        :  chksum     : String ;;;;;;; UNIQUE CODE
    
    Collection     : itms         : CDNitmsObject
            
[Object    : CNDitmsObject]
    Storage    :     num    : Number
    Collection    : itms     : CDNitm_detObject
[Object: CNDitm_detObject]
   Storage        :  samt    : Amount ;;;;;; SGST AMOUNT
   Storage        :  rt     : Number  ;;;;;; GST RATE
   Storage        :  txval  : Amount    ;;;;;; TAXABLE VALUE
   Storage        :  camt  : Amount    ;;;;;;; CGST AMOUNT
   Storage        :  iamt  : Amount     ;;;;;;; IGST AMOUN
   Storage          :    csamt :Amount        ;;;;;; CESS AMOUNT


[Collection    : GSTR2A_CDNSummary ]
    Source Collection: CDNGSTR2A
    Title: "GSTIN-NO LIST"
    Walk :    cdn,
    Compute        : SupplierGSTn    :$ctin
    Compute    : cfs    :$cfs
    Compute    : cname :$cName
    Compute Var    : cvinvcnt : Number : $$NumItems
    Compute:NumberofBills: $$Number:##cvinvcnt
    Walk    : nt
    Compute    : VoucherNumber    : $inum
    Compute    : VoucherDate    : $idt
    Compute        :IsReversecharge:$rchrg
    Walk    : itms
    Walk: itm_det
    Compute    : GSTRate    : $rt
 
   Compute : InvoiceTotal     :$val
   Compute :TaxableAmount     :$txval
   Compute :IGST    :$iamt
   Compute :CGST    :$camt
   Compute :SGST    :$samt
   Compute :CESS    :$csamt
    Format:"CREDIT NOTE"
    Format:$SupplierGSTn,10
    Format:$NumberofBills,10
    Format:$VoucherNumber,10
    Format:$VoucherDate,10
    Format:$IsReversecharge,10
    Format:$GSTRate,10
    Format:$InvoiceTotal,10
    Format:$TaxableAmount,10
    Format:$IGST,10
    Format:$CGST,10
    Format:$SGST,10
    Format:$CESS,10
   





   
[Function:PurchaseGVTYP]
    Variable    : ProgressCount        : Number
    Variable      : Counter             : Number
   
    000 : SET : Counter   : 0 
    001 : START PROGRESS  : 1   : "Importing Master" : @@CmpMailName : "Creating Voucher Type ..."
   
   
    042        :            NEW OBJECT            : VOUCHER TYPE
    043      :            Set Value                : Name                     : "GSTR2A"
    044      :           Set Value               : Parent                 : "Purchase"
    050        :            Set Value                : Numbering Method        : "Manual"
    055        :            Set Value                : IsOptional            : "Yes"
    056        :            Set Value                : Prevent Duplicates    : "Yes"
   
    060      :        CREATE TARGET

   
    160      :        CREATE TARGET
   
    180     :                 INCREMENT             : Counter
    190     :                 SHOW PROGRESS             : ##Counter
    200     :     END PROGRESS
    ;210        :    Msg Box: "Ledger Auto Creation !!!":"IGST Ledger Imported Successfully !!!"
    211     :     RETURN






[Function:GSTR2AIMPO]
   
    Variable    : ProgressCount        : Number
    Variable      : Counter             : Number
   
    Variable    : BillNo            : String   
   
    Variable    : MPIGSTIN    : String
    Variable    : MPIDate            : String
    Variable    : MPIRefno            : String
    Variable    : MPIPartyName        : String
    Variable    : MPIPartyState        : String
    variable    : MPI PurhcaseNil    : Amount
    Variable    : MPI Purchase5        : Amount
    Variable    : MPI purchase12    : Amount
    Variable    : MPI purchase18    : Amount
    Variable    : MPI purchase28    : Amount
    Variable    : MPI SGSTINPUT        : Amount
    Variable    : MPI CGSTINPUT        : Amount
    Variable    : MPI iGSTINPUT        : Amount
    Variable    : MPI GrandTotal     : Amount
   

    00 : SET : Counter   : 0 
    10    :IF :$$IsEmpty:$Name:VoucherType:"GSTR2A"
    15    : Call: PurchaseGVTYP
    19    : End If
    ;10: Call:PurchasePartyLedgerCreation
    20 : START PROGRESS  : ($$NumItems:GSTR2APartywiseSummery)   : "Importing GSTR2A" : @@CmpMailName : "Importing GSTR2A ..." ;+ $$NewLine + $$String:($$NumItems:VCHLVExcellVariableBillWise)+$$String:"/"+$$String:##Counter
    30 : WALK COLLECTION : GSTR2APartywiseSummery

    ;;-------------------------------------------------
    ;;Create Party Ledger under Sundry Creditors if party ledger name not found
    39        :    Set: MPIGSTIN:$SupplierGSTn
    40      :       Set             : BillNo         : $VoucherNumber   
    41      :     IF :$$IsEmpty:$PartyName
    42        :            NEW OBJECT            : Ledger
    43      :            Set Value                : Name                     : $SupplierGSTn
    44      :           Set Value               : Parent                 : "Sundry Creditors"
    45        :            Set Value                : GSTRegistrationType    : "Regular"
    46        :            Set Value                : PartyGSTIN            : $SupplierGSTn
    47        :            Set Value                : CountryofResidence    : "India"
    48        :            Set Value                : LedStateName            : If $$IsStatepurchase:$SupplierGSTn then "Maharashtra" else ""
    49        :            Set Value                :IsBillWiseOn            :"No"
    50      :        CREATE TARGET
    51      :       END IF    
    52        : Set  : MPI GrandTotal : @@GrandTotal
    ;53        : Log:"invoice Total- "+$$String:@@GrandTotal;@@GRANDTOTAL
    ;48        : Log: $$String:"Grand Total"+ $$String:##MPIGrandTotal
    ;;-------------------------------------------------
    ;;Basic Info

    81     :     SET                 : SVViewName             : $$SysName:AcctgVchView
   
    83    :     NEW OBJECT        : Voucher
    84    :     SET VALUE        : Date                : $$Date:$VoucherDate
    85    :     SET VALUE        : VoucherTypeName        : "GSTR2A"
    86      :     SET VALUE        : Narration            : "GSTR 2A DETAILS: - PartyName:-"     + $$String:$PartyName + " GSTIN NO.- " + $$String:$SupplierGSTn + " Taxable AMOUNT - " + $$String:$TaxableAmount1 + " CGST AMOUNT - " + $$String:$CGST1 + " SGST AMOUNT - " + $$String:$SGST1 + " IGST AMOUNT - " + $$String:$IGST1 + " CESS AMOUNT - " + $$String:$CESS1 + " INVOICE TOTAL : - " + $$String:@@GRANDTOTAL
    87      :     SET VALUE        : VoucherNumber            : ##BillNo
    88      :     SET VALUE        : Reference            : ##BillNo
    89        :    Set Value        : Isoptional        :"Yes"
    90        :     Set Value        : CFS1                : IF $CFS = "Y" THEN "Yes" else "No"
    91        :     Set Value        : iSREVERSECHARGE1    : if $IsReversecharge = "N" THEN "No" else "Yes"
    ;90        :    Log: $$Date:$SupBillDate
    95      :     SET VALUE        : ReferenceDate :$$Date:$VoucherDate
   
    ;;---------------------------------------------------------
    ;;TO Entry
   
    ;58    : Log: $$String:"InvoiceTotal: "+ $$String:##MPIGrandTotal
    101      :     INSERT COLLECTION OBJECT    : LedgerEntries
    102     :     SET TARGET            : LedgerEntries
    103    :    SET VALUE            : LedgerName        : If $$IsEmpty:$PartyName then $SupplierGSTn else $PartyName
    104    :     SET VALUE            : Amount        : $$AsAmount:@@GrandTotal
    105    :     SET VALUE            : Is Deemed Positive    : "No"
    106    :     SET TARGET            : ..

   

    ;;---------------------------------------------------------
    ;;BY PURCHASE Entry
    107: Walk Collection:GSTR2ABILLWISERATESummery
    P160    :    If: $$IsStatepurchase:$SupplierGSTn
    P170    :     INSERT COLLECTION OBJECT    : LedgerEntries
    P171    :     SET TARGET            : LedgerEntries
    P172    :    SET VALUE            : LedgerName            : @@PURCHASESTATElEDGER;##purchaseimportvar2
    P173    :     SET VALUE            : Amount                : $TaxableAmount
    ;P174    :    Set Value            : GSTOVRDNNATURE        :"Purchase Exempt"
    P176    :     SET VALUE            : Is Deemed Positive    : "Yes"
    P177    :     SET TARGET            : ..
    P178    :    End If
   
    P260    :    If: Not $$IsStatepurchase:$SupplierGSTn
    P270    :     INSERT COLLECTION OBJECT    : LedgerEntries
    P271    :     SET TARGET            : LedgerEntries
    P272    :    SET VALUE            : LedgerName        : @@PURCHASEOMSlEDGER;##purchaseimportvar7
    P273    :     SET VALUE            : Amount        : $TaxableAmount
    ;P274    :    Set Value            : GSTOVRDNNATURE        : if $$IsEmpty:$TIGST and not $$IsEmpty:$TCGST then "Purchase Taxable" Else "Interstate Purchase Taxable"
    P276    :     SET VALUE            : Is Deemed Positive    : "Yes"
    P277    :     SET TARGET            : ..
    p278    :    End If
    108        :    End Walk
    ;;---------------------------------------------------------
    ;;BY Gst Enty
    G160    :    If: $$IsStatepurchase:$SupplierGSTn
    G180    :     INSERT COLLECTION OBJECT    : LedgerEntries
    G181    :     SET TARGET            : LedgerEntries
    G182    :    SET VALUE            : LedgerName        : "CGST INPUT";##purchaseimportvar3
    G183    :     SET VALUE            : Amount        : $CGST1
    G184    :     SET VALUE            : Is Deemed Positive    : "Yes"
    G185    :     SET TARGET            : ..
    G190    : End If
   
   
    G280    :     INSERT COLLECTION OBJECT    : LedgerEntries
    G281    :     SET TARGET            : LedgerEntries
    G282    :    SET VALUE            : LedgerName        : "SGST INPUT";##purchaseimportvar4
    G283    :     SET VALUE            : Amount        : $SGST1
    G284    :     SET VALUE            : Is Deemed Positive    : "Yes"
    G285    :     SET TARGET            : ..
   
    G360    :    If: Not $$IsStatepurchase:$SupplierGSTn
    G380    :     INSERT COLLECTION OBJECT    : LedgerEntries
    G381    :     SET TARGET            : LedgerEntries
    G382    :    SET VALUE            : LedgerName        : "IGST INPUT";##purchaseimportvar5
    G383    :     SET VALUE            : Amount        : $IGST1
    G384    :     SET VALUE            : Is Deemed Positive    : "Yes"
    G385    :     SET TARGET            : ..
    G390    : End If
    ;G480    :     INSERT COLLECTION OBJECT    : LedgerEntries
    ;G481    :     SET TARGET            : LedgerEntries
    ;G482    :    SET VALUE            : LedgerName        : "ROUND";##purchaseimportvar6
    ;G483    :     SET VALUE            : Amount        : if $$IsNegative:(@@RoundValue) then @@RoundValue1 else @@RoundValue
    ;G484    :     SET VALUE            : Is Deemed Positive    :if $$IsNegative:(@@RoundValue) then "Yes" else "No"
    ;G485    :     SET TARGET            : ..
    ;G486    : Log: $$String:"Bill No. "+ $$String:##MPIBillNo + $$String:"Round Value. " +$$String:@@RoundValue
    ;;---------------------------------------------------------   
    109    :     CREATE TARGET   
    ;;---------------------------------------------------------

    110     :       SET VALUE               : PersistedView     : ##SVViewname
    130     :     INCREMENT             : Counter
    140     :     SHOW PROGRESS             : ##Counter
   
    150     :     END WALK
    160     :     END PROGRESS
    155        :    Msg Box: "GSTR2A Imported Successful":"GSTR2A Imported Successful"
    ;170     :     RETURN
   


[Function:IsStatepurchase]
   
    Parameters: P1 :String
    Variable:STATECODE:String
    Return:Logical
   
    ;000:Set:INPUT:$$FileReadCell:##RowIndex:4
    010:Set:STATECODE:$$StringPart:##P1:0:2
    030: Return :@@statesales
   
[System:Formulas]
    statesales: if ##STATECODE = "27" then "Yes" else "No"
    PURCHASESTATElEDGER: IF $GSTRate= "0" THEN "GSTR2A_0" ELSE IF $GSTRate= "5" THEN "GSTR2A_5" ELSE IF $GSTRate= "12" THEN "GSTR2A_12" ELSE IF $GSTRate= "18" THEN "GSTR2A_18" ELSE "GSTR2A_28"
    PURCHASEOMSlEDGER: IF $GSTRate= "0" THEN "GSTR2A_I0" ELSE IF $GSTRate= "5" THEN "GSTR2A_I5" ELSE IF $GSTRate= "12" THEN "GSTR2A_I12" ELSE IF $GSTRate= "18" THEN "GSTR2A_I18" ELSE "GSTR2A_I28"
    GrandTotal :$$AsAmount:($TaxableAmount1+$IGST1+$CGST1+$SGST1+$CESS1)

Friday 27 May 2022

Source Code available TDLs

 1    BAR CODE MODULE


2    LOADING SLIP


3    MULTI GSTIN


4    Outstanding FollowUp


5    Audit Trail Voucher Alter Log History


6    Interest Calculations on Ledger Statement Basis


7    CRM Management


8    Default Invoice Setup


9    Smart Invoice Setup


10    Transport LR Module


11    GST ITC Calimed Date Setup


12    GST Return Period Lock TDL


13    TDS And TCS TDL


14    VoucherType Security And Approval TDL


15    Alternet Qty Modification in Voucher Entry


16    Two Company Compare TDL


17    Prevent Voucher Duplication or BackDate Vouchers


18    Excel to Tally complete Module with Maping


19    Bank Statement Import From Excel


20    Coupan Discount In Invoice


21    HSN GST Tax Details And Setup of Sales on cost Price


22    Depreciation Module Advanced


23    Broker Module (Broker wise commission and outstanding and month wise sales) Detailed


24    Branch Wise Cost center Wise P & L And Balance Sheet with Op Balance


25    Invoice Detailed With qr

27.Selected Ledger Print and Export PDF

28.Restaurant module

 29.Document Management with attachment can be made like gmail

30.Export Vouchers In PDF In Certain Location 

31.Group wise Security

32.Digital signature

30.Finance Module

31.2A and 2B reconciliation - Can Skip Gst claim on the basis of 2B without changing bill date

 All  Source Code @ Rs.20,000 Only call @ 9788932173 , 9962231490

 

DOCUMENT LINKING SYSTEM -Link voucher Scan copy

 [#Part: VCH Narration]
    
    Add : Line    : Attc    
     
;;[!Part: BankDet VCH Narration]
;;Add : Line     : attachfile

;;[#Form: Accounting Voucher]

;;    Add : Button : Open File


[Button : Open File]

    Key    : Ctrl + O
    Action : Exec Command: $Fullpath



[Line: Attc]

    Field: Medium Prompt, Attinfo
    Local: Field: Medium Prompt: Info: "Want to Attach File  ? "
    Space Top: 1

[Field: Attinfo]

    Use    : Logical Field
    Storage : Enableprenarration
    Set as    : If $$IsEmpty:$$Value then "No" else $$Value
    Sub Form: Attchdet Rep    : $$Value = "Yes"


[Report : Attchdet Rep]

    Form : Attchdet Form

[Form : Attchdet Form]

    Parts     : Attchdet Part
    Height  : 15% Page
    Width   : 90% Page
;;    On    : Form Accept : CALL : TSPLSmpRefreshFile
    Add    : Button      : Upload File
    Add     : Button      : Open File

[Part : Attchdet Part]

    Line :  attachfile


[Line: attachfile]  

    Fields  : Short Prompt, Dirpath, Filnam, Savefile
    Local   : Field : Short Prompt : Info: $$LocaleString:"File Path"

[System: UDF]

    Dirpath        : String    : 11101
    Filnam        : String    : 11102
    Fullpath    : String    : 11103
    
[Button : Upload File]

    Key : Ctrl + S
    Action : CopyFile : "H:\TDL" : ##Fullpath
;;    Action : CopyFile : ##MyDstFilePath : ##Fullpath


[Field: Dirpath]

    Use         : Name Field
    Color         : Blue
    Border        : Thin Bottom
    Set As         : ##TSPLSmpDirectoryPath
    Modifies        : TSPLSmpDirectoryPath    : True
        Tooltip            : "Enter the folder path from where the files are to be listed"
;;      Skip Forward    : Yes
    Storage        : Dirpath
    On : sELECT     : Yes : Modifies : #dirpath
    

 [Field: Filnam]
 
         Use          : Name Field
         Table        : List of Files, Not Applicable , End of list
         Set Always   : Yes
         Show Table   : Always
         Align        : Center
         Width        : 40% Page
         Tooltip      : "Select a file from the Table"
     Storage      :    Filnam
     Modifies     : Pathupdate   : True
;;     On : sELECT  : Yes : Modifies : #Filnam

 [Field: savefile]
 
         Use          : Name Field
     Set As          : ($$LocaleString:$Dirpath)+"\"+($$LocaleString:$Filnam)
     Storage      :    Fullpath
;;     Invisible    : Yes
     Set Always   : Yes

 [Field: openfile]
 
         Use          : Name Field
     Set As          : "Open"
     Key           : Open File
;;     Skip           : Yes
     Color        : Black
     Print FG     : Pale Leaf Green
     Border          : TQ
     Width        : 5
    



[Border: TQ]

    Top          : Thick, Double
    Bottom           : Thick, Double
    Left          : Thick, Double
    Right           : Thick, Double


[Collection: List of Files]
 
        Title         : $$LocaleString:"List of Files"
    Data Source   : Directory    : #TSPLSmpDirectoryPath
        Filter          : TSPLSmpTextFiles
        Format        : $Name, 25
    Format        : $FileSize, 15
;;    Format        : $IsReadOnly, 15
    Format        : $LastModifiedDate, 15
    Format        : $LastModifiedTime, 15

[Collection: AttchPath]
    
    Variable      : Filnam
    Filter        : TSPLSmpAttchFiles



[System: Variable]
 
    TSPLSmpDirectoryPath    : "H:\TDL"

;;[System: Variable]

;;    MyDstFilePath        : "D:\TAUFEEQ"
    


[System: Formula]
 
;; Specify the required Directory Path
    TSPL Smp Directory Path  : ##TSPLSmpDirectoryPath
    TSPL Smp File Name       : ##TSPLFilename
;;   TSPL Smp Text Files     : $$TSPLSmpRefreshTable:#TSPLSmpDirectoryPath AND NOT $$IsDirectory:$Name AND (($Name CONTAINS ".txt" OR $Name CONTAINS ".xml" OR $Name CONTAINS ".sdf" OR $Name CONTAINS ".tdl") AND $Name NOT CONTAINS "tdlserver")
     TSPL Smp Text Files     : $$TSPLSmpRefreshTable:#TSPLSmpDirectoryPath
     Filnam              : $$TSPLSmpRefreshfile:#TSPLFilename


;; Dummy Function introduced to Refresh the Table dependent on the Previous
;; Field Value i.e., User Input
[Function: TSPLSmpRefreshTable]
 
    Parameter        : pTempVar    : String
    00    : RETURN    : True
 
[Function: TSPLSmpRefreshFile]
 
    Parameter        : attchfile    : String
    OO    : RETURN    : True



;; Variable declaration to hold the last updated Directory path
[Variable: TSPLSmpDirectoryPath]
 
    Type    : String
    Persist    : Yes

[Variable: Pathupdate]
 
    Type    : String
    Persist    : Yes

Thursday 26 May 2022

Trial Balance with Group within group Name

 

[#Menu: Gateway of Tally]
  
    Add    : Key Item    : Before    : @@locQuit    : Trail Balance with Group Name    : T: Display: IMFRLedReport
    Add     : Key Item :    Before    : @@locQuit :BLANK
  
    Item         : Blank
    Title        : "RBCR Basic Reports"

[Report: IMFRLedReport]
  
    Form    : LedReportForRemote
    Title    : "Basic Report to show Group Name"

    Local    : Collection    : RBCRLedger    : Fetch    : Name, Parent, GParent,Closing Balance

[Form: LedReportForRemote]

    Parts    : LedReportForRemote
    Button: ExportButton, ChangePeriod
  
[Part: LedReportForRemote]

    Lines            : LedReportForRemoteTitle, LedReportForRemoteDetails 
    Repeat            : LedReportForRemoteDetails        : Ledger
    Scroll            : Vertical
    Common Borders    : Yes
    Border            : Thin Bottom

    [Line: LedReportForRemoteTitle]

        Use        : LedReportForRemoteDetails
        Local    : Field    : Default            : Type    : String  
      
        Local    : Field    : Led Name            : Set as: "Ledger Name"
        Local    : Field    : Led Name            : Align: Left
        Local    : Field    : Led Name: Style: Normal Serif Bold
      
        Local    : Field    : ParentName            : Set as: "Parent Name"
        Local    : Field    : ParentName: Align: Left
        Local    : Field    : ParentName: Style: Normal Serif Bold
      
        Local    : Field    : ParentOfName            : Set as: "Parent of Parent"
        Local    : Field    : ParentOfName: Align: Left
        Local    : Field    : ParentOfName: Style: Normal Serif Bold
      
        Local    : Field    : GParentOfName            : Set as: "G Parent of Parent"
        Local    : Field    : GParentOfName: Align: Left
        Local    : Field    : GParentOfName: Style: Normal Serif Bold
      
        Local    : Field    : LedDrClosingBalance: Set as: "Dr Cl Balance"
        Local    : Field    : LedDrClosingBalance: Style: Normal Serif Bold
        Local    : Field    : LedCrClosingBalance: Set as: "Cr Cl Balance"
        Local    : Field    : LedCrClosingBalance: Style: Normal Serif Bold
      
        Border    : Column Titles

    [Line: LedReportForRemoteDetails]

        Fields        : Led Name, ParentName, ParentOfName, GParentOfName
        Right Fields: LedDrClosingBalance, LedCrClosingBalance

        [Field: Led Name]

            Use        : Name Field
            Set as    : $Name
            Style    : Normal Serif
            Align: Left
            Width:    30
          
    [Field: ParentName]

            Use        : Name Field
            Set as    : $Parent
            Style    : Normal Serif
            Align: Left
            Width:    30

[Field: ParentofName]

            Use        : Name Field
            Set as    : $GrandParent
            Style    : Normal Serif
            Align: Left
            Width:    30

[Field: GParentOfName]

            Use        : Name Field
            Set as    : $Parent:Group:$GrandParent
            Style    : Normal Serif
            Align: Left
            Width:    30


        [Field: LedDrClosingBalance]

            Use        : Amount Forex Field
            Set as    : if $$IsDr:$ClosingBalance then $ClosingBalance else 0
        ;    Border    : Thin Left
            Style    : Normal Serif

    [Field: LedCrClosingBalance]

            Use        : Amount Forex Field
            Set as    : IF Not $$Isdr:$ClosingBalance then $ClosingBalance else 0
            ;Border    : Thin Left
            Style    : Normal Serif
          



;; End-of-File

[Collection:RBCRLedger]
    Type: Ledger
    Fetch: Name, Parent, ClosingBalance
  
    Compute: GParent : $Parent:Group:$Parent
    Filter: RBCRZero
    Is ODBC Table: Yes

[System:Formula]
  
RBCRZero : $$FromValue:##SvFromDate:$$ToValue:##SvToDate:$ClosingBalance > 0

Auto Number/Prefix of Ledger Masters created within a particular group

 

[#Form : Group]
  
    Add    : Option    : CrGrp        : ( $$IsGroupSundryDebtors:$Parent OR $$IsGroupSundryDebtors:#MstName) Or  $$IsBelongsTo:$$GroupSundryDebtors
  
[!Form : CrGrp]
  
    Local    : Part    : Grp Details    : Add    : Line    : CrLedCount
  
[Line : Cr Led Count]
  
    Field    : Short Prompt, Cr Led Count
    Local    : Field    : Short Prompt    : Set as    : "Cr Led Count"
    ;Invisible : NO;Yes;(NOT $$IsGroupSundryCreditors:$Parent AND NOT $$IsGroupSundryCreditors:$GrandParent)Or NOT $$InCreateMode
  
[Field : Cr Led Count]
      
    Use            : Number Field
    ;Set as        : $$Value;l1;If $$InCreatemode Then 1 Else $$Value
    Set Always    : Yes;$$InCreateMode
    Storage        : udfCrLedCount
    Skip        : Yes
  
    Set By Condition    : $$InCreateMode    : 1
  
    Invisible    : NOT $$IsGroupSundryDebtors:$GrandParent AND NOT $$IsGroupSundryDebtors:$Parent; Or NOT $$InCreateMode
  
[System    : UDF]
  
    udfCrLedCount    : Number    : 8000
  
[#Object    : Group]
    CrLedCount : $udfCrLedCount
  
[#Report : Ledger]
  
    Add    : Option    : Cr Led    : Yes ;( $$IsGroupSundryDebtors:#MstParent OR $$IsGroupSundryDebtors:$Parent:Group:#MstParent) Or  $$IsBelongsTo:$$GroupSundryDebtors
  
[!Report : Cr Led]
  
    Local    : Form    : Ledger    : Replace    : Part    : MST Led Initial    : RBC MST Led Initial
  
    Local    : Form    : Ledger    : Add    : On    : Form Accept    : Yes    : Call    : IncrLedCount
    Local    : Form    : Ledger    : Add    : On    : Form Accept    : Yes    : Form Accept
  
[#Form : Ledger]
  
    Add    : Option    : CrLed     : Yes ; ( $$IsGroupSundryDebtors:#MstParent OR $$IsGroupSundryDebtors:$Parent:Group:#MstParent) Or  $$IsBelongsTo:$$GroupSundryDebtors
  
[!Form : CrLed]
  
    ;Local    : Part    : MSTLedInitial    : Add        : Line    : Before    : MST Name        : RBC MST Alias
    ;Local    : Part    : MSTLedInitial : Replace    : Line    : MST Name     : RBC MST Name
  
    Replace    : Part    : MST Led Initial    : RBC MST Led Initial
  
    Add    : On    : Form Accept    : Yes    : Call    : IncrLedCount
    Add    : On    : Form Accept    : Yes    : Form Accept
  
    Local    : Field    : MST Parent    : Add    : Modifies    : svCurrentGrp
  
[Variable : svCurrentGrp]
  
    Type    : String
  
[Variable : svCurrentCount]
  
    Type    : Number
  
[System : Variable]
  
    svCurrentGrp
    svCurrentCount
  
[Part : RBC MST Led Initial]
  
    Parts       : RBC MST Basic
    RightPart    : MSTLED OpAmts
    Vertical    : No
      Local        : Part    : RBC MST Basic    : Space Top   : If ##UseLangAliasesInMaster OR ##MSTHasLangAliases then 0 else 0.25
  
[Part : RBC MST Basic]
  
    Option      : RBC MSTAliasMode           : (##UseAliasesInMaster OR ##MSTHasAliases) AND NOT ##UseLangAliasesInMaster AND NOT ##MSTHasLangAliases
    Option      : RBC MSTSimpleMode          : NOT ##UseAliasesInMaster AND NOT ##MSTHasAliases AND NOT ##UseLangAliasesInMaster AND NOT ##MSTHasLangAliases
    Option      : MSTLangAliasMode           : ##UseLangAliasesInMaster OR ##MSTHasLangAliases
  
[!Part : RBC MSTAliasMode]
  
    Object      : LanguageName:First
    Lines       : RBC MST Name, RBC MST Name main, MST Alias
    Repeat      : MST Alias : Name :LanguageName : First
    Height      : 5
    Space Bottom: 0.5
    Break On    : $$IsEmpty:$Name
      
[Line : RBC MST Name]
  
    Use        : Master Name Line
    Fields    : Short Prompt, RBC MST Name
    Invisible    : Not  $$InCreateMode
  
    [Field : RBC MST Name]
        Use    : Name Field
        Invisible    : Not  $$InCreateMode
  
[Line : RBC MST Name main]
  
    Use     : Master Name Line
    Fields  : Short Prompt, MST LangId, RBC MST Name main
  
      
    [Field : RBC MST Name main]

        Use         : Master Name Field
        Set as      : if $$InCreateMode then $$String:@CountFill  + "-" + #RBCMSTName else $$Value
        CountFill    : $$ZeroFill:@Count:3
        Count          : $(Group, #MstParent).CrLedCount
        Set Always    : Yes
        Modifies    : PrevMasterName
        Key         : PrevMasterName
        Invisible    : $$InCreateMode
        Skip        : $$InCreateMode
  
        On            : Accept    : Yes    : Set    : svCurrentCount    :    $(Group, #MstParent).CrLedCount
        On            : Accept    : Yes    : Field Accept
          
  
[!Part : RBC MSTSimpleMode]
  
    Object          : LanguageName:First
    Lines           : RBC MST Name, RBC MST Name main
    Space Bottom    : 0.5    
  
[!Part : RBC MSTLangAliasMode]
  

[Function : IncrLedCount]
  
    ;Object    : Group : ##svCurrentGrp
    Variable    : IncCount : Number
  
  
  
    10    : Log    : "Incrementing Led Count"
    11    : Log    : "Group : " + ##svCurrentGrp
    20    : Set    : IncCount : $(Group, ##svCurrentGrp).CrLedCount
    25    : Log    : $$String:##IncCount
    30    : Set     : IncCount : ##IncCount+1
    35    : Log    : $$String:##IncCount
    40    : Modify Object    : (Group, ##svCurrentGrp).udfCrLedCount[1].udfCrLedCount  : ##IncCount
    45    : Log    : "New Value = " + $$String:$(Group, ##svCurrentGrp).CrLedCount
    50    : Log    : "Value Incremented"

Wednesday 25 May 2022

Lock Voucher Entry on Holiday, Weekly Off

 

[#Menu: Gateway of Tally]
    Add: Button: HoldyBtn
   
[Button: HoldyBtn]

    Title:"My Holiday"
    Key: F7
    Action: Alter: MyHoldyReport



[Report: MyHoldyReport]

    Form            : MyHoldyReport
    Object        : Company

[Form: MyHoldyReport]

    Width       : 50% Screen
    height      : 40% Screen
    Parts       : MyHoldyTitle, MyHoldyTitles, MyHoldy
    Background  : Light Lily Yellow
        Bottom part: Holdypart
;-----------------------------------;

[Part : MyHoldyTitle]
    Line : MyHoldyTitleTitle
    
[Line : MyHoldyTitleTitle]

    Space Bottom : 1
    Field :  Form SubTitle
    Local : Field :Form SubTitle: Info  : " My Holiday Task"
    Local : Field :Form SubTitle: Color : Red
    Local : Field :Form SubTitle: Style : Normal Bold
;-----------------------------------;
[Part: MyHoldyTitles]

    Lines           : MyHoldyTitles
    ;Border      : Column Titles

    [Line: MyHoldyTitles]
   
        Use     : MyHoldy

        Local   : Field : Default : Style       : Normal Bold Italic
        Local   : Field : Default : Skip        : Yes
        Local   : Field : Default : Type        : String
            Local   : Field : Default : Align       : centre
            Local   : Field : Default : Background  : Yellow
          ;  Local   : Field : Default : Color       : Dodger Blue
        Local   : Field : Default : Delete      : Storage
        Local   : Field : Default : Delete      : Inactive

                Local   : Field : CMP SRno    : Set as: "SR No"
        Local   : Field : CMP Date    : Set as: "Date"
       
        Local   : Field : CMP Reason  : Set as: "Reason For Holiday"       
       
                Border  : Column Titles

[Part: MyHoldy]

    Line        : MyHoldy
    Repeat      : MyHoldy : MyHoldy
    Scroll      : Vertical
    CommonBorder: Yes
    BreakOn     : $$IsEmpty:$VDate

    [Line: MyHoldy]
   
        Field       : CMP SRno, CMP Date, CMP Reason
       
       
        Local   : Field : Default : Style       : Normal
                ;Local   : Field : Default : Color       : Sky Blue
                Local   : Field : Default : Background  : White
            Local   : Field : Default : Align       : Centre

            [Field: CMP SRno]
       
            Set as : $$Line
                    Width  : 5
            ;Border  : Thin Left
                       

        [Field: CMP Date]
                        Use     : Uni Date Field
                        Set As     : $VDate
            Storage : VDate
            ;Border  : Thin Left
                        Width   : 20         
                       


        [Field: CMP Reason]
       
            Use     : Name Field
            Storage : VReason
            ;Border  : Thin Left
            Inactive: $$IsEmpty:$VDate           
            Full Width  : Yes                    

;------------------------------------------------;

[part : Holdypart]
Line : Holdypart

[Line : Holdypart]
Field : Simple Prompt, MyHoldyFld

Local: Field: Simple Prompt: Set as : "W e e k l y__o f f"

Local: Field: Simple Prompt: Width     : 24.5
Local: Field: Simple Prompt: Style     : Normal Bold Italic
Local: Field: Simple Prompt: Align     : Left
;Local: Field: Simple Prompt: Border    : Thin  Bottom
Local: Field: Simple Prompt: Color     :  Blue
;Local: Field: Simple Prompt: Background: Light Grey

[Field: MyHoldyFld]

    Use         : Name Field
        Width  : 16
        Style       : Normal
        Table       : Holdyweek, End of List       
        scroll        : Vertical       
        Show table  : Always
        Align       : Center
        Border      : Thin  Box
        Background: Light Grey
        Storage : Voffday   

[Table : Holdyweek]

    Title        : "Weekday List"
    List Name     : $$LocaleString:"Sunday", $$LocaleString:"Monday", $$LocaleString:"Tuesday", $$LocaleString:"Wednesday", $$LocaleString:"Thursday", $$LocaleString:"Friday", $$LocaleString:"Saturday"
    Format        : $Name,15
    Client Only    : Yes       

[System: UDF]

       MyHoldy         : Aggregate : 19000
      VSrNo            : Number    : 19001
      VDate            : Date      : 19002
      Vreason        : String    : 19003

[System: UDF]
      Voffday        : String    : 20000

[System: Variables]
    svReasonForBloack :""

[Variable: svReasonForBloack]
    Type: String
    Default: ""
    Persistent: No
   
[#Object: Company]
    vhdoffday : $$String:$vOffDay

[Collection    : RbcBlockeDaysList]
    Type: MyHoldy : Company
    Child Of: #SvCurrentCompany
    Format    : $vSrNo,5
    Format    : $vDate, 10
    Format    : $vReason, 25
   
    Title:  : "Blocked Days"
   

[Function: RbcFindBlockedDay]

    Variable    : IsDayBlocked : Logical: False
    Parameter    : pDateAsked    : date
    Returns        : Logical
   
    005    : Walk Collection: RbcBlockeDaysList
   
    010 : If: (##pDateAsked = $vDate) Or ($$DayOfWeek:##pDateAsked =$vOffday:Company:##SVCurrentCompany)

    020    :     If: (##pDateAsked = $vDate) AND ($$DayOfWeek:##pDateAsked =$vOffday:Company:##SVCurrentCompany)
    030    :         Set: svReasonForBloack : $vReason + " Holiday and also is a Weekly Off :" +$vOffday:Company:##SVCurrentCompany
   
    040    :     Else

    050    :        If: (##pDateAsked = $vDate)
    060    :             Set: svReasonForBloack : $vReason + " Holdiay"
    070    :        ELSE
    080    :            If: ($$DayOfWeek:##pDateAsked =$vOffday:Company:##SVCurrentCompany)
    090    :             Set: svReasonForBloack : "Weekly Off :" +$vOffday:Company:##SVCurrentCompany
    100    :            ENd if
    110    :        END IF
   
    120    :     END if   
    130    :    Set: IsDayBlocked : True
    140    :     Return    : ##IsDayBlocked
    150    :     Log:$$String:##IsDayBlocked
    160    :     END If
    170    : End Walk
    180    : Return        : False

;; End-of-File


;----------------------------------------------------------;

[System : Formula]


       
    ControlBlock    : "Date not allowed !"+$$NewLine+ @@ReasonBlock

    DtIsOpen        : NOT $$RbcFindBlockedDay:$Date ; $Date >= $VDate:Company:##SVCurrentCompany 
    EffDtIsOpen        : NOT $$RbcFindBlockedDay:$EffectiveDate ;$EffectiveDate= >= $VDate:Company:##SVCurrentCompany

    VchrCreation: $$InCreateMode AND NOT @@DtIsOpen
    VchrAlter    : $$InAlterMode AND (NOT @@DtIsOpen OR NOT @@EffDtIsOpen)
   
    ReasonBlock :  ##svReasonForBloack

[#Key   : Delete Line Object]
    Inactive    :  Not @@DtIsOpen

[#Key: Cancel Line Object]
    Inactive    :   Not @@DtIsOpen


[#Key   : Form Delete]
    Inactive    : (NOT $$CanDelete) OR (NOT @@DtIsOpen)

[#Key    : Form Cancel]
    Inactive    : (NOT $$CanCancel) OR (NOT @@DtIsOpen)

[#Form: Voucher]
    Local    : Key     : Form Delete         : Inactive    : NOT @@DtIsOpen
    Local   : Key   : Delete Line Object : Inactive : NOT @@DtIsOpen
    Local   : Key   : Form Cancel         : Inactive : NOT @@DtIsOpen
    Add : Control   : ControlBlock : $$RbcFindBlockedDay:$$Value
    Add : Control    : ControlBlock    : @@VchrAlter


[#Field: Chg SVDate]
    Add: Control     : ControlBlock :  $$RbcFindBlockedDay:$$Value


[#Field: Plain VCH Date]
    Add : Control     : ControlBlock :  $$RbcFindBlockedDay:$$Value
   

[#Line: DSP VchDetail]
    Local   : Key   : Delete Line Object : Inactive : NOT @@DtIsOpen
    Local   : Key   : Cancel Line Object : Inactive : NOT @@DtIsOpen


[#Line: STKVCH NormalDetail]
    Local   : Key   : Delete Line Object : Inactive : NOT @@DtIsOpen
    Local   : Key   : Cancel Line Object : Inactive : NOT @@DtIsOpen

[#Line: STKVCH InTRACKLead]
    Local   : Key   : Delete Line Object : Inactive : NOT @@DtIsOpen
    Local   : Key   : Cancel Line Object : Inactive : NOT @@DtIsOpen


[#Line: STKVCH OutTRACKLead]
    Local   : Key   : Delete Line Object : Inactive : NOT @@DtIsOpen
    Local   : Key   : Delete Line Object : Inactive : NOT @@DtIsOpen
    Local   : Key   : Cancel Line Object : Inactive : NOT @@DtIsOpen

Wednesday 18 May 2022

MULTI INVOICE PRINTING


 

 

 

 

[#Line : VoucherTypeName]
Add : Field : InvisibleVoucherTypeName

[Field: InvisibleVoucherTypeName]
Set As : #VoucherTypeName
Set Always : Yes
Invisible : Yes

;; Multi voucher printing report

[#Report: Multi Voucher Print]
Local : Collection : MSpecific Vouchers of Company : Filter : IsOfSelectedVchNo
Variable : VoucherNumberFrom,VoucherNumberTo

[#Part: MVP Print Common]
Add : Lines : After : SVToDate : VoucherNoFrom, VoucherNoTo
LOCAL: Field: VoucherTypeName : Set as :"SALES"

[Line : VoucherNoFrom]
Field : Medium Prompt,VoucherNoFrom
Local : Field : MediumPrompt :Info : "Voucher No.From:(Zero For All)"
Local : Field : MediumPrompt :Inactive : Not @@DisplayfromTo

[Field : VoucherNoFrom]

Use : NAME FIELD;Number Field
Modifies : VoucherNumberFrom
Inactive : Not @@DisplayfromTo

[Line : VoucherNoTo]

Field : MediumPrompt,VoucherNoTo
Local : Field : MediumPrompt :Info : "Voucher No.To:(Zero For All)"
Local : Field : MediumPrompt :Inactive : Not @@DisplayfromTo

[Field :VoucherNoTo]

Use : NAME FIELD;Number Field
Modifies : VoucherNumberTo
Set always : Yes
Inactive : Not @@DisplayfromTo

[System : Variable]

VoucherNumberFrom : 0
VoucherNumberTo : 0

[Variable : VoucherNumberFrom]

Type : String;NUMBER
volatile : Yes

[Variable :VoucherNumberTo]

Type : STRING;Number
Volatile : Yes

[System :Formula]

IsOfSelectedVchNo : If(@@AutoVchNumbering OR @@ManualVchNumbering) and (##VoucherNumberTo > 0)+
Then ($$IsSysName:##SVVoucherType OR $VoucherTypeName = ##SVVoucherType) +
AND ($$Number:$VoucherNumber >= $$Number:##VoucherNumberFrom +
AND $$Number:$VoucherNumber <=$$Number:##VoucherNumberTo)Else+
If (@@AutoVchNumberingOne OR @@ManualVchNumbering) and (##VoucherNumberTo = 0) Then+
$$IsSysName:##SVVoucherType OR $VoucherTypeName = ##SVVoucherType Else+
$$IsSysName:##SVVoucherType OR $VoucherTypeName = ##SVVoucherType

AutoVchNumberingOne : $NumberingMethod:VoucherType:#InvisibleVoucherTypeName = $$SysName:Automatic
DisplayfromTo : @@AutoVchNumberingOne OR @@ManualVchNumbering
ManualVchNumbering : $$IsSysNameEqual:Manual:$NumberingMethod:VoucherType:##SVVoucherType
;[#Form: Multi Vch Print]
; Delete: Option:MInvoice
; Add : Option: MMc MULTI Invoice : $$IsSales:$Vouchertypename ;;; AND $$Vouchertypename Contains "SALES"

;[!Form: MMc MULTI Invoice]
; Use: MMC INVOICE


/*
Delete: Options
; Delete: Parts
; Delete: Bottom Parts
Add : Parts : InvTit,mmTop,InvNo, mmBody ;;,MMBottom
Add : Bottom Parts : MMBottom
Height : 100% Page
Width : 100% Page
Space Top : 0
Space Bottom: 0
Space Right: 1
Page Break: dsp clpage break,mmcoppagebreak
Local: Part:dsp clpage break : Height: 4
*/