Cost Center

Discussion in 'Free Source Codes' started by imranlhr, Feb 13, 2020.

         
  1. imranlhr

    imranlhr New Member


    Dear Experts,

    I found detail discussions on each topic. but in cost centers i didn't find details. If any expert have idea how to get report of cost center voucher wise. please share.
     


  2. garima

    garima Active Member


    You will need to re do entries.. as I have changed Udf definations
    Print issue persist..


    Code:
    [#Report: Day Book]
        Set: DBCostExplodeFlag: Yes
        Set: ExplodeFlag: Yes
       
        On    : Load    : Yes: Call: ImranSetExplodeFlag
       
    [#Report: Voucher Register]
        Set: DBCostExplodeFlag: Yes
        Set: ExplodeFlag: Yes
       
        On    : Load    : Yes: Call: ImranSetExplodeFlag
    
    
    [Function    :ImranSetExplodeFlag]
       
        100        : Set: ExplodeFlag: No ; needed to fresh cost allocations, other 1st Mqty is not coming in first time Explode (F1)
       
    [#Line: VCHCSTCAT CstTitles]
    
        Add : Left Fields : After:VCHNameTitle:Metal Qty,MetalRate
        Local : Field : Metal Qty : Info : "Qty"
        Local : Field : MetalRate : Info : "Rate"
        Local : Field : Metal Qty : Style : Small Bold
        Local : Field : MetalRate : Style : Small Bold
    
    [#Line: VCHCST ExplLine]
        Add     : Fields : After : VCHCST Name : MetalQty,    MetalRate
    
    [#Part: VCHCST Explosion]
        Add : Total      : MetalQty, MetalRate
           
    [#Line: VCHCST Line]
        Add :    Fields : After : VCHCST Name : Metal Qty, MetalRate
       
    [Field : Metal Qty]
        Use     : Number Field
        Storage : udfmQty
        Set as    :  IF Not $$InCreateMode then @LocalMQtyValue  else $$value
        Set Always    : Yes
        Width     : 6
        Align     : Center   
        Format : "NoZero"
        Fetch Object: Voucher: @LocalMQtyVchId : AllLedgerEntries.CategoryAllocations.CostCentreAllocations.udfMQty
        LocalMQtyVchId: $$Sprintf:@@VchMasterID:$MasterID   
        LocalMQtyValue  :$(Voucher, @@imranLocalVchId).AllLedgerEntries[1,@@imrnSameLedName].CategoryAllocations[1,@@imrnSameCatName].CostCentreAllocations[1, @@imrnSameCCName].udfMQty
       
    [System    : Formulae]
       
        imranLocalVchId : $$Sprintf:@@VchMasterID:$MasterID   
        imrnSameLedName    : $LedgerName = #DspVchAccount
        imrnSameCatName    : $Category = #VchCSTCatName
        imrnSameCCName    : $Name = #VCHCSTName
       
       
       
    [Field : Metal Rate]
       
        Use     : Number Field
    
        Storage : udfMRate
        Set as    :  IF Not $$InCreateMode then @LocalMRateValue else $$value
        Set Always    : Yes
        Width     : 6
        Align     : Center
        Format     : "NoZero"
        Fetch Object: Voucher: @LocalMRateVchId: AllLedgerEntries.CategoryAllocations.CostCentreAllocations.udfMRate
        LocalMRateVchId: $$Sprintf:@@VchMasterID:$MasterID   
       
        LocalMRateValue :$(Voucher, @@imranLocalVchId).AllLedgerEntries[1,@@imrnSameLedName].CategoryAllocations[1,@@imrnSameCatName].CostCentreAllocations[1, @@imrnsameccName].udfMRate
       
    [#Line: VCHCST Total]
        Add : Fields : Before : VCHCST Total : Metal QtyTotal, MetalRateTotal
    
    
    
    [Field : Metal QtyTotal]
        Use         : Number field
        Width       : 6
        Align         : Center 
        Set as      : $$Total:MetalQty
        Border         : Totals : $$NumItems:CostCentreAllocations >= 2
    
        Inactive   : $$NumItems:CostCentreAllocations < 2         
    
    
    [Field : MetalRateTotal]
        Use         : Number field
        Set As      : $$Total:MetalRate
        Width       : 6
        Border         : Totals : $$NumItems:CostCentreAllocations >= 2
    
        Inactive   : $$NumItems:CostCentreAllocations < 2         
    
    
    
    [System : UDF]
        udfMQty     : Number : 21701
        udfMRate     : Number : 21702
    
    
     
    imranlhr likes this.


  3. garima

    garima Active Member


    ImrnaPrint.jpg ImranDybk..jpg ;Now the print Problems is also solved; Jugad removed



    Code:
    [#Report: Day Book]
        Set: DBCostExplodeFlag: Yes ; For faster viewing report
        Set: ExplodeFlag: Yes
     
     
    [#Report: Voucher Register]
        Set: DBCostExplodeFlag: Yes ;; For faster viewing report
        Set: ExplodeFlag: Yes
     
     
    [#Line    :  DSP VchDybkDetail]
        Local    : Field: DspVchAccount : Fetch Object: Voucher: @@imrnLocalVchId : AllLedgerEntries.CategoryAllocations.CostCentreAllocations.udfMQty
        Local    : Field: DspVchAccount : Fetch Object: Voucher: @@imrnLocalVchId  : AllLedgerEntries.CategoryAllocations.CostCentreAllocations.udfMRate
     
     
    [#Line: VCHCSTCAT CstTitles]
    
        Add : Left Fields : After:VCHNameTitle:Metal Qty,MetalRate
        Local : Field : Metal Qty : Info : "Qty"
        Local : Field : MetalRate : Info : "Rate"
        Local : Field : Metal Qty : Style : Small Bold
        Local : Field : MetalRate : Style : Small Bold
    
    [#Line: VCHCST ExplLine]
        Add     : Fields : After : VCHCST Name : MetalQty,    MetalRate
    
    [#Part: VCHCST Explosion]
        Add : Total      : MetalQty, MetalRate
         
    [#Line: VCHCST Line]
        Add :    Fields : After : VCHCST Name : Metal Qty, MetalRate
     
    [Field : Metal Qty]
        Use     : Number Field
        Storage : udfmQty
        Set as    :  IF Not $$InCreateMode then @LocalMQtyValue  else $$value
        Set Always    : Yes
        Width     : 6
        Align     : Center 
        Format : "NoZero"
        LocalMQtyValue  :$(Voucher, @@imrnLocalVchId).AllLedgerEntries[1,@@imrnSameLedName].CategoryAllocations[1,@@imrnSameCatName].CostCentreAllocations[1, @@imrnSameCCName].udfMQty
     
    
     
    [Field : Metal Rate]
     
        Use     : Number Field
    
        Storage : udfMRate
        Set as    :  IF Not $$InCreateMode then @LocalMRateValue else $$value
        Set Always    : Yes
        Width     : 6
        Align     : Center
        Format     : "NoZero"
     
        LocalMRateValue :$(Voucher, @@imrnLocalVchId).AllLedgerEntries[1,@@imrnSameLedName].CategoryAllocations[1,@@imrnSameCatName].CostCentreAllocations[1, @@imrnsameccName].udfMRate
     
    [#Line: VCHCST Total]
        Add : Fields : Before : VCHCST Total : Metal QtyTotal, MetalRateTotal
    
    
    
    [Field : Metal QtyTotal]
        Use         : Number field
        Width       : 6
        Align         : Center
        Set as      : $$Total:MetalQty
        Border         : Totals : $$NumItems:CostCentreAllocations >= 2
    
        Inactive   : $$NumItems:CostCentreAllocations < 2       
    
    
    [Field : MetalRateTotal]
        Use         : Number field
        Set As      : $$Total:MetalRate
        Width       : 6
        Border         : Totals : $$NumItems:CostCentreAllocations >= 2
    
        Inactive   : $$NumItems:CostCentreAllocations < 2       
    
    
    
    [System : UDF]
        udfMQty     : Number : 21701
        udfMRate     : Number : 21702
    
    [System    : Formulae]
     
        imrnLocalVchId : $$Sprintf:@@VchMasterID:$MasterID 
        imrnSameLedName    : $LedgerName = #DspVchAccount
        imrnSameCatName    : $Category = #VchCSTCatName
        imrnSameCCName    : $Name = #VCHCSTName
     
        
     
    Last edited: Feb 20, 2020
    Frz and imranlhr like this.


  4. imranlhr

    imranlhr New Member


    Thanks alot Sir for your efforts and time. bundle of thanks
     


  5. imranlhr

    imranlhr New Member


    Really amazing code i m trying from last 3 weeks but didn't find how to do this. But Sir your code provides me new ways to learn and i will do more experiments with this code and will make a new report soon and will share my code on this plate form so, new learners like me will learn and expand their knowledge.
     


Share This Page