How to get VoucherTypeName and Amount of the last voucher entered in a ledger.

Discussion in 'Free Source Codes' started by ABDUL AZIZ, Apr 29, 2019.

    
  1. ABDUL AZIZ

    ABDUL AZIZ Member


    Sir,

    No happening anything.....

    Please do something...

    Thanks & Regards
     


  2. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    o_Oo_O

    Though I am not sure what you want

    ScreenAziz2.jpg
    Code:
    [#Menu: Gateway of Tally]
        Add     : Button : MyVoucherTypeBook
       
    [Button: MyVoucherTypeBook]
       
        Title    : "Travel Imp Summary"
        Key        : F5
        Action  : Display Collection : TravelImpLedgerColl
    
    [Collection:TravelImpLedgerColl]
    
        Title        : "List of Travel Imprest Groups"
        Type        : Group
        Align        : Center
        Format        : $Name , 25 
        Format        : $Parent, 15
        Format        : $OpeningBalance, 10
        Format        : $ClosingBalance, 12
        Sub Title    : "Group Name", " Parent", "Open. Balance","Closing Balance"
        Trigger        : TrigerGrpItemColl
        Variable    : VarGrpItem ;; to bridge between collection and display report
        Report        : DisplayGrpItem
        Filter        : GrpFilter
       
        [Report:TrigerGrpItemColl]
           
            Form:TrigerGrpItemColl
            Title: "Select Stock Item Name"
    
            [Form:TrigerGrpItemColl]
               
                Part:TrigerGrpItemColl
                Vertical Align        : Top
                Horizontal Align    : Center
               
                [Part:TrigerGrpItemColl]
                   
                    Line:TrigerGrpItemColl
                   
                    [Line:TrigerGrpItemColl]
                       
                        Field:TrigerGrpItemColl
                       
                        [Field:TrigerGrpItemColl]
                           
                            Table        : TravelImpLedgerColl
                            Modifies    : VarGrpItem
                            Show Table    : Always ;;show the table always
                            Width        : 45
                            Max            : 256 ;;Allows to type 50 charactor, by defualt it is only 1 charactor
                   
    ;;End of TrigerReport
    
    
    ;;Start Final Display Report
    [Report:DisplayGrpItem]
           
            Form        : DisplayGrpItem
            ;Object: Ledger : ##VarGrpItem ;; to bridge between collection and display report
            Title        : "Ledger Under : " + ##VarGrpItem
            Variable     : SVFromDate, SVToDate,
            Set         : SVfromDate    : $$YearOfDate:##SvCurrentdate ;$$Monthstart:##SvCurrentdate
            ;Set         : LedgerName     : ##LedgerName
            Variable     : IsMultiPage, InNewPages,
            Set         : IsMultiPage     : yes
            Set         : InNewPages     : yes
            Set         : SVToDate         : ##SVCurrentdate
               
       
            [Form:DisplayGrpItem]
                Use        : DSP Template
                Part    : HeadingPart, DisplayGrpItem, DevBottPart
                Width    : 100% screen
                Height    : 100% screen
               
    
            [Part: HeadingPart]
                Line        : HeadingPart,
               
    
                [Line:HeadingPart]
                    Field:HeadingPart
                   
                    [Field:HeadingPart]
                       
                        Use            : Name field
                        Set as        : $$LocaleString:"Statement for the period: from " + $$String:##SVFromDate + " to " + $$String:##SVToDate
                        Align         : Center
                        Full Width     : Yes
                        Local        : Style        : Defualt    : Height    : 20
                        Color        : Black
                        Style        : large bold
                        Background    : Light Surf Green
                       
    [Part:DevBottPart]
        Line:DevBottPart
        Background: Dark Green
       
    [Line:DevBottPart]
        Field:DevBottPart
       
    [Field:DevBottPart]
        Info        : "(This is a customised report, developed by Mr. Abdul Aziz)"
        Align         : Center
        Full Width     : Yes
        Local        : Style    :Defualt    :Height    :20
        Color        : Black
        Style        : Tiny Small ;Small Prompt;large bold
        Background    : Light Surf Green;Light Sea Green;CalcBGClr
        ;Border        : Thin Top
        Invisible    : NOT ($$InPrintMode OR $$InExportMode OR $$InMailAction) OR ($$InCreateMode OR $$InAlterMode)
        Invisible    :  ($$InPrintMode OR $$InExportMode OR $$InMailAction) OR ($$InCreateMode OR $$InAlterMode)
    
    
    
    
    
                [Part:DisplayGrpItem]
                    Line            : DisplayGrpItemTitle,DisplayGrpItem
                    Bottom Line        : DisplayGrpItemTotal
                    Repeat            : DisplayGrpItem : MyLedgerColl
                    Scroll            : Vertical
                    Common Border    : Yes
                    Total            : DisplayGrpItem, DisplayGrpItemLastPymtDate, DisplayGrpItemClBalDr, DisplayGrpItemClBalCr
                   
                    [Line:DisplayGrpItemTitle]
                        Use        : DisplayGrpItem   
                        Local    : Field    : DisplayGrpItem                 : Info: "Ledger Name"
                        Local    : Field    : DisplayGrpItemOpBal            : Info: "Opening Balance"
                        Local    : Field    : DisplayGrpItemLastPymtDate    : Info: "Last Payment Date"
                        Local    : Field    : DisplayGrpItemLastPytVchType    : Info: "Last Pymt Vch Type Name"
                        Local    : Field    : DisplayGrpItemLastPayVchAmt    : Info: "Last Paid Amount"
                        Local    : Field    : DisplayGrpItemLastBillDate    : Info: "Last Bill/Rcpt. Date"
                        Local    : Field    : DisplayGrpItemLastBillVchType    : Info: "Last Bill/Rcpt. Vch Type Name"
                        Local    : Field    : DisplayGrpItemLastBillVchAmt    : Info: "Last Bill/Rcpt. Amount"                   
                        Local    : Field    : DisplayGrpItemClBalDr            : Info: "Closing Balance Dr"
                        Local    : Field    : DisplayGrpItemClBalCr            : Info: "Closing Balance Cr"
                        Local    : Field    : Default                        : Style    : Normal Bold
                        Local    : Field    : Default                        : Line    : 0
                        Local    : Field    : Default                        : Align    : Center
                        Border    : Thick Top Bottom
                       
    
                        [Line:DisplayGrpItemTotal]
    
                            use     : DisplayGrpItem
                            Border     : Totals
                            Local     : Field : Default                         : Style     : Normal Bold
                            Local     : Field : Default                         : Type         : String
                            Local     : Field : DisplayGrpItem                : Set As     : "Total"
                            Local     : Field : DisplayGrpItemLastPymtDate     : Set As     : ""
                            Local     : Field : DisplayGrpItemLastBillDate    : Set As     : ""
                            Local     : Field : DisplayGrpItemLastPytVchType    : Set As     : ""
                            Local     : Field : DisplayGrpItemLastVchAmt        : Set As     : ""
                            Local     : Field : DisplayGrpItemClBalDr            : Set As     : $$Total:DisplayGrpItemClBalDr
                            Local     : Field : DisplayGrpItemClBalCr            : Set As     : $$Total:DisplayGrpItemClBalCr
    
    
                    [Line:DisplayGrpItem]
                        Field        : DisplayGrpItem, DisplayGrpItemOpBal, +
                                      DisplayGrpItemLastPymtDate, DisplayGrpItemLastPytVchType, DisplayGrpItemLastPayVchAmt, +
                                      DisplayGrpItemLastBillDate, DisplayGrpItemLastBillVchType, DisplayGrpItemLastBillVchAmt
                        Right Field : DisplayGrpItemClBalDr, DisplayGrpItemClBalCr
                       
                        [Field:DisplayGrpItem]
                            Use        : Name Field   
                            Set as    : $Name
                            Width    : 35
                            Border    : Thin Left
    
    ;;;;;;;PAYMENT SECTION;;;;;;;                       
                        [Field:DisplayGrpItemOpBal]
                            Use        : Amount Field   
                            Set as    : $OpeningBalance
                            Width    : 10
                            Border    : Thin Left
                            Format    : "DrCr"
                           
                        [Field:DisplayGrpItemLastPymtDate]
                            Use        : Uni Date Field   
                            Set as    : $$CollectionField:$Date:1:AllPayVchrs ;$LastVoucherDate
                            Border    : Thin Left Right
                            Width    : 10
    
    
                        [Field:DisplayGrpItemLastPytVchType]
                            Use                : Name Field   
                            Set as            : $$CollectionField:$VoucherTypeName:1:AllPayVchrs
                            Border            : Thin Left Right
                            Width            : 12
                           
                        [Field:DisplayGrpItemLastPayVchAmt]
                            Use                : Amount Field   
                            Set as            : $$CollectionField:$Amount:1:AllPayVchrs
                            Border            : Thin Left Right
                            Width            : 10
                            ;Format    : "DrCr"
       
    
    ;;;;;;;BILL/RECEIPT SECTION;;;;;;;
                        [Field:DisplayGrpItemLastBillDate]
                            Use        : Uni Date Field   
                            Set as    : $$CollectionField:$Date:1:AllJourVchrs ;$LastVoucherDate ;
                            Border    : Thin Left Right
                            Width    : 10
    
    
                        [Field:DisplayGrpItemLastBillVchType]
                            Use                : Name Field   
                            Set as            : $$CollectionField:$VoucherTypeName:1:AllJourVchrs
                            Border            : Thin Left Right
                            Width            : 12
                           
                        [Field:DisplayGrpItemLastBillVchAmt]
                            Use                : Amount Field   
                            Set as            : $$CollectionField:$Amount:1:AllJourVchrs
                            Border            : Thin Left Right
                            Width            : 10
                            ;Format    : "DrCr"
       
    ;;;CLOSING BALANCE;;;;;;;;;;;
                        [Field:DisplayGrpItemClBalDr]
                            Use        : Amount Field   
                            Set as    : If $$IsDr:$ClosingBalance Then $ClosingBalance Else $$AsAmount:0
                            Border    : Thin Left
                            Width    : 12   
                            ;Format    : "DrCr"
    
                        [Field:DisplayGrpItemClBalCr]
                            Use        : Amount Field   
                            Set as    : If NOT $$IsDr:$ClosingBalance Then $ClosingBalance Else $$AsAmount:0
    
                            Border    : Thin Left Right
                            Width    : 12   
    ;Format    : "DrCr"
    ;;;;;;;;;;;;;;;;LEDGER COLL;;;;;;;;;
    [Collection:MyLedgerColl]
        Type    : Ledger
        Filter    : MyLedFilter
        Fetch    : VoucherTypeName, *.*
    
    ;;;;PAYMENT COLL;;;;;;;;;;   
    [Collection:AllVchrsSrc]
        Type                 : Vouchers : Ledger
        Child Of            : #DisplayGrpItem
        ;Belongs To            : Yes
         Fetch               : Amount, Date, VoucherTypeName
        
    [Collection:AllPayVchrs]
        Source Collection    : AllVchrsSrc
        Walk                : LedgerEntries
        Compute                : Date                 : $$Owner:$Date
        Compute                : VoucherTypeName     : $$Owner:$VoucherTypeName
        Compute                : LedgerName        : $LedgerName
        Compute                : Amount            : $Amount
        ;Fetch               : Amount, Date, VoucherTypeName
        Sort                 : Default : -$Date
        Filter                 : MyPayEntries
    
    ;;;;RECEIPT COLL;;;;;;;;;;   
    [Collection:AllRcptVchrs]
        Source Collection    : AllVchrsSrc
        Walk                : LedgerEntries
    
        Compute                : Date                 : $$Owner:$Date
        Compute                : VoucherTypeName     : $$Owner:$VoucherTypeName
        Compute                : LedgerName        : $LedgerName
        Compute                : Amount            : $Amount
        ;Fetch               : Amount, Date, VoucherTypeName
        Sort                 : Default : -$Date
        Filter                 : MyRcptEntries
       
    
    ;;;;JOURNAL COLL;;;;;;;;;;   
    [Collection:AllJourVchrs]
        Source Collection    : AllVchrsSrc
        Walk                : LedgerEntries
        Compute                : Date                 : $$Owner:$Date
        Compute                : VoucherTypeName     : $$Owner:$VoucherTypeName
        Compute                : LedgerName        : $LedgerName
        Compute                : Amount            : $Amount
        Sort                 : Default : -$Date
        Filter                : MyJourEntries
    
    
    [Variable:VarGrpItem]
        Type:String
    
    [System: Variables]
        VarGrpItem    : ""
    
               
    [System: Formulae]
        MyLedFilter     : $ClosingBalance > 0 AND $Parent = ##VarGrpItem
       
        MyPayEntries    :  ($$IsPayment:$VoucherTypeName)   AND $LedgerName =  #DisplayGrpItem ;OR $$IsJournal:$VoucherTypeName)
       
        MyRcptEntries    :  ($$IsReceipt:$VoucherTypeName ) AND $LedgerName =  #DisplayGrpItem ; OR $$IsJournal:$VoucherTypeName)
       
        MyJourEntries    :  ($$IsJournal:$VoucherTypeName) AND $LedgerName =  #DisplayGrpItem ;OR $$IsReceipt:$VoucherTypeName )
       
        GrpFilter        : $Name Contains "Travel"
       
    
     
    amit nema and ABDUL AZIZ like this.


  3. ABDUL AZIZ

    ABDUL AZIZ Member


    Superb!!!!!!!
     


  4. ABDUL AZIZ

    ABDUL AZIZ Member


    Sir,
    One more favour.....

    On press of enter is should open that Selected Ledger Account and show its all vouchers like drill down report.

    Thanks & Regards,
     


  5. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    step by step....you want the full code to be made.............

    Please try doing something on your own, else how will you learn? This is not tough, you can do it on your own.
     
    Devendra_Rawat likes this.


  6. ABDUL AZIZ

    ABDUL AZIZ Member


    Sir,

    Efforts are on, but not getting result..
     


  7. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    This is done by using a key at line level,

    keys are display on enter or alter on enter

    action is display : Report or Alter : Report

    here report is Ledger Voucher

    Variable for report is your Ledger which is acting as a filter in collection i.e. Child of
     


  8. ABDUL AZIZ

    ABDUL AZIZ Member


    Sir,

    I added the below code at line level:

    Key : MyLedger

    Defined the key as below:

    [Key: MyLedger]
    Key : Enter
    Action : Alter : Ledger Voucher

    But on press it is giving error (screenshot is attached)...
    Please have a look ... and guide me where I have mistaken...

    Error message by Tally.JPG
     

    Attached Files:



  9. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Search the report in Developer, it may be "Ledger Vouchers" and not "Ledger Voucher"

    Also use Modify Variable at field of party name, to supply the the variable to report.. I thing variable used is ##ledger or ##svLedger
     


  10. ABDUL AZIZ

    ABDUL AZIZ Member


    Sir,

    I think I am missing something in below code, please correct me.

    [Key: MyLedger]
    Key : Enter
    Action : Alter : Ledger Vouchers : ##SVLedger

    If I remove ##SVLedger from the above line, then it opens the report but blank.
     


  11. sattam

    sattam Active Member


    [Line:DisplayGrpItem]
    Field : DisplayGrpItem, DisplayGrpItemOpBal, +
    DisplayGrpItemLastPymtDate, DisplayGrpItemLastPytVchType, DisplayGrpItemLastPayVchAmt, +
    DisplayGrpItemLastBillDate, DisplayGrpItemLastBillVchType, DisplayGrpItemLastBillVchAmt
    Right Field : DisplayGrpItemClBalDr, DisplayGrpItemClBalCr
    ;Key : LineObjectEnterAlter, LineClickObjectEnterAlter
    ;Key : MyLedger

    [Field:DisplayGrpItem]
    Use : Name Field
    Set as : $Name
    Width : 35
    Border : Thin Left
    Option : Alter on Enter
    Alter : Ledger
    Variable: Ledger Name
    Display : Ledger Vouchers
     
    ABDUL AZIZ likes this.


  12. ABDUL AZIZ

    ABDUL AZIZ Member


    Thank you so much!!!

    I used only the below portion at Field Level and it worked.

    Option : Alter on Enter
    Alter : Ledger
    Variable: Ledger Name
    Display : Ledger Vouchers
     


  13. ABDUL AZIZ

    ABDUL AZIZ Member


    I would like to say my Special Thanks to Garima Sir (I don't know you name sir, so I am addressing you as Garima) who help me a lot and finally I could complete the code.

    Thanks a lot once again to all the experts who help me. :)
     
    Devendra_Rawat likes this.


  14. Jay kumar tailor

    Jay kumar tailor Well-Known Member


    C A devendra Sir Not "Garima sir"
    :cool:
     
    Devendra_Rawat likes this.


  15. ABDUL AZIZ

    ABDUL AZIZ Member


    Thanks!
     
    Devendra_Rawat likes this.


  16. ABDUL AZIZ

    ABDUL AZIZ Member


    Thank you so much Devendra Sir!:)
     
    Devendra_Rawat likes this.



  17. Hello Sattam Sir, How are you ? I need a code for last receipt amount with date show in sundry debtor's closing balance report. please help me
     


Share This Page