Breaking

23/06/2019

TDL for Total of Selected Lines in Ledger Account

Friends, Today we discuss a TDL which make an automatic total of each selected line in Tally. As you know, You can select any entry by Space Bar without open, but you get total only when you remove selected items.  This TDL help you to make an automatic total on top of the screen. TDL provides you the net balance of selected lines if you select Dr. and Cr. both items, If you select only debit side items then it will show you debit balance, or if you select Credit side items then this TDL show you total of credit balance of ledger.

Following Images show you how this TDL work:

Net Balance when you select Debit and Credit both field


Credit Balance when you select only Credit side


Debit Balance when you select only Debit side


Below is the source code for the TDL. Just copy and paste the source code in notebook file.


Code Start

[#Line : LV Title]
Add : Field : After : LEDMailName : RBCLineselectedTotal

[#Line : DSP VchDetail]
    Option        : RBCSelectedLinesTotalOnFocus    :  ##IsLedgerReport
   
[Field : RJSelectedTitle]
Use : Short Name Field
Set as :"Selected Total :-"
Color : Black


[!Line: RBCSelectedLinesTotalOnFocus] ;Line to Call Selected BillsTotal Function

    On        : Focus    : Yes    : Call    : RBCSelectedLinesTotal

[Function: RBCSelectedLinesTotal]

    0010    : Set    : RBCSelectedLinesTotal    : ($$CollAmtTotal:RBCSelectedLinesColl:$TotalLedVchAmt)
    0011    : Set    : RBCIsLineselected         : (NOT $$IsEmpty:##RBCSelectedLinesTotal)
   
[Field: RBCLineselectedTotal]
           
            Use                : Name Field
            Set as            : if ##RBCIsLineselected AND NOT $$IsEmpty:($$ReportObject:$$CollAmtTotal:RBCSelectedLinesColl:$TotalLedVchAmt) Then $$String:@SelectedTotal + $$String:@SelectedTotalVal Else ""
            Width            : 60
            Align            : Centre
            Invisible        : NOT  ##IsLedgerReport OR NOT $$InDisplayMode
            SelectedTotal    : $$LocaleString:"Entries Selected for : "
            SelectedTotalVal: $$String:##RBCSelectedLinesTotal:"DrCr"

[System: Variables]
    RBcSelectedLinesTotal : 0
    RBCIsLineselected     : NO
   
[Variable: RBcSelectedLinesTotal]

    Type    : Amount
   
[Variable: RBCIsLineselected]
    Type    : Logical

[Collection:RBCSelectedLinesColl]
   
    Data Source    : Report    : Selected
    Fetch        : Name, TotalLedCrVchAmt,TotalLedDrVchAmt, TotalLedVchAmt
    Client Only    : Yes

Code End

No comments:

Post a Comment

Thanks for Visit! Please Visit Again