How Add a Cost Centre Name into Existing Journal Voucher

Discussion in 'Tally Developer' started by mithun, Feb 8, 2019.

    
  1. mithun

    mithun New Member


    Hi Every One

    I have Some Doubts can any one help me with the solution.for example i have 10 journal voucher with out costcentre allocations.now ill enable the costcentre in company as well as ledger.now ill open one journal voucher it will ask for cost centre allocations.now this is in manual mode.now this have to de done via code.i have add one function name in gatewayoftally if i press that function call means automatically costcente allocations has to be done for all 10 journal voucher. i have tried like this but it's not working can any one tell me how can i do this Thanks in advance.

    ;;;Tried Code;;;

    [#Menu : GateWayOfTally]

    Add:Key Item:Test Call:T:Call:TestFuncCall

    [Function : TestFuncCall]

    00:Log:"Inside Function"

    Variable : JrnalMasterIDVar : String
    Variable : IsJrnalVchAccept : Logical


    0000:Walk Collection:JrnlMainColl

    0005:SET : JrnalMasterIDVar : "ID:"+ $$String:$MasterId

    Object : Voucher :##JrnalMasterIDVar

    0040:Log:##JrnalMasterIDVar

    ; 0010 : SET : IsJrnalVchAccept : Yes

    ; 0020 : SET TARGET
    ; 0030 : SET OBJECT

    ; 0050 : SET TARGET
    0060 : Insert Collection Object : AllLedgerEntries ;: Yes
    ; 0070 : SET TARGET
    0071: Log:"Ledger"
    160 : Insert Collection Object : CategoryAllocations
    165 : Set Value : Category : "Primary Cost Category"
    166 : Log:"Cost Category"
    170 : Insert Collection Object : CostCentreAllocations
    180 : SET VALUE : Name : "AJAY"
    181 : Log:"Cost Centre"
    190 : SET VALUE : Amount : 100 * -1
    190a:save target
    ;195 : SET TARGET : ..
    ;197 : SET TARGET : ..


    ; 215 : Alter Target


    0001:End Walk


    [Collection:JrnlSubColl]

    Type :Vouchers:VoucherType
    Child Of :$$VchTypeJournal
    Belongs To :Yes
    Fetch :Date, VoucherNumber, VoucherTypeName, LedgerName, Amount, Masterid

    [Collection: JrnlMainColl]

    Source Collection : JrnlSubColl
    Walk : Ledger Entries;, Category Allocations, Cost Centre Allocations
    Fetch:Date, VoucherNumber, VoucherTypeName, LedgerName, Amount, Category, Name,MasterId
     


Share This Page