Help in Voucher Report with CC Filter

Discussion in 'Free Source Codes' started by kapil22, May 8, 2021.

    
Tags:
  1. kapil22

    kapil22 Member


    Hi Friends,
    please help
    how to apply (option : alteronenter) in this code.

    thanks
    kapil

    [#Menu : Display Menu]
    Add : Item : After : @@locDayBook : Voucher Report- Multi Company with CC Filter : Display : K3Report

    [Report : K3Report]
    Title : "Voucher Report- Multi Company with CC Filter"
    Use : DSP Template
    Form : K3Form
    Variables : SV CurrentCompany, SV FromDate, SV ToDate,
    Variables : CostCentreName
    Variables : IsDayBook, IsItemReport, VoucherTypeName, FamilyVoucherFlag
    Variable : IsLedgerReport, IsCCReport, IsGrpReport
    Set : IsCCReport : Yes
    Filtered : Yes
    Local : Collection : K3Collection: aDD : Filter : CCFilter

    [Form : K3Form]
    Part : K3PART1, K3PART2
    width : 100% page
    height : 100% page
    Use : Empty Right Buttons Template
    Replace : Button : F3 InactiveButton : Change Company
    Replace : Button : F2 InactiveButton : F2 Change Period
    Replace : Button : F4 InactiveButton : ChangeItem


    [part : K3PART1]
    line : K3PART1Line1, K3PART1Line2
    Scroll : Horizontal
    [line : K3PART1Line1]
    Field : NameField, ShortPrompt, DSP MainDateTitle
    local : field : NameField : Set as : "ACCESS Development Services"
    local : field : NameField : width : 42
    local : field : NameField : style : NormalBold
    local : field : ShortPrompt : SET AS : $$LocaleString:"Period" + " : "
    local : field : DSP MainDateTitle : width : 40
    local : field : DSP MainDateTitle : align : left
    local : field : DSP MainDateTitle : color : red
    [line : K3PART1Line2]
    Field : NameField, ShortPrompt, ShortNameField
    local : field : NameField : Set as : "Voucher Report- Multi Company"
    local : field : NameField : style : NormalBold
    local : field : NameField : width : 42
    local : field : ShortPrompt : SET AS : $$LocaleString:"Cost Centre" + " : "
    local : field : ShortNameField : Set as : ##CostCentreName
    local : field : ShortNameField : STYLE : NormalBold
    local : field : ShortNameField : width : 40

    [Part : K3PART2]
    Line : K3PART2Line1, K3PART2Line2
    repeat : K3PART2Line2 : K3Collection
    Bottom Line: K3TOTALLine1
    total : K3LedgerAmountField, K3CostCentreAmountField
    Scroll : both
    Common Border : Yes

    [Line : K3PART2Line1]
    Field : K3CompanyNameField, K3DateField, K3VoucherTypeField, K3VoucherNoField,
    FIELD : K3LedgerNameField, K3GroupField, K3GroupParentField, K3NarrationField, K3LedgerAmountField, K3DrCrField
    FIELD : K3CostCentreFTField, K3CostCentreFAField, K3CostCentrePRField,
    FIELD : K3CostCentreBLField, K3CostCentreSBLField, K3CostCentreSSBLField,K3CostCentreAmountField
    Local : Field : Default : Type : String
    Local : Field : Default : Align : left
    Local : Field : Default : LINE : 3
    Local : Field : Default : Style : Normal Bold
    Local : Field : Default : Border : Column Titles
    Local : Field : K3CompanyNameField : Info : "Company Name"
    Local : Field : K3DateField : Info : "Date"
    Local : Field : K3VoucherTypeField : Info : "Vch Type"
    Local : Field : K3VoucherNoField : Info : "Vch No"
    Local : Field : K3LedgerNameField : Info : "Ledger Name"
    Local : Field : K3GroupField : Info : "Group Name"
    Local : Field : K3GroupParentField : Info : "Group Parent Name"
    Local : Field : K3NarrationField : Info : "Narration"
    Local : Field : K3LedgerAmountField : Info : "Ledger Amount"
    Local : Field : K3DrCrField : Info : "Dr/Cr"
    Local : Field : K3CostCentreFTField : Info : "Fund Type"
    Local : Field : K3CostCentreFAField : Info : "Funding Agency"
    Local : Field : K3CostCentrePRField : Info : "Project"
    Local : Field : K3CostCentreBLField : Info : "Budget Line"
    Local : Field : K3CostCentreSBLField : Info : "SubBudget Line"
    Local : Field : K3CostCentreSSBLField : Info : "SubSubBudget Line"
    Local : Field : K3CostCentreAmountField : Info : "CostCentre Amount"

    [line : K3PART2Line2]
    Field : K3CompanyNameField, K3DateField, K3VoucherTypeField, K3VoucherNoField,
    FIELD : K3LedgerNameField, K3GroupField, K3GroupParentField, K3NarrationField, K3LedgerAmountField, K3DrCrField
    FIELD : K3CostCentreFTField, K3CostCentreFAField, K3CostCentrePRField,
    FIELD : K3CostCentreBLField, K3CostCentreSBLField, K3CostCentreSSBLField,K3CostCentreAmountField, K3CostCentreField

    [LINE : K3TOTALLine1]
    USE : K3PART2Line2
    BORDER : Totals
    Local : Field : K3CompanyNameField : Info : "Total (Nett):"
    Local : Field : K3CompanyNameField : style : NormalBold
    Local : Field : K3DateField : Info : ""
    Local : Field : K3VoucherTypeField : Info : ""
    Local : Field : K3VoucherNoField : Info : ""
    Local : Field : K3LedgerNameField : Info : ""
    Local : Field : K3GroupField : Info : ""
    Local : Field : K3GroupParentField : Info : ""
    Local : Field : K3NarrationField : Info : ""
    Local : Field : K3LedgerAmountField : set as : $$Total:K3LedgerAmountField
    Local : Field : K3LedgerAmountField : style : NormalBold
    Local : Field : K3DrCrField : Info : ""
    Local : Field : K3CostCentreFTField : Info : ""
    Local : Field : K3CostCentreFAField : Info : ""
    Local : Field : K3CostCentrePRField : Info : ""
    Local : Field : K3CostCentreBLField : Info : ""
    Local : Field : K3CostCentreSBLField : Info : ""
    Local : Field : K3CostCentreSSBLField : Info : ""
    Local : Field : K3CostCentreAmountField : set as : $$Total:K3CostCentreAmountField
    Local : Field : K3CostCentreAmountField : style : NormalBold


    [Field : K3CompanyNameField]
    Use : Name Field
    Alter : Voucher
    Invisible : No
    Align : Left
    Alter : Voucher
    Width : 15
    ;set as : ##SVCurrentCompany
    Set as : $OwnerCompany
    style : Normal
    border : Thin Left Right
    [Field : K3DateField]
    use : Short date field
    Width : 8
    Set as : $Date
    style : Normal
    border : Thin Left Right
    [Field : K3VoucherTypeField]
    Use : Short Name Field
    Align : Left
    Width : 17
    Set as : $VoucherTypeName
    style : normal
    border : Thin Left Right
    [Field : K3VoucherNoField]
    Use : Short Name Field
    Align : Left
    Width : 18
    Set as : $VoucherNumber
    style : normal
    border : Thin Left Right
    [Field : K3NarrationField]
    Use : Narration Field
    Line : 1
    Align : Left
    Set as : $Narration
    Alter : Voucher
    border : Thin Left Right
    [Field : K3LedgerNameField]
    Use : Name Field
    Align : Left
    Width : 25
    Set as : $LedgerName
    style : normal
    border : Thin Left Right
    [Field : K3GroupField]
    Use : Name Field
    Align : Left
    Width : 20
    Set as : $Parent:Ledger:$LedgerName
    style : normal
    border : Thin Left Right
    [Field : K3GroupParentField]
    Use : Name Field
    Align : Left
    Width : 20
    Set as : $Parent:Group:#K3GroupField
    style : normal
    border : Thin Left Right
    [Field : K3LedgerAmountField]
    Use : Amount Field
    Width : 15
    Format : "Bracketed:ForNegative,NoZero"
    Set As : If $$IsDr:$Amount Then $Amount Else -$Amount
    style : normal
    border : Thin Left Right
    [Field : K3DrCrField]
    Use : Name Field
    Align : Left
    Width : 3
    Set as : If $$IsDr:$Amount Then "Dr" Else "Cr"
    style : normal
    border : Thin Left Right
    [Field : K3CostCentreFTField]
    Use : Name Field
    Align : Left
    Width : 5
    setas : $Parent:CostCentre:#K3CostCentreFAField
    style : Normal
    border : Thin Left Right
    [Field : K3CostCentreFAField]
    Use : Name Field
    Align : Left
    Width : 15
    set as : $Parent:CostCentre:#K3CostCentrePRField
    style : normal
    border : Thin Left Right
    [Field : K3CostCentrePRField]
    Use : Name Field
    Align : Left
    Width : 18
    set as : IF $CostCentreDepth=3 THEN $CostCentreName ELSE $Parent:CostCentre:#K3CostCentreBLField
    style : normal
    border : Thin Left Right
    [Field : K3CostCentreBLField]
    Use : Name Field
    Align : Left
    Width : 20
    set as : IF $CostCentreDepth=4 THEN $CostCentreName ELSE $Parent:CostCentre:#K3CostCentreSBLField
    style : normal
    border : Thin Left Right
    [Field : K3CostCentreSBLField]
    Use : Name Field
    Align : Left
    Width : 20
    set as : IF $CostCentreDepth=5 THEN $CostCentreName ELSE $Parent:CostCentre:#K3CostCentreSSBLField
    style : normal
    border : Thin Left Right
    [Field : K3CostCentreSSBLField]
    Use : Name Field
    Align : Left
    Width : 20
    set as : $CostCentreSSBL
    ;set as : IF $CostCentreDepth=6 THEN $CostCentreName ELSE ""
    style : normal
    border : Thin Left Right
    [Field : K3CostCentreAmountField]
    Use : Amount Field
    Width : 15
    Format : "Bracketed:ForNegative,NoZero"
    Set As : If $$IsDr:$CostCentreAmount Then $CostCentreAmount Else -$CostCentreAmount
    style : normal
    border : Thin Left Right
    [Field : K3CostCentreField]
    width : 25
    set as : $CostCentreName
    invisible : yes
    [system : formula]
    CCFilter : (@@CostCentreFA Contains ##CostCentreName) or (@@CostCentrePR Contains ##CostCentreName)
    CostCentreFA : IF $CostCentreDepth=2 THEN $CostCentreName ELSE $Parent:CostCentre:mad:@CostCentrePR
    CostCentrePR : IF $CostCentreDepth=3 THEN $CostCentreName ELSE $Parent:CostCentre:mad:@CostCentreBL
    CostCentreBL : IF $CostCentreDepth=4 THEN $CostCentreName ELSE $Parent:CostCentre:mad:@CostCentreSBL
    CostCentreSBL : IF $CostCentreDepth=5 THEN $CostCentreName ELSE $Parent:CostCentre:mad:@CostCentreSSBL
    CostCentreSSBL : IF $CostCentreDepth=6 THEN $CostCentreName ELSE ""

    [Collection : K3Collection]
    Collection : K3LCCollection : K3CompanyCollection

    [Collection : K3CompanyCollection]
    Type : Company
    Fetch : Name
    [Collection : K3VoucherCollection]
    Type : Voucher
    fetch : MasterID

    [Collection : K3LCCollection]
    Source Collection : K3VoucherCollection
    Walk : AllLedgerEntries, CostCentreAllocations,
    By : MasterID : $...MasterID
    By : LedgerName : $LedgerName
    By : CostCentreName : $Name:CostCentre:$Name
    filters : CCFilter
    Compute : Owner Company : $$LoopCollObj:$Name
    Compute : Date : $..Date
    Compute : VoucherTypeName : $..VoucherTypeName
    Compute : VoucherNumber : $..VoucherNumber
    compute : LedgerName : $..LedgerName
    Compute : Narration : $().Narration
    Compute : CostCentreName : $Name:CostCentre:$Name
    Compute : CostCentreDepth : $Depth:CostCentre:$Name
    AGGRCompute: CostCentreAmount : SUM : $Amount
    AggrCompute: Amount : Sum : $Amount


    ;; End-of-file
     



  2. First Add this field in your Code (this Field is already there in tally)

    [Field: VID]

    Use : Name Field
    Setas : $$SPrintf:"ID:%s":$VTID
    Invisible : Yes

    Secondly computer VTID : $Master (ie as MasterID)
    Secondly add the Key to your Line (this key is also there in tally)

    [Key : Vch Alter]

    Key : Enter
    Action : Call : AltVoucher:#VID
    Scope : Current
     
    kapil22 likes this.


  3. kapil22

    kapil22 Member




    Thank you so much Sanjay ji
     


  4. kapil22

    kapil22 Member


    Hi,
    The Total of "LedgerAmountField" not calculate right as said field value is not in "DrCr" format.


    Local : Field : K3LedgerAmountField : set as : $$SubTotal:K3LedgerAmountField


    [Field : K3LedgerAmountField]
    Use : Amount Field
    Width : 15
    Format : "Bracketed:ForNegative,NoZero"
    Set As : If $$IsDr:$Amount Then $Amount Else -$Amount
    style : normal
    border : Thin Left Right
     


Share This Page