Ledger Summary: Useful for Auditors

Discussion in 'Free Source Codes' started by Devendra_Rawat, Jul 23, 2019.

    
  1. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Explode Mode is now summarised voucher number wise

    Count in explode field is a mystry .. right now

    Code:
    
    [#Menu        : Gate Way of Tally]
        Add    :Key Item    : At End : "Summary "    : L    : Display Collection : TransVchLedgerColl: NOT $$IsEmpty:$$SelectedCmps
    
    [Collection : TransVchLedgerColl]
        Use      : Ledger
        Report  : Transact Report
        Trigger  : Ledger Name
        Variable : Ledger Name
    
    [Report : Transact Report]
        Use         : Ledger Vouchers
        Delete: Form
        Add: Form     : TransVchReport
        Variable : Ledger Name
    
    [Form : TransVchReport]
        Use           : DSP Template
        Part       : LV Title, TransVchTitle, TransVchBody
     
        Bottom Part: TransVchSumm
        Background : White, Light Orange
        Width       : 100% Screen
        Height       : 100% Screen
        Local      : Line : LV Title : Local : Field : LV Title    : Local    : Field : Simple Prompt    : Info     : $$LocaleString:"Ledger"
        Local      : Line : LV Title : Local : Field : LV Title    : Local    : Field : Name Field    : Set as : #LedgerName + " - " + $IncomeTaxNumber:Ledger:##LedgerName + " - " + $PartyGSTIN:Ledger:##LedgerName
        Local      : Line : LV Title : Local : Field : LV Title    : Local    : Field : Name Field    : Full Width: Yes
    [Part : TransVchTitle]
        Lines : TransVchTitle
     
    [Line : TransVchTitle]
        Use    : TransVchLedDetail
        Local  : Field : Default          : Type   : String
        ;Local  : Field : Default          : Align  : Centre
        Local  : Field : Default          : Style  : Normal Bold
        Local  : Field : TransVchTypeName : Set as : "Ledger Name"
        Local  : Field : TransVchDrAmt      : Set as : "Debit Amt"
        Local  : Field : TransVchCrAmt      : Set as : "Credit Amt"
        Local  : Field : TransVchCount      : Set as : "No of Entries"
     
        Border : Thin Top Bottom
     
    [Part : TransVchBody]
        Lines            : TransVchLedDetail
        Bottom Lines  : TransVchLedTotal
        Repeat           : TransVchLedDetail : TransVchSummaryColl
        Scroll           : Vertical
        Common Border : Yes
        Total          : TransVchDrAmt, TransVchCrAmt
    
    [Line : TransVchLedDetail]
        Fields          : TransVchTypeName, TransVchCount
        Right Fields : TransVchDrAmt, TransVchCrAmt
        Local          : Field : Default : Style : Normal Bold
        Explode         : TransVchLedExolode  : ##ExplodeFlag
        Space Bottom: .30
     
    [Part    :TransVchLedExolode]
        Line    : TransVchLedExplodeTitle, TransVchLedExplode
        Repeat    : TransVchLedExplode : TransVchEntriesSrc
        Local    : Collection    : TransVchEntriesSrc : By    : LedgerName : $LedgerName
        Local    : Collection    : TransVchEntriesSrc : By    : VoucherNumber : $VoucherNumber
        Local    : Collection    : TransVchEntriesSrc :     Aggr Compute    : DrAmount     : Sum : $DrAmount
        Local    : Collection    : TransVchEntriesSrc :  Aggr Compute      : CrAmount     : Sum : $CrAmount
        Local    : Collection    : TransVchEntriesSrc :  Aggr Compute      : VoucherCount : Sum    : $VoucherCount
    
    [Line : TransVchLedExplodeTitle]
        Fields          : TransMstId, TransVchTypeName, TransVchNumber, TransVchDate,TransVchCount
        Right Fields : TransVchDrAmt, TransVchCrAmt
        Local          : Field : Default : Style : Small Bold Italic
        Local          : Field : Default : Type: String
        Indent         : 6
        Local        : Field    : TransVchTypeName    : Set as: "Voucher Type"
        Local        : Field    : TransVchNumber    : Set as: "Number"
        Local        : Field    : TransVchDate    : Set as: "Date"
        Local        : Field    : TransVchTypeName    : Width    : 12
        Local        : Field    : TransVchDrAmt : Set as: "Dr. Amt."
        Local        : Field    : TransVchCrAmt : Set as: "Cr. Amt."
        Local        : Field    : TransVchCount : Set as: "Count"
    
     
    [Line : TransVchLedExplode]
        Fields          : TransMstId, TransVchTypeName, TransVchNumber, TransVchDate,TransVchCount
        Right Fields : TransVchDrAmt, TransVchCrAmt
        Local          : Field : Default : Style : Small Italic
        Indent         : 6
        Key              : TransAlterOnEnter              ;    : $$IsVoucher AND NOT $IsDeleted
        Local        : Field    : TransVchTypeName    : Set as: $VoucherTypeName
        Local        : Field    : TransVchTypeName    : Width    : 12
        Local        : Field    : TransVchDrAmt : Set as: $DrAmount
        Local        : Field    : TransVchCrAmt : Set as: $CrAmount
        Local        : Field    : TransVchCount : Set as: $VoucherCount
    
    [Key: TransAlterOnEnter]
     
        Key     : Enter
        Action  : Call  : TransVchAlter
        Inactive: (NOT $$InDisplayMode )
    
    [Function: TransVchAlter]
         
        Variable    : VoucherID
        00    : Set    : VoucherID:#TransMstId
        20  : Alter :  Voucher
    
    [Field    : TransMstId]
        Use    : Name Field
        Set as: $$String:"ID:"+$$String:$MasterId
        Invisible    : Yes
        ;Alter      : Voucher        : $$IsVoucher AND NOT $IsDeleted
     
    [Field : TransVchTypeName]
        Use       : Name Field
        Set as : $TransVchLed
        Width    : 40
        Alignment    : Left
    
    [Field    :TransVchDate]
        Use    : Short Date Field
        Alignment: Right
        Width    : 15
        Set as    : $Date
     
    
    [Field : TransVchCount]
        Use       : Number Field
        Set as : $TranVchCount 
        Width    : 15
        Alignment    : Right
    
    [Field : TransVchNumber]
        Use       : Name Field
        Set as : $VoucherNumber
        Width    : 15
        Alignment    : Right
     
    [Field : TransVchDrAmt]
        Use    : Amount Forex Field
        Set as : $TransVchDrAmt
        Border : Thin Left Right
        Width  : 20
        Alignment: Right
    
    [Field : TransVchCrAmt]
        Use       : Amount Forex Field
        Set as : $TransVchCrAmt
        Border : Thin Right
        Width  : 20
        Alignment: Right 
    
    [Line : TransVchLedTotal]
        Use    : TransVchLedDetail
        Local  : Field : Default          : Style  : Normal Bold
        Local  : Field : TransVchTypeName : Set as : "Total"
        Local  : Field : TransVchDrAmt      : Set as : $$Total:TransVchDrAmt
        Local  : Field : TransVchCrAmt      : Set as : $$Total:TransVchCrAmt
        Border : Thin Top Bottom
    
    [Part : TransVchSumm]
        Line : TransVchSumm
     
    [Line : TransVchSumm]
            Field : TransVchSUM1, TransVchSUM2, TransVchSUM3, TransVchSUM4, TransVchSUM5
     
    [Field : TransVchSUM1]
        Field : Name Field
        Local : Field : Name Field : Set as     : " L e d g e r  S u m m a r y"
        Local : Field : Name Field : Background : BtnFocusBG
        Local : Field : Name Field : Width         : 29
        Local : Field : Name Field : Border     : Thin Box
        Local : Field : Name Field : Color        : Red
     
    [Field : TransVchSUM2]
        Field : Name Field, Amount Field
        Local : Field : Name Field : Set as       : "Opening Balance"
        Local : Field : Name Field : Style           : Tiny Bold
        Local : Field : Name Field : Width           : 22.50
        Local : Field : Name Field : Align           : Center
        Local : Field : Name Field : Background   : CloseButtonBG
        Local : Field : Name Field : Color           : White
        Local : Field : Amount Field : Set as     : $TransVchOpBal
        Local : Field : Amount Field : Format     : "Dr,Cr"
        Local : Field : Amount Field : Color      : if $$IsDebit:$TransVchOpBal then "Red" else "Blue"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border     : Thin Box
    
    [Field : TransVchSUM3]
        Field : Name Field, Amount Field
        Local : Field : Name Field   : Set as       : "Debit Totals"
        Local : Field : Name Field   : Style       : Tiny Bold
        Local : Field : Name Field   : Width       : 22.50
        Local : Field : Name Field   : Align       : Center
        Local : Field : Name Field   : Background : CloseButtonBG
        Local : Field : Name Field   : Color       : White
        Local : Field : Amount Field : Set as      : $$Total:TransVchDrAmt/2
        Local : Field : Amount Field : Color       : "Red"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border       : Thin Box
     
    [Field : TransVchSUM4]
        Field : Name Field, Amount Field
        Local : Field : Name Field   : Set as       : "Credit Totals"
        Local : Field : Name Field   : Style       : Tiny Bold
        Local : Field : Name Field   : Width       : 22.50
        Local : Field : Name Field   : Align       : Center
        Local : Field : Name Field   : Background : CloseButtonBG
        Local : Field : Name Field   : Color       : White
        Local : Field : Amount Field : Set as       : $$Total:TransVchCrAmt/2
        Local : Field : Amount Field : Color      : "Blue"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border       : Thin Box
     
    [Field : TransVchSUM5]
        Field : Name Field, Amount Field
        Local : Field : Name Field   : Set as       : "Closing Balance"
        Local : Field : Name Field   : Style       : Tiny Bold
        Local : Field : Name Field   : Width       : 22.50
        Local : Field : Name Field   : Align       : Center
        Local : Field : Name Field   : Background : CloseButtonBG
        Local : Field : Name Field   : Color       : White
        Local : Field : Amount Field : Set as       : $TransVchClBal
        Local : Field : Amount Field : Format       : "Dr,Cr"
        Local : Field : Amount Field : Color      : if  $$IsDebit:$TransVchClBal then "Red" else "Blue"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border       : Thin Box
    
    [Collection : TransVchColl]
        Type        : Vouchers    : Ledger
        Child of    : #LedgerName
     
        ;; Parm var used for Remote Columnar report.
        ParmVar : LedRepName : String : #LedgerName 
        Fetch    :  PersistedView
    
    [Collection : TransVchEntriesSrc]
        Source Collection    : TransVchLedEntriesSrc, TransVchInvEntriesSrc
        Fetch        : LedgerName, Date, VoucherNumber, VoucherTypeName, DrAmount, CrAmount, MasterId
        Filter    : TranVchLedNameFltr
     
    [System: Formulae]
        TranVchLedNameFltr : $LedgerName = #TransVchTypeName
     
    [Collection : TransVchLedEntriesSrc]
        SourceCollection    : TransVchColl
     
        Walk        : Ledger Entries
        Compute        : LedgerName         : $LedgerName
        Compute        : MasterId            : $$Owner:$MasterId
        Compute        : Date                : $$Owner:$Date
        Compute Var    : vVchCount            : Number    : If $VoucherNumber != $$PrevObj:$VoucherNumber then ##vVchCount+1 else 1
        Compute        : VoucherCount        : ##vVchCount
        Compute        : PersistedView     : $$Owner:$PersistedView
        Compute        : VoucherNumber        : $$Owner:$VoucherNumber
        Compute        : VoucherTypeName    : $$Owner:$VoucherTypeName
        Compute        : DrAmount             : If  NOT $$IsDr:$Amount then $Amount else $$Number:"0"         
        Compute        : CrAmount             : If  $$IsDr:$Amount then $Amount else $$Number:"0"
     
        Filter        : TransVchLedFilter
        Sort        : @@Default            : $LedgerName
    
    [Collection : TransVchInvEntriesSrc]
        SourceCollection    : TransVchColl
     
        Walk        : InventoryEntries
        Compute        : LedgerName         : $LedgerName
        Compute Var    : vVchCount            : Number    : If $VoucherNumber != $$PrevObj:$VoucherNumber then ##vVchCount+1 else 1
        Compute        : VoucherCount        : ##vVchCount
        Compute        : Date                : $$Owner:$Date
        Compute        : MasterId            : $$Owner:$MasterId
        Compute        : PersistedView     : $$Owner:$PersistedView
        Compute        : VoucherNumber        : $$Owner:$VoucherNumber
        Compute        : VoucherTypeName    : $$Owner:$VoucherTypeName
        Compute        : DrAmount             : If  Not $$IsDr:$Amount then $Amount else $$Number:"0"         
        Compute        : CrAmount             : If   $$IsDr:$Amount then $Amount else $$Number:"0"
     
        Filter        : TransVchInvFilter
     
     
    [Collection : TransVchSummaryColl]
        Source Collection    : TransVchLedEntriesSrc, TransVchInvEntriesSrc
     
        By                : TransVchLed        : $LedgerName
        Aggr Compute    : TranVchCount        : Sum : $VoucherCount
        Aggr Compute    : TransVchDrAmt     : Sum : $DrAmount
        Aggr Compute    : TransVchCrAmt     : Sum : $CrAmount
        Is ODBC Table    : Yes
     
    [System : Formula]
        TransVchLedFilter :  #LedgerName != $LedgerName; AND $PersistedView  =  $$SysName:AcctgVchView
        TransVchInvFilter :  #LedgerName != $LedgerName AND $PersistedView   = $$SysName:InvVchView ;
        FltrDev              : ($LedgerName = $$TgtObject:$LedgerName)
        TransVchOpBal  : $OpeningBalance:Ledger:#LedgerName
         TransVchClBal  : $ClosingBalance:Ledger:#LedgerName
    
    Thanks to Bipin Damania



    Code:
    
    [#Menu        : Gate Way of Tally]
        Add    :Key Item    : At End : "Summary "    : L    : Display Collection : TransVchLedgerColl: NOT $$IsEmpty:$$SelectedCmps
    
    [Collection : TransVchLedgerColl]
        Use      : Ledger
        Report  : Transact Report
        Trigger  : Ledger Name
        Variable : Ledger Name
    
    [Report : Transact Report]
        Use         : Ledger Vouchers
        Delete: Form
        Add: Form     : TransVchReport
        Variable : Ledger Name
    
    [Form : TransVchReport]
        Use           : DSP Template
        Part       : LV Title, TransVchTitle, TransVchBody
    
        Bottom Part: TransVchSumm
        Background : White, Light Orange
        Width       : 100% Screen
        Height       : 100% Screen
        Local      : Line : LV Title : Local : Field : LV Title    : Local    : Field : Simple Prompt    : Info     : $$LocaleString:"Ledger"
        Local      : Line : LV Title : Local : Field : LV Title    : Local    : Field : Name Field    : Set as : #LedgerName + " - " + $IncomeTaxNumber:Ledger:##LedgerName + " - " + $PartyGSTIN:Ledger:##LedgerName
        Local      : Line : LV Title : Local : Field : LV Title    : Local    : Field : Name Field    : Full Width: Yes
    [Part : TransVchTitle]
        Lines : TransVchTitle
    
    [Line : TransVchTitle]
        Use    : TransVchLedDetail
        Local  : Field : Default          : Type   : String
        ;Local  : Field : Default          : Align  : Centre
        Local  : Field : Default          : Style  : Normal Bold
        Local  : Field : TransVchTypeName : Set as : "Ledger Name"
        Local  : Field : TransVchDrAmt      : Set as : "Debit Amt"
        Local  : Field : TransVchCrAmt      : Set as : "Credit Amt"
        Local  : Field : TransVchCount      : Set as : "No of Entries"
    
        Border : Thin Top Bottom
    
    [Part : TransVchBody]
        Lines            : TransVchLedDetail
        Bottom Lines  : TransVchLedTotal
        Repeat           : TransVchLedDetail : TransVchSummaryColl
        Scroll           : Vertical
        Common Border : Yes
        Total          : TransVchDrAmt, TransVchCrAmt
    
    [Line : TransVchLedDetail]
        Fields          : TransVchTypeName, TransVchCount
        Right Fields : TransVchDrAmt, TransVchCrAmt
        Local          : Field : Default : Style : Normal Bold
        Explode         : TransVchLedExolode  : ##ExplodeFlag
    
    
    [Part    :TransVchLedExolode]
        Line    : TransVchLedExplode
        Repeat    : TransVchLedExplode : TransVchEntriesSrc
    
    [Line : TransVchLedExplode]
        Fields          : TransMstId, TransVchTypeName, TransVchNumber, TransVchDate
        Right Fields : TransVchDrAmt, TransVchCrAmt
        Local          : Field : Default : Style : Small Italic
        Indent         : 6
        Key              : TransAlterOnEnter              ;    : $$IsVoucher AND NOT $IsDeleted
        Local        : Field    : TransVchTypeName    : Set as: $VoucherTypeName
        Local        : Field    : TransVchTypeName    : Width    : 12
        Local        : Field    : TransVchDrAmt : Set as: $DrAmount
        Local        : Field    : TransVchCrAmt : Set as: $CrAmount
    
    [Key: TransAlterOnEnter]
    
        Key     : Enter
        Action  : Call  : TransVchAlter
        Inactive: (NOT $$InDisplayMode )
    
    [Function: TransVchAlter]
    
        Variable    : VoucherID
        00    : Set    : VoucherID:#TransMstId
        20  : Alter :  Voucher
    
    [Field    : TransMstId]
        Use    : Name Field
        Set as: $$String:"ID:"+$$String:$MasterId
        Invisible    : Yes
        ;Alter      : Voucher        : $$IsVoucher AND NOT $IsDeleted
    
    [Field : TransVchTypeName]
        Use       : Name Field
        Set as : $TransVchLed
        Width    : 40
        Alignment    : Left
    
    [Field    :TransVchDate]
        Use    : Short Date Field
        Alignment: Right
        Width    : 15
        Set as    : $Date
    
    
    [Field : TransVchCount]
        Use       : Number Field
        Set as : $TranVchCount
        Width    : 15
        Alignment    : Right
    
    [Field : TransVchNumber]
        Use       : Name Field
        Set as : $VoucherNumber
        Width    : 15
        Alignment    : Right
    
    [Field : TransVchDrAmt]
        Use    : Amount Forex Field
        Set as : $TransVchDrAmt
        Border : Thin Left Right
        Width  : 20
        Alignment: Right
    
    [Field : TransVchCrAmt]
        Use       : Amount Forex Field
        Set as : $TransVchCrAmt
        Border : Thin Right
        Width  : 20
        Alignment: Right
    
    [Line : TransVchLedTotal]
        Use    : TransVchLedDetail
        Local  : Field : Default          : Style  : Normal Bold
        Local  : Field : TransVchTypeName : Set as : "Total"
        Local  : Field : TransVchDrAmt      : Set as : $$Total:TransVchDrAmt
        Local  : Field : TransVchCrAmt      : Set as : $$Total:TransVchCrAmt
        Border : Thin Top Bottom
    
    [Part : TransVchSumm]
        Line : TransVchSumm
    
    [Line : TransVchSumm]
            Field : TransVchSUM1, TransVchSUM2, TransVchSUM3, TransVchSUM4, TransVchSUM5
    
    [Field : TransVchSUM1]
        Field : Name Field
        Local : Field : Name Field : Set as     : " L e d g e r  S u m m a r y"
        Local : Field : Name Field : Background : BtnFocusBG
        Local : Field : Name Field : Width         : 29
        Local : Field : Name Field : Border     : Thin Box
        Local : Field : Name Field : Color        : Red
    
    [Field : TransVchSUM2]
        Field : Name Field, Amount Field
        Local : Field : Name Field : Set as       : "Opening Balance"
        Local : Field : Name Field : Style           : Tiny Bold
        Local : Field : Name Field : Width           : 22.50
        Local : Field : Name Field : Align           : Center
        Local : Field : Name Field : Background   : CloseButtonBG
        Local : Field : Name Field : Color           : White
        Local : Field : Amount Field : Set as     : $TransVchOpBal
        Local : Field : Amount Field : Format     : "Dr,Cr"
        Local : Field : Amount Field : Color      : if $$IsDebit:$TransVchOpBal then "Red" else "Blue"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border     : Thin Box
    
    [Field : TransVchSUM3]
        Field : Name Field, Amount Field
        Local : Field : Name Field   : Set as       : "Debit Totals"
        Local : Field : Name Field   : Style       : Tiny Bold
        Local : Field : Name Field   : Width       : 22.50
        Local : Field : Name Field   : Align       : Center
        Local : Field : Name Field   : Background : CloseButtonBG
        Local : Field : Name Field   : Color       : White
        Local : Field : Amount Field : Set as      : $$Total:TransVchDrAmt/2
        Local : Field : Amount Field : Color       : "Red"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border       : Thin Box
    
    [Field : TransVchSUM4]
        Field : Name Field, Amount Field
        Local : Field : Name Field   : Set as       : "Credit Totals"
        Local : Field : Name Field   : Style       : Tiny Bold
        Local : Field : Name Field   : Width       : 22.50
        Local : Field : Name Field   : Align       : Center
        Local : Field : Name Field   : Background : CloseButtonBG
        Local : Field : Name Field   : Color       : White
        Local : Field : Amount Field : Set as       : $$Total:TransVchCrAmt/2
        Local : Field : Amount Field : Color      : "Blue"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border       : Thin Box
    
    [Field : TransVchSUM5]
        Field : Name Field, Amount Field
        Local : Field : Name Field   : Set as       : "Closing Balance"
        Local : Field : Name Field   : Style       : Tiny Bold
        Local : Field : Name Field   : Width       : 22.50
        Local : Field : Name Field   : Align       : Center
        Local : Field : Name Field   : Background : CloseButtonBG
        Local : Field : Name Field   : Color       : White
        Local : Field : Amount Field : Set as       : $TransVchClBal
        Local : Field : Amount Field : Format       : "Dr,Cr"
        Local : Field : Amount Field : Color      : if  $$IsDebit:$TransVchClBal then "Red" else "Blue"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border       : Thin Box
    
    [Collection : TransVchColl]
        Type        : Vouchers    : Ledger
        Child of    : #LedgerName
    
        ;; Parm var used for Remote Columnar report.
        ParmVar : LedRepName : String : #LedgerName
        Fetch    :  PersistedView
    
    [Collection : TransVchEntriesSrc]
        Source Collection    : TransVchLedEntriesSrc, TransVchInvEntriesSrc
        Fetch        : LedgerName, Date, VoucherNumber, VoucherTypeName, DrAmount, CrAmount, MasterId
        Filter    : TranVchLedNameFltr
    
    [System: Formulae]
        TranVchLedNameFltr : $LedgerName = #TransVchTypeName
    
    [Collection : TransVchLedEntriesSrc]
        SourceCollection    : TransVchColl
    
        Walk        : Ledger Entries
        Compute        : LedgerName         : $LedgerName
        Compute        : MasterId            : $$Owner:$MasterId
        Compute        : Date                : $$Owner:$Date
        Compute Var    : vVchCount            : Number    : If $VoucherNumber != $$PrevObj:$VoucherNumber then ##vVchCount+1 else 1
        Compute        : VoucherCount        : ##vVchCount
        Compute        : PersistedView     : $$Owner:$PersistedView
        Compute        : VoucherNumber        : $$Owner:$VoucherNumber
        Compute        : VoucherTypeName    : $$Owner:$VoucherTypeName
        Compute        : DrAmount             : If  NOT $$IsDr:$Amount then $Amount else $$Number:"0" 
        Compute        : CrAmount             : If  $$IsDr:$Amount then $Amount else $$Number:"0"
    
        Filter        : TransVchLedFilter
        Sort        : @@Default            : $LedgerName
    
    [Collection : TransVchInvEntriesSrc]
        SourceCollection    : TransVchColl
    
        Walk        : InventoryEntries
        Compute        : LedgerName         : $LedgerName
        Compute Var    : vVchCount            : Number    : If $VoucherNumber != $$PrevObj:$VoucherNumber then ##vVchCount+1 else 1
        Compute        : VoucherCount        : ##vVchCount
        Compute        : Date                : $$Owner:$Date
        Compute        : MasterId            : $$Owner:$MasterId
        Compute        : PersistedView     : $$Owner:$PersistedView
        Compute        : VoucherNumber        : $$Owner:$VoucherNumber
        Compute        : VoucherTypeName    : $$Owner:$VoucherTypeName
        Compute        : DrAmount             : If  Not $$IsDr:$Amount then $Amount else $$Number:"0" 
        Compute        : CrAmount             : If   $$IsDr:$Amount then $Amount else $$Number:"0"
    
        Filter        : TransVchInvFilter
    
    
    [Collection : TransVchSummaryColl]
        Source Collection    : TransVchLedEntriesSrc, TransVchInvEntriesSrc
    
        By                : TransVchLed        : $LedgerName
        Aggr Compute    : TranVchCount        : Sum : $VoucherCount
        Aggr Compute    : TransVchDrAmt     : Sum : $DrAmount
        Aggr Compute    : TransVchCrAmt     : Sum : $CrAmount
        Is ODBC Table    : Yes
    
    [System : Formula]
        TransVchLedFilter :  #LedgerName != $LedgerName; AND $PersistedView  =  $$SysName:AcctgVchView
        TransVchInvFilter :  #LedgerName != $LedgerName AND $PersistedView   = $$SysName:InvVchView ;
        FltrDev              : ($LedgerName = $$TgtObject:$LedgerName)
        TransVchOpBal  : $OpeningBalance:Ledger:#LedgerName
         TransVchClBal  : $ClosingBalance:Ledger:#LedgerName
    
    View attachment 5521
    View attachment 5522
     

    Attached Files:

    Last edited: Jul 23, 2019


  2. ONKAR

    ONKAR Active Member



  3. Bipin Damania

    Bipin Damania Active Member



    Garimaji

    Actual credit goes to You Only.

    Thanks
     


  4. sandip kumar

    sandip kumar New Member


    Getting error while printing in detailed
     


  5. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Not yet thought about printing..
     


  6. Jay kumar tailor

    Jay kumar tailor Well-Known Member


    His Name Is C A Devendra.:)
     


  7. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Very good ..... I have made a similar one in my Ledger Statistics.... But I have only the 1) LedgerName, 2) # of appearances and 3) Dr/Cr Amount.

    It is not full, as this one is and also I have not exploded it. That is a good idea. Maybe I will also work on the explode part in my project.

    Explain the mystery.........

    For Ledger with a single entry.... the COUNT shows "zero", instead of 1.
     


  8. Jay kumar tailor

    Jay kumar tailor Well-Known Member


    Now With Change Ledger & Bottom Toolbar Buttons....

    Code:
    [#Menu        : Gate Way of Tally]
        Add    :Key Item    : At End : "Summary "    : L    : Display Collection : TransVchLedgerColl: NOT $$IsEmpty:$$SelectedCmps
    
    [Collection : TransVchLedgerColl]
        Use      : Ledger
        Report  : Transact Report
        Trigger  : Ledger Name
        Variable : Ledger Name
    
    [Report : Transact Report]
        Use         : Ledger Vouchers
        Delete: Form
        Add: Form     : TransVchReport
        Variable : Ledger Name
    
    [Form : TransVchReport]
        Use           : DSP Template
        Part       : LV Title, TransVchTitle, TransVchBody
        Button: ChangeLGR
        Bottom Toolbar Button :  BottomToolBarBtn7,BottomToolBarBtn8, BottomToolBarBtn9,BottomToolBarBtn10, BottomToolBarBtn11
        Bottom Part: TransVchSumm
        Background : White, Light Orange
        Width       : 100% Screen
        Height       : 100% Screen
        Local      : Line : LV Title : Local : Field : LV Title    : Local    : Field : Simple Prompt    : Info     : $$LocaleString:"Ledger"
        Local      : Line : LV Title : Local : Field : LV Title    : Local    : Field : Name Field    : Set as : #LedgerName + " - " + $IncomeTaxNumber:Ledger:##LedgerName + " - " + $PartyGSTIN:Ledger:##LedgerName
        Local      : Line : LV Title : Local : Field : LV Title    : Local    : Field : Name Field    : Full Width: Yes
    
    
    [button: ChangeLGR]
        Key        : F4
        Title     : "Change Ledger"
        Action      : Modify Variables : Ledger Name
    
    
    [Part : TransVchTitle]
        Lines : TransVchTitle
    
    [Line : TransVchTitle]
        Use    : TransVchLedDetail
        Local  : Field : Default          : Type   : String
        ;Local  : Field : Default          : Align  : Centre
        Local  : Field : Default          : Style  : Normal Bold
        Local  : Field : TransVchTypeName : Set as : "Ledger Name"
        Local  : Field : TransVchDrAmt      : Set as : "Debit Amt"
        Local  : Field : TransVchCrAmt      : Set as : "Credit Amt"
        Local  : Field : TransVchCount      : Set as : "No of Entries"
    
        Border : Thin Top Bottom
    
    [Part : TransVchBody]
        Lines            : TransVchLedDetail
        Bottom Lines  : TransVchLedTotal
        Repeat           : TransVchLedDetail : TransVchSummaryColl
        Scroll           : Vertical
        Common Border : Yes
        Total          : TransVchDrAmt, TransVchCrAmt
    
    [Line : TransVchLedDetail]
        Fields          : TransVchTypeName, TransVchCount
        Right Fields : TransVchDrAmt, TransVchCrAmt
        Local          : Field : Default : Style : Normal Bold
        Explode         : TransVchLedExolode  : ##ExplodeFlag
    
    
    [Part    :TransVchLedExolode]
        Line    : TransVchLedExplode
        Repeat    : TransVchLedExplode : TransVchEntriesSrc
    
    [Line : TransVchLedExplode]
        Fields          : TransMstId, TransVchTypeName, TransVchNumber, TransVchDate
        Right Fields : TransVchDrAmt, TransVchCrAmt
        Local          : Field : Default : Style : Small Italic
        Indent         : 6
        Key              : TransAlterOnEnter              ;    : $$IsVoucher AND NOT $IsDeleted
        Local        : Field    : TransVchTypeName    : Set as: $VoucherTypeName
        Local        : Field    : TransVchTypeName    : Width    : 12
        Local        : Field    : TransVchDrAmt : Set as: $DrAmount
        Local        : Field    : TransVchCrAmt : Set as: $CrAmount
    
    [Key: TransAlterOnEnter]
    
        Key     : Enter
        Action  : Call  : TransVchAlter
        Inactive: (NOT $$InDisplayMode )
    
    [Function: TransVchAlter]
    
        Variable    : VoucherID
        00    : Set    : VoucherID:#TransMstId
        20  : Alter :  Voucher
    
    [Field    : TransMstId]
        Use    : Name Field
        Set as: $$String:"ID:"+$$String:$MasterId
        Invisible    : Yes
        ;Alter      : Voucher        : $$IsVoucher AND NOT $IsDeleted
    
    [Field : TransVchTypeName]
        Use       : Name Field
        Set as : $TransVchLed
        Width    : 40
        Alignment    : Left
    
    [Field    :TransVchDate]
        Use    : Short Date Field
        Alignment: Right
        Width    : 15
        Set as    : $Date
    
    
    [Field : TransVchCount]
        Use       : Number Field
        Set as : $TranVchCount
        Width    : 15
        Alignment    : Right
    
    [Field : TransVchNumber]
        Use       : Name Field
        Set as : $VoucherNumber
        Width    : 15
        Alignment    : Right
    
    [Field : TransVchDrAmt]
        Use    : Amount Forex Field
        Set as : $TransVchDrAmt
        Border : Thin Left Right
        Width  : 20
        Alignment: Right
    
    [Field : TransVchCrAmt]
        Use       : Amount Forex Field
        Set as : $TransVchCrAmt
        Border : Thin Right
        Width  : 20
        Alignment: Right
    
    [Line : TransVchLedTotal]
        Use    : TransVchLedDetail
        Local  : Field : Default          : Style  : Normal Bold
        Local  : Field : TransVchTypeName : Set as : "Total"
        Local  : Field : TransVchDrAmt      : Set as : $$Total:TransVchDrAmt
        Local  : Field : TransVchCrAmt      : Set as : $$Total:TransVchCrAmt
        Border : Thin Top Bottom
    
    [Part : TransVchSumm]
        Line : TransVchSumm
    
    [Line : TransVchSumm]
            Field : TransVchSUM1, TransVchSUM2, TransVchSUM3, TransVchSUM4, TransVchSUM5
    
    [Field : TransVchSUM1]
        Field : Name Field
        Local : Field : Name Field : Set as     : " L e d g e r  S u m m a r y"
        Local : Field : Name Field : Background : BtnFocusBG
        Local : Field : Name Field : Width         : 29
        Local : Field : Name Field : Border     : Thin Box
        Local : Field : Name Field : Color        : Red
    
    [Field : TransVchSUM2]
        Field : Name Field, Amount Field
        Local : Field : Name Field : Set as       : "Opening Balance"
        Local : Field : Name Field : Style           : Tiny Bold
        Local : Field : Name Field : Width           : 22.50
        Local : Field : Name Field : Align           : Center
        Local : Field : Name Field : Background   : CloseButtonBG
        Local : Field : Name Field : Color           : White
        Local : Field : Amount Field : Set as     : $TransVchOpBal
        Local : Field : Amount Field : Format     : "Dr,Cr"
        Local : Field : Amount Field : Color      : if $$IsDebit:$TransVchOpBal then "Red" else "Blue"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border     : Thin Box
    
    [Field : TransVchSUM3]
        Field : Name Field, Amount Field
        Local : Field : Name Field   : Set as       : "Debit Totals"
        Local : Field : Name Field   : Style       : Tiny Bold
        Local : Field : Name Field   : Width       : 22.50
        Local : Field : Name Field   : Align       : Center
        Local : Field : Name Field   : Background : CloseButtonBG
        Local : Field : Name Field   : Color       : White
        Local : Field : Amount Field : Set as      : $$Total:TransVchDrAmt/2
        Local : Field : Amount Field : Color       : "Red"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border       : Thin Box
    
    [Field : TransVchSUM4]
        Field : Name Field, Amount Field
        Local : Field : Name Field   : Set as       : "Credit Totals"
        Local : Field : Name Field   : Style       : Tiny Bold
        Local : Field : Name Field   : Width       : 22.50
        Local : Field : Name Field   : Align       : Center
        Local : Field : Name Field   : Background : CloseButtonBG
        Local : Field : Name Field   : Color       : White
        Local : Field : Amount Field : Set as       : $$Total:TransVchCrAmt/2
        Local : Field : Amount Field : Color      : "Blue"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border       : Thin Box
    
    [Field : TransVchSUM5]
        Field : Name Field, Amount Field
        Local : Field : Name Field   : Set as       : "Closing Balance"
        Local : Field : Name Field   : Style       : Tiny Bold
        Local : Field : Name Field   : Width       : 22.50
        Local : Field : Name Field   : Align       : Center
        Local : Field : Name Field   : Background : CloseButtonBG
        Local : Field : Name Field   : Color       : White
        Local : Field : Amount Field : Set as       : $TransVchClBal
        Local : Field : Amount Field : Format       : "Dr,Cr"
        Local : Field : Amount Field : Color      : if  $$IsDebit:$TransVchClBal then "Red" else "Blue"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border       : Thin Box
    
    [Collection : TransVchColl]
        Type        : Vouchers    : Ledger
        Child of    : #LedgerName
    
        ;; Parm var used for Remote Columnar report.
        ParmVar : LedRepName : String : #LedgerName
        Fetch    :  PersistedView
    
    [Collection : TransVchEntriesSrc]
        Source Collection    : TransVchLedEntriesSrc, TransVchInvEntriesSrc
        Fetch        : LedgerName, Date, VoucherNumber, VoucherTypeName, DrAmount, CrAmount, MasterId
        Filter    : TranVchLedNameFltr
    
    [System: Formulae]
        TranVchLedNameFltr : $LedgerName = #TransVchTypeName
    
    [Collection : TransVchLedEntriesSrc]
        SourceCollection    : TransVchColl
    
        Walk        : Ledger Entries
        Compute        : LedgerName         : $LedgerName
        Compute        : MasterId            : $$Owner:$MasterId
        Compute        : Date                : $$Owner:$Date
        Compute Var    : vVchCount            : Number    : If $VoucherNumber != $$PrevObj:$VoucherNumber then ##vVchCount+1 else 1
        Compute        : VoucherCount        : ##vVchCount
        Compute        : PersistedView     : $$Owner:$PersistedView
        Compute        : VoucherNumber        : $$Owner:$VoucherNumber
        Compute        : VoucherTypeName    : $$Owner:$VoucherTypeName
        Compute        : DrAmount             : If  NOT $$IsDr:$Amount then $Amount else $$Number:"0"
        Compute        : CrAmount             : If  $$IsDr:$Amount then $Amount else $$Number:"0"
    
        Filter        : TransVchLedFilter
        Sort        : @@Default            : $LedgerName
    
    [Collection : TransVchInvEntriesSrc]
        SourceCollection    : TransVchColl
    
        Walk        : InventoryEntries
        Compute        : LedgerName         : $LedgerName
        Compute Var    : vVchCount            : Number    : If $VoucherNumber != $$PrevObj:$VoucherNumber then ##vVchCount+1 else 1
        Compute        : VoucherCount        : ##vVchCount
        Compute        : Date                : $$Owner:$Date
        Compute        : MasterId            : $$Owner:$MasterId
        Compute        : PersistedView     : $$Owner:$PersistedView
        Compute        : VoucherNumber        : $$Owner:$VoucherNumber
        Compute        : VoucherTypeName    : $$Owner:$VoucherTypeName
        Compute        : DrAmount             : If  Not $$IsDr:$Amount then $Amount else $$Number:"0"
        Compute        : CrAmount             : If   $$IsDr:$Amount then $Amount else $$Number:"0"
    
        Filter        : TransVchInvFilter
    
    
    [Collection : TransVchSummaryColl]
        Source Collection    : TransVchLedEntriesSrc, TransVchInvEntriesSrc
    
        By                : TransVchLed        : $LedgerName
        Aggr Compute    : TranVchCount        : Sum : $VoucherCount
        Aggr Compute    : TransVchDrAmt     : Sum : $DrAmount
        Aggr Compute    : TransVchCrAmt     : Sum : $CrAmount
        Is ODBC Table    : Yes
    
    [System : Formula]
        TransVchLedFilter :  #LedgerName != $LedgerName; AND $PersistedView  =  $$SysName:AcctgVchView
        TransVchInvFilter :  #LedgerName != $LedgerName AND $PersistedView   = $$SysName:InvVchView ;
        FltrDev              : ($LedgerName = $$TgtObject:$LedgerName)
        TransVchOpBal  : $OpeningBalance:Ledger:#LedgerName
         TransVchClBal  : $ClosingBalance:Ledger:#LedgerName
     
    Last edited: Jul 24, 2019


  9. ASHTAMOORTHY

    ASHTAMOORTHY New Member


    ;> added narration with my little experience..

    Code:
    [#Menu        : Gate Way of Tally]
        Add    :Key Item    : At End : "Summary "    : L    : Display Collection : TransVchLedgerColl: NOT $$IsEmpty:$$SelectedCmps
    [Collection : TransVchLedgerColl]
        Use      : Ledger
        Report  : Transact Report
        Trigger  : Ledger Name
        Variable : Ledger Name
    [Report : Transact Report]
        Use         : Ledger Vouchers
        Delete: Form
        Add: Form     : TransVchReport
        Variable : Ledger Name
    [Form : TransVchReport]
        Use           : DSP Template
        Part       : LV Title, TransVchTitle, TransVchBody
        Bottom Part: TransVchSumm
        Background : White, Light Orange
        Width       : 100% Screen
        Height       : 100% Screen
        Local      : Line : LV Title : Local : Field : LV Title    : Local    : Field : Simple Prompt    : Info     : $$LocaleString:"Ledger"
        Local      : Line : LV Title : Local : Field : LV Title    : Local    : Field : Name Field    : Set as : #LedgerName + " - " + $IncomeTaxNumber:Ledger:##LedgerName + " - " + $PartyGSTIN:Ledger:##LedgerName
        Local      : Line : LV Title : Local : Field : LV Title    : Local    : Field : Name Field    : Full Width: Yes
    [Part : TransVchTitle]
        Lines : TransVchTitle
    [Line : TransVchTitle]
        Use    : TransVchLedDetail
        Local  : Field : Default          : Type   : String
        ;Local  : Field : Default          : Align  : Centre
        Local  : Field : Default          : Style  : Normal Bold
        Local  : Field : TransVchTypeName : Set as : "Ledger Name"
        Local  : Field : TransVchDrAmt      : Set as : "Debit Amt"
        Local  : Field : TransVchCrAmt      : Set as : "Credit Amt"
        Local  : Field : TransVchCount      : Set as : "No of Entries"
        Border : Thin Top Bottom
    [Part : TransVchBody]
        Lines            : TransVchLedDetail
        Bottom Lines  : TransVchLedTotal
        Repeat           : TransVchLedDetail : TransVchSummaryColl
        Scroll           : Vertical
        Common Border : Yes
        Total          : TransVchDrAmt, TransVchCrAmt
    [Line : TransVchLedDetail]
        Fields          : TransVchTypeName, TransVchCount
        Right Fields : TransVchDrAmt, TransVchCrAmt
        Local          : Field : Default : Style : Normal Bold
        Explode         : TransVchLedExolode  : ##ExplodeFlag
        Space Bottom: .30
    [Part    :TransVchLedExolode]
        Line    : TransVchLedExplodeTitle, TransVchLedExplode
        Repeat    : TransVchLedExplode : TransVchEntriesSrc
        Local    : Collection    : TransVchEntriesSrc : By    : LedgerName : $LedgerName
        Local    : Collection    : TransVchEntriesSrc : By    : VoucherNumber : $VoucherNumber
        Local    : Collection    : TransVchEntriesSrc :     Aggr Compute    : DrAmount     : Sum : $DrAmount
        Local    : Collection    : TransVchEntriesSrc :  Aggr Compute      : CrAmount     : Sum : $CrAmount
        Local    : Collection    : TransVchEntriesSrc :  Aggr Compute      : VoucherCount : Sum    : $VoucherCount
    [Line : TransVchLedExplodeTitle]
        Fields          : TransMstId, TransVchTypeName, TransVchNumber, TransVchDate,TransVchCount, Narr
        Right Fields : TransVchDrAmt, TransVchCrAmt
        Local          : Field : Default : Style : Small Bold Italic
        Local          : Field : Default : Type: String
        Indent         : 6
        Local        : Field    : TransVchTypeName    : Set as: "Voucher Type"
        Local        : Field    : TransVchNumber    : Set as: "Number"
        Local        : Field    : TransVchDate    : Set as: "Date"
        Local        : Field    : TransVchTypeName    : Width    : 12
        Local        : Field    : TransVchDrAmt : Set as: "Dr. Amt."
        Local        : Field    : TransVchCrAmt : Set as: "Cr. Amt."
        Local        : Field    : TransVchCount : Set as: "Count"
        Local        : Field    : Narr    : Set as: "Narr"
    [Line : TransVchLedExplode]
        Fields          : TransMstId, TransVchTypeName, TransVchNumber, TransVchDate,TransVchCount, Narr
        Right Fields : TransVchDrAmt, TransVchCrAmt
        Local          : Field : Default : Style : Small Italic
        Indent         : 6
        Key              : TransAlterOnEnter              ;    : $$IsVoucher AND NOT $IsDeleted
        Local        : Field    : TransVchTypeName    : Set as: $VoucherTypeName
        Local        : Field    : TransVchTypeName    : Width    : 12
        Local        : Field    : TransVchDrAmt : Set as: $DrAmount
        Local        : Field    : TransVchCrAmt : Set as: $CrAmount   
        Local        : Field    : TransVchCount : Set as: $VoucherCount
        Local        : Field    : Narr    : Set as:  $Narration
        [Field : Narr]
        Use       : Name Field
        Set as : $Narration
        Width    : 60
        Alignment    : Left
        Color:Blue
    [Key: TransAlterOnEnter]
        Key     : Enter
        Action  : Call  : TransVchAlter
        Inactive: (NOT $$InDisplayMode )
    [Function: TransVchAlter]
        Variable    : VoucherID
        00    : Set    : VoucherID:#TransMstId
        20  : Alter :  Voucher
    [Field    : TransMstId]
        Use    : Name Field
        Set as: $$String:"ID:"+$$String:$MasterId
        Invisible    : Yes
        ;Alter      : Voucher        : $$IsVoucher AND NOT $IsDeleted
    [Field : TransVchTypeName]
        Use       : Name Field
        Set as : $TransVchLed
        Width    : 40
        Alignment    : Left
    [Field    :TransVchDate]
        Use    : Short Date Field
        Alignment: Right
        Width    : 15
        Set as    : $Date
    [Field : TransVchCount]
        Use       : Number Field
        Set as : $TranVchCount
        Width    : 15
        Alignment    : Right
    [Field : TransVchNumber]
        Use       : Name Field
        Set as : $VoucherNumber
        Width    : 15
        Alignment    : Right
    [Field : TransVchDrAmt]
        Use    : Amount Forex Field
        Set as : $TransVchDrAmt
        Border : Thin Left Right
        Width  : 20
        Alignment: Right
    [Field : TransVchCrAmt]
        Use       : Amount Forex Field
        Set as : $TransVchCrAmt
        Border : Thin Right
        Width  : 20
        Alignment: Right
    [Line : TransVchLedTotal]
        Use    : TransVchLedDetail
        Local  : Field : Default          : Style  : Normal Bold
        Local  : Field : TransVchTypeName : Set as : "Total"
        Local  : Field : TransVchDrAmt      : Set as : $$Total:TransVchDrAmt
        Local  : Field : TransVchCrAmt      : Set as : $$Total:TransVchCrAmt
        Border : Thin Top Bottom
    [Part : TransVchSumm]
        Line : TransVchSumm
    [Line : TransVchSumm]
            Field : TransVchSUM1, TransVchSUM2, TransVchSUM3, TransVchSUM4, TransVchSUM5
    [Field : TransVchSUM1]
        Field : Name Field
        Local : Field : Name Field : Set as     : " L e d g e r  S u m m a r y"
        Local : Field : Name Field : Background : BtnFocusBG
        Local : Field : Name Field : Width         : 29
        Local : Field : Name Field : Border     : Thin Box
        Local : Field : Name Field : Color        : Red
    [Field : TransVchSUM2]
        Field : Name Field, Amount Field
        Local : Field : Name Field : Set as       : "Opening Balance"
        Local : Field : Name Field : Style           : Tiny Bold
        Local : Field : Name Field : Width           : 22.50
        Local : Field : Name Field : Align           : Center
        Local : Field : Name Field : Background   : CloseButtonBG
        Local : Field : Name Field : Color           : White
        Local : Field : Amount Field : Set as     : $TransVchOpBal
        Local : Field : Amount Field : Format     : "Dr,Cr"
        Local : Field : Amount Field : Color      : if $$IsDebit:$TransVchOpBal then "Red" else "Blue"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border     : Thin Box
    [Field : TransVchSUM3]
        Field : Name Field, Amount Field
        Local : Field : Name Field   : Set as       : "Debit Totals"
        Local : Field : Name Field   : Style       : Tiny Bold
        Local : Field : Name Field   : Width       : 22.50
        Local : Field : Name Field   : Align       : Center
        Local : Field : Name Field   : Background : CloseButtonBG
        Local : Field : Name Field   : Color       : White
        Local : Field : Amount Field : Set as      : $$Total:TransVchDrAmt/2
        Local : Field : Amount Field : Color       : "Red"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border       : Thin Box
    [Field : TransVchSUM4]
        Field : Name Field, Amount Field
        Local : Field : Name Field   : Set as       : "Credit Totals"
        Local : Field : Name Field   : Style       : Tiny Bold
        Local : Field : Name Field   : Width       : 22.50
        Local : Field : Name Field   : Align       : Center
        Local : Field : Name Field   : Background : CloseButtonBG
        Local : Field : Name Field   : Color       : White
        Local : Field : Amount Field : Set as       : $$Total:TransVchCrAmt/2
        Local : Field : Amount Field : Color      : "Blue"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border       : Thin Box
    [Field : TransVchSUM5]
        Field : Name Field, Amount Field
        Local : Field : Name Field   : Set as       : "Closing Balance"
        Local : Field : Name Field   : Style       : Tiny Bold
        Local : Field : Name Field   : Width       : 22.50
        Local : Field : Name Field   : Align       : Center
        Local : Field : Name Field   : Background : CloseButtonBG
        Local : Field : Name Field   : Color       : White
        Local : Field : Amount Field : Set as       : $TransVchClBal
        Local : Field : Amount Field : Format       : "Dr,Cr"
        Local : Field : Amount Field : Color      : if  $$IsDebit:$TransVchClBal then "Red" else "Blue"
        Local : Field : Amount Field : Width       : 18
        Local : Field : Amount Field : Background : BtnFocusBG
        Local : Field : Default      : Border       : Thin Box
    [Collection : TransVchColl]
        Type        : Vouchers    : Ledger
        Child of    : #LedgerName
        ;; Parm var used for Remote Columnar report.
        ParmVar : LedRepName : String : #LedgerName
        Fetch    :  PersistedView
    [Collection : TransVchEntriesSrc]
        Source Collection    : TransVchLedEntriesSrc, TransVchInvEntriesSrc
        Fetch        : LedgerName, Date, VoucherNumber, VoucherTypeName, DrAmount, CrAmount, MasterId, Narration
        Filter    : TranVchLedNameFltr
    [System: Formulae]
        TranVchLedNameFltr : $LedgerName = #TransVchTypeName
    [Collection : TransVchLedEntriesSrc]
        SourceCollection    : TransVchColl
        Walk        : Ledger Entries
        Compute        : LedgerName         : $LedgerName
        Compute        : MasterId            : $$Owner:$MasterId
        Compute        : Date                : $$Owner:$Date
        Compute Var    : vVchCount            : Number    : If $VoucherNumber != $$PrevObj:$VoucherNumber then ##vVchCount+1 else 1
        Compute        : VoucherCount        : ##vVchCount
        Compute        : PersistedView     : $$Owner:$PersistedView
        Compute        : VoucherNumber        : $$Owner:$VoucherNumber
        Compute        : VoucherTypeName    : $$Owner:$VoucherTypeName
        Compute        : Narration    : $$Owner:$Narration
        Compute        : DrAmount             : If  NOT $$IsDr:$Amount then $Amount else $$Number:"0"        
        Compute        : CrAmount             : If  $$IsDr:$Amount then $Amount else $$Number:"0"
        Filter        : TransVchLedFilter
        Sort        : @@Default            : $LedgerName
    [Collection : TransVchInvEntriesSrc]
        SourceCollection    : TransVchColl
        Walk        : InventoryEntries
        Compute        : LedgerName         : $LedgerName
        Compute Var    : vVchCount            : Number    : If $VoucherNumber != $$PrevObj:$VoucherNumber then ##vVchCount+1 else 1
        Compute        : VoucherCount        : ##vVchCount
        Compute        : Date                : $$Owner:$Date
        Compute        : MasterId            : $$Owner:$MasterId
        Compute        : PersistedView     : $$Owner:$PersistedView
        Compute        : VoucherNumber        : $$Owner:$VoucherNumber
        Compute        : VoucherTypeName    : $$Owner:$VoucherTypeName
        Compute        : DrAmount             : If  Not $$IsDr:$Amount then $Amount else $$Number:"0"        
        Compute        : CrAmount             : If   $$IsDr:$Amount then $Amount else $$Number:"0"
        Filter        : TransVchInvFilter
    [Collection : TransVchSummaryColl]
        Source Collection    : TransVchLedEntriesSrc, TransVchInvEntriesSrc
        By                : TransVchLed        : $LedgerName
        Aggr Compute    : TranVchCount        : Sum : $VoucherCount
        Aggr Compute    : TransVchDrAmt     : Sum : $DrAmount
        Aggr Compute    : TransVchCrAmt     : Sum : $CrAmount
        Is ODBC Table    : Yes
    [System : Formula]
        TransVchLedFilter :  #LedgerName != $LedgerName; AND $PersistedView  =  $$SysName:AcctgVchView
        TransVchInvFilter :  #LedgerName != $LedgerName AND $PersistedView   = $$SysName:InvVchView ;
        FltrDev              : ($LedgerName = $$TgtObject:$LedgerName)
        TransVchOpBal  : $OpeningBalance:Ledger:#LedgerName
         TransVchClBal  : $ClosingBalance:Ledger:#LedgerName
    
     


  10. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Thanks all.. keep on adding features..
    and solve count mystery too
     


  11. Devendra_Rawat

    Devendra_Rawat Well-Known Member



    Sir.. This tdl was taken straight from the Gas/Stove burner .. and served very hot... not much thought has gone into it..
     


  12. Devendra_Rawat

    Devendra_Rawat Well-Known Member



    Nice Work :D:D



    Nice
     


  13. Jay kumar tailor

    Jay kumar tailor Well-Known Member


    Yes , Counting Showing There Is wrong.
    Will try To Resolve.
    :D
     


  14. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Count :

    Suppose in a Sales Voucher there are 5 items, each affect that particular sales ledger (Owner of Explode) then it will show count as 5( number of times the ledger is affected by the voucher Dr/Cr) ..


    that was the logic.. but I have not seen it thoroughly.
     


  15. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    The problem as i understand is as follows: (this is without checking on Tally, as I do not have access to tally now).

    If there are 5 invoices....and each invoices contain 3 Stockitems as billed.... then the count shows 15 and not the Voucher Count. So i think the problem lies with the Collection wherein the Inventory Entries are walked through.

    You can check my above observation, if you have tally with Invoicing data.
     


  16. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Yes Sir,
    Purpose is also the same, Count is not intended for counting voucher number.

    It also counts other occurrences apart from inventory entries like Tax ledgers, discount..

    I think it is giving correct count bearing a few cases
     


  17. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    as per the code..... it will give error in COUNT only when the Sales/Purchase is in Invoice Mode.......
    If you change the Sales/Purchase entries from Invoice mode to Voucher mode and saving it.... then it will count perfectly.
     


  18. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    However there is a "out of box" thinking solution....if you are interested then I tell you..............
     


  19. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    Ha Ha,

    Why not..

    This Tdl was on the request of Shri Bipin Damania Sir
     


  20. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    The problem coming from this collection............

    [Collection : TransVchInvEntriesSrc]
    SourceCollection : TransVchColl
    Walk : InventoryEntries
    Compute : LedgerName : $LedgerName
    Compute Var : vVchCount : Number : If $VoucherNumber != $$PrevObj:$VoucherNumber then ##vVchCount+1 else 1
    Compute : VoucherCount : ##vVchCount
    Compute : Date : $$Owner:$Date
    Compute : MasterId : $$Owner:$MasterId
    Compute : PersistedView : $$Owner:$PersistedView
    Compute : VoucherNumber : $$Owner:$VoucherNumber
    Compute : VoucherTypeName : $$Owner:$VoucherTypeName
    Compute : DrAmount : If Not $$IsDr:$Amount then $Amount else $$Number:"0"
    Compute : CrAmount : If $$IsDr:$Amount then $Amount else $$Number:"0"
    Filter : TransVchInvFilter

    RENAME Compute : VoucherCount : ##vVchCount .......... to .... Compute : VoucherCount2 : ##vVchCount

    Now Similar way compute the number of StockItems within the Voucher..............then divide VoucherCount2 by #ofStockItems.........and compute this value in VoucherCount.

    Compute : VoucherCount : ##vVchCount / ##vNoOfStockItems................

    Try it and let me know the result.
     


  21. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    There is no error in case of inventory entries... It was conceptualized that only. each stock item line is counted separate line
     


  22. Devendra_Rawat

    Devendra_Rawat Well-Known Member




    @Bipin Damania Sir , if any change is required .. consider this solution by Expert Kamdar Jee
     


  23. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    As a Auditor Tool.....the other collection Counts the number of times the particular ledger is appearing and in the same report vide another collection it counts the number of inventory entries, instead of the ledger a/c........then it is hardly a tool to aid auditing. :):)
     


  24. Devendra_Rawat

    Devendra_Rawat Well-Known Member


    As a Auditor Tool.....the other collection Counts the number of times the particular ledger is appearing

    Not Sir,

    It is counting the number of times the particular ledger has affected the report ledger


    and in the same report vide another collection it counts the number of inventory entries, ( here also it counts the number of time, the ledger has affected the reported ledger( through number of times the individual stock item, as stock item is always different )

    instead of the ledger a/c........then it is hardly a tool to aid auditing. :):)

    (ha ha .. Auditor tool is applicable to Main report only... and not explode mode, it was added as after thought... and Bipin Damania ji has shared it through youtube video also)
     


  25. Bipin Damania

    Bipin Damania Active Member


    Dear Amitji & Devendraji

    Thank you very much for taking Count matter, But the same is Secondary.

    As per General requirement this Report is Perfect, I feel so.

    Devendraji, I have not shared this on YouTube, but by Learn Well channel. Just copied from this Forum, previously also they did same.

    Thanks to Jayji for Adding Buttons and AsthaMoorthyji for Narration

    Thanks to All.
     


Share This Page