Populate Financial Years of a Company and use in a table

Discussion in 'Free Source Codes' started by Devendra_Rawat, Feb 7, 2019.

    
  1. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Check this code with tally company having data over two or more financial year.. test/example code only


    This codes uses function to create a collection of available financial years for the company

    regards


    Code:
    [#Menu: Gateway of Tally]
    
    Add : Key Item : Before : @@locQuit : RBC AudiT : T : Alter    : RBC Audit
    
    [Report:RBC Audit ]
    
        Form            : RBC Audit
        Object        : Company
    
    [Form: RBC Audit]
     
        Parts       : RBC Audit Title, RBC Audit
        Background  : Light Lily Yellow
        Option     : Small Size Form        : $$RBCSetFinancialYears
    
    [Part: RBC Audit Title]
    
        Lines           : RBC Audit Title
        Border      : Column Titles
    
        [Line: RBC Audit Title]
     
            Use     : RBC Audit
            Local   : Field : Default                   : Style : Small Bold
            Local   : Field : Default                   : Skip  : Yes
            Local   : Field : Default                   : Type  : String
            Local   : Field : Default                   : Delete: Storage
            Local   : Field : Default                   : Lines : 2
            Local   : Field : RBC Sr No                   : Set as: "Sr. No."
            Local   : Field : RBC Fin Year                : Set as: "Financial Year"
            Local   : Field : RBC AlterProg                  : Set as: "Alter Details"
            Local   : Field : RBC Audit Status            : Set as: "Audit Status"
         
            Local   : Field : Default                   : Delete: Inactive
    
    [Part: RBC Audit]
    
        Line        : RBC Audit
        Repeat      : RBC Audit : RBC Audit
        Scroll      : Vertical
        CommonBorder: Yes
        BreakOn     : $$IsSysName:$RbcFinYear
    
        [Line: RBC Audit]
     
            Field       : RBC Sr No , RBC Fin Year ,RBC AlterProg
            Right Field : RBC Audit Status
               Local       : Field : Default   : Style : Small Bold
    
            [Field: RBC Sr No]
         
                Use     : Short Name Field
                Storage : RBCSrNo
                Border  : Thin Left
                Set as    : $$LineNumber
                Skip    : Yes
             
            [Field : RBC Fin Year]
         
                use     : Name Field
                Storage : RbcFinYear
                Border  : Thin Left
                Table    : FinYearTable, Not Applicable
                Show Table: Always
             
            [Field: RBC Audit Status]
         
                Use     : Name Field
                Storage : RbcAuditStatus
                Border  : Thin Left
                Inactive: $$IsSysName:$RbcFinYear
                Format  : $$LocaleString:"No Comma"
             
             [Field : RBC AlterProg]
                Use     : Logical Field
                Table    : YesNoTable
                Show Table: On Blank
                Border  : Thin Left
                Inactive: $$IsSysName:$RbcFinYear
          ;      Sub Form: RBCFormAuditProg : $$Value
             
    
    [System: UDF]
    
        RBC Audit         : Aggregate : 9000
        RBCSrNo            : String    : 9001
        RbcFinYear        : String    : 9002
        RbcAuditStatus    : String    : 9003
     
    [Collection: RBC Audit Coll]
    
        Type     : RBC Audit : Company
        Childof : ##SVCurrentCompany
        Format     : $RBCSrNo, 5
        Format     : $RbcFinYear, 15
        Format     : $RbcAuditStatus, 25
        Title     : "RBC Audit"
    
    
    
     
    [Collection: RBCFinancialYearSrc]
            Data Source            : Variable    : RBCFinancialYears
    
    [Collection: FinYearTable]
            Title                : $$LocaleString:"Financial Years"
            Source Collection    : RBCFinancialYearSrc
            Compute                : FinYear    : $FinYearStart+"-"+$FinYearEnd
            Format                : $FinYear, 20
            Client Only            : Yes
            Filter                : EmptyFinYear
         
    [System: Formula]
            EmptyFinYear        : Not $FinYear = "-"
         
    [System: Variable]
        List Variable: RBCFinancialYears
    
    [Variable: RBCFinancialYears]
     
        Variable: FinYearStart    : String
        Variable: FinYearEnd    : String
    
    
    /*
        This Function is to Set the Financial Years from the Current Company - Year Wise.
    */
    [Function: RBCSetFinancialYears]
    
        Variable    : cvFromYear    : String
        Variable    : cvToYear         : String
        Variable    : KeyIndex        : Number    : 1
     
        Returns        : Logical
     
    
        001    : List Delete Ex:  RBCFinancialYears
     
        005    : Set            : KeyIndex        : 1
     
        010 : For Range : FinYear    : Date : @@BooksFromDate    : @@LastVoucherdate : 1 : "Year"
        015    : List Add Ex:  RBCFinancialYears
        020 :     Set      : cvFromYear  : If ($$MonthOfDate:##FinYear IN (1, 2, 3)) Then ($$YearOfDate:##FinYear- 1) Else $$YearOfDate:##FinYear
        ;025    :    Log    : $$String:##cvFromYear + "---" +$$String:##KeyIndex
        040 :     Set    : RBCFinancialYears[##KeyIndex].FinYearStart: ##cvFromYear
        050    :     Set            : KeyIndex        : ##KeyIndex + 1
        060 : End For
     
        065    : Set            : KeyIndex        : 1
    
        070 : For Range : FinYear    : Date : @@BooksFromDate    : @@LastVoucherdate : 1 : "Year"
        075    : List Add Ex:  RBCFinancialYears
        090 :     Set    : cvToYear   : If ($$MonthOfDate:##FinYear IN (1, 2, 3)) Then $$YearOfDate:##FinYear Else ($$YearOfDate:##FinYear + 1)
       ; 095    :    Log    :$$String:##cvToYear + "---" +$$String:##KeyIndex
        100 :     Set    : RBCFinancialYears[##KeyIndex].FinYearEnd:##cvToYear
        110    :     Set            : KeyIndex        : ##KeyIndex + 1
        120 : End For
     
        130    : Return        : True
    
    
    ;; End-of-File
    
    
    
     

    Attached Files:

    Last edited: Feb 8, 2019
    Amit Kamdar likes this.


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Very nice......Is work in progress still ???
     


  3. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Is there any way to eliminate the display in the calculator panel??......render it silent and invisible.!
     


  4. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Just removed the log : in function..to remove logs in calculator paned

    no work in progress .. some body had asked about it .. I tried and then thought it would be helpful form members.. so posted
     
    chintamani likes this.


  5. Ozair Ahmad

    Ozair Ahmad New Member


    Very nice.
     


  6. Chandresh J Geria

    Chandresh J Geria New Member



Share This Page