Batch wise item summary

Discussion in 'Tally Developer' started by vijayakumar, Jul 29, 2014.

         
  1. vijayakumar

    vijayakumar New Member


    [#Menu: Gateway of Tally]
    Item: "Batch Wise Item Summary" : Display Collection : Batch Report

    [Collection : Batch Report]
    Collection: MyBodyPart
    Variable: MyVar
    Report: ItemReport
    Trigger: MyTrigger
    Title: "List Of Batch's"
    Full Height: Yes
    Align: Center


    [Variable: MyVar]
    Type: String

    [Report: MyTrigger]
    Form : TriggerForm
    Variable: MyVar
    Title: "Select Batch Name"
    [Form: TriggerForm]
    Parts: TriggerPart
    Height: 100% Page
    Width:10% Page
    [Part: TriggerPart]
    Lines: TriggerLine
    [Line: TriggerLine]
    Field: TriggerField

    [Field: TriggerField]
    Use: Name Field
    Table: BatchReport

    SubForm :Item Report
    Show Table: Always
    Variable: MyVar
    Modifies: MyVar
    ;Align: Center
    ;Width: 100%

    ;============================Collections BATCHES=================================
    [Collection: BatchOpSrc]


    Type : Stock Item
    Fetch : BatchName, StockItemName
    [Collection : BatchOp]
    Source Collection : BatchOpSrc
    Walk : Batch Allocations
    By : BName : $BatchName
    [Collection: BatchPurSrc]
    Type : Voucher
    ; Filter : MyPurchaseFilter
    [Collection : BatchPur]
    Source Collection : BatchPurSrc
    Walk : Inventory Entries, Batch Allocations
    By : BName : $BatchName
    [Collection: MyBodyPart]
    Collection : BatchPur, ;BatchOp,
    Fetch : BName
    Format : $BName, 20
    Variable : MyVar
    Sort : Default : $BName
    [System: Formula]
    MyPurchaseFilter : $$IsPurchase:$VoucherTypeName

    ;=========================== ITEM REPORT=================================
    [Report: Item Report]
    ;Use : DSP Template
    Form : ItemForm
    ;Set : SV FromDate : $$MonthStart:$LastVoucherDate:Company:##SVCurrentCompany
    ;Set : SV ToDate : $$MonthEnd:$LastVoucherDate:Company:##SVCurrentCompany
    Set: bename : $$batchfilter


    ;; batch name filter function

    [Function:batchfilter]
    VARIABLE : vbatchName : String

    RETURNS : String


    30 : SET : vbatchName : #TriggerField


    70 : RETURN : ##vbatchName



    [Form: ItemForm]
    ;Use :DSP Template
    Parts: ItemTitlePart, ItemBodyPart
    Button: refreshthisbatch


    [Button:refreshthisbatch]
    Title:"Refresh TDL"
    Action: refresh TDL
    Key:F5

    [Part: ItemTitlePart]

    Lines: ItemBatchTitle, qtynametitle , ItemNameTitle,
    Border: Column Titles


    [Line: ItemBatchTitle]
    Field: ItemBatchTitle
    Right Field:ItemDateTitleFROM, ItemDateTitle
    Height: 1.5
    Space Top:.3
    Space Bottom: .3
    Border: thin bottom
    [Field: ItemBatchTitle]
    Use: Name Field
    Skip: yes
    Set as: "BATCH NAME " +": " + ##bename
    Width: 25
    [Field: ItemDateTitle]
    Use: Date Field
    Set as: #SVTodate
    Style: Normal Bold
    Skip: Yes

    [Field: ItemDateTitleFROM]
    Use: Date Field
    Set as: #SVFROMdate
    Style: Normal Bold
    Skip: Yes



    [Line:qtynametitle]
    ;Border: Column Titles
    Field: BeItemNameTitle, beitembatchoptitle,
    Right Fields:beitembatchintitle, beitembatchouttitle,beitembatchclotitle
    Height: 1.5

    [Line: ItemNameTitle]

    Field: emtyfield, ItemBalanceTitle, ItemRateTitle, ItemValueTitle,
    Right Fields: ItemBalanceTitle1, ItemValueTitle1, ItemBalanceTitle2, ItemValueTitle2,ItemBalanceTitle3, ItemRateTitle3, ItemValueTitle3
    Height: 1.5



    [Field: emtyfield]
    Set as:""
    Width:25 % page
    Skip: yes
    Border: thick right

    [Field: BeItemNameTitle]
    Set as: "particulars"
    Style: Normal Bold
    Skip: Yes
    Width: 25 % page
    Border: thick right
    Align: Center


    [Field:beitembatchclotitle]

    Set as: "Closing"
    Style: Normal Bold
    Skip: Yes
    Width: 22.50 % page
    Border: Thick Right and bottom
    Align: Center

    [Field:beitembatchoptitle]
    Use: beitembatchclotitle
    Set as:"Opening"
    Border:Thick Right and bottom
    Width: 22.50 % page

    [Field:beitembatchintitle]
    Use: beitembatchclotitle
    Set as:"Inwards"
    Width: 15 % page
    Border: Thick Right and bottom
    [Field:beitembatchouttitle]
    Use: beitembatchclotitle
    Set as:"outwards "
    Width: 15 % page
    Border: Thick Right and bottom



    [Field: ItemBalanceTitle]

    Set as: "Qty"
    Width: 7.5 % page
    Align: Center
    Style: Normal Bold
    Skip: Yes
    ;Border: thin box


    [Field: ItemRateTitle]
    Set as: "Rate"
    Width: 7.5 % page
    Align: Center
    Style: Normal Bold
    Skip: Yes
    ;Border: thin box

    [Field: ItemValueTitle]
    Set as: "Value"
    Width: 7.5 % page
    Align: Center
    Style: Normal Bold
    Skip: Yes


    [Field: ItemBalanceTitle1]

    Set as: "Qty"
    Width: 7.5 % page
    Align: Center
    Style: Normal Bold
    Skip: Yes
    Border: Thick left


    [Field: ItemValueTitle1]
    Set as: "Value"
    Width: 7.5 % page
    Align: Center
    Style: Normal Bold
    Skip: Yes
    ;Border: thin right

    [Field: ItemBalanceTitle2]

    Set as: "Qty"
    Width: 7.5 % page
    Align: Center
    Style: Normal Bold
    Skip: Yes
    Border: Thick left

    [Field: ItemValueTitle2]
    Set as: "Value"
    Width: 7.5 % page
    Align: Center
    Style: Normal Bold
    Skip: Yes



    [Field: ItemBalanceTitle3]

    Set as: "Qty"
    Width: 7.5 % page
    Align: Center
    Style: Normal Bold
    Skip: Yes
    Border: Thick left


    [Field: ItemRateTitle3]
    Set as: "Rate"
    Width: 7.5 % page
    Align: Center
    Style: Normal Bold
    Skip: Yes
    ;Border: thin box

    [Field: ItemValueTitle3]
    Set as: "Value"
    Width: 7.5 % page
    Align: Center
    Style: Normal Bold
    Skip: Yes
    ;Border: thin box


    [Part: ItemBodyPart]
    Lines: ItemBodyPart
    Bottom Line: ItemTotalLine
    Total: ItemValue
    Repeat: ItemBodyPart : MyItemBodyPart
    Scroll: Vertical
    Common Border: Yes

    [Line: ItemBodyPart]
    Field: BeItemName,ItemopBalance, ItemopRate, ItemopValue
    Right Field:IteminBalance,IteminValue, ItemoutBalance,ItemoutValue,ItemBalance, ItemRate, ItemValue
    ;Border: thin bottom

    [Field: BeItemName]

    Set as: $IName
    Style: Normal
    ;Skip: Yes
    Width:25 % page
    Border: thick right



    [Field: ItemBalance]
    Set as: $MyQty
    Width: 7.5% page
    Align: Left
    Skip: Yes
    Border: Thick left
    Align: Left
    [Field: ItemRate]
    Set as: $MyRate
    Width: 7.5% page
    Align: Left
    Skip: Yes
    ;Border: thin left
    Align: Left

    [Field: ItemValue]
    Use: Amount Field
    Set as: $MyValue
    Width: 7.5% page
    Align: Left
    Skip: Yes
    ;Border: thin left
    ;Align: Center

    [Field: itemopbalance]
    Use: itembalance
    Set as: $myopqty

    [Field: itemoprate]
    Use: itemrate
    Set as:$myoprate

    [Field: itemopvalue]
    Use: itemvalue
    Set as:$myopvalue

    [Field: iteminbalance]
    Use: itembalance
    Set as: $myinqty


    [Field: iteminvalue]
    Use: itemvalue
    Set as:$myinvalue

    [Field: itemoutbalance]
    Use: itembalance
    Set as: $myoutqty


    [Field: itemoutvalue]
    Use: itemvalue
    Set as:$myoutvalue


    [Line: ItemTotalLine]
    Left Field: ItemTotalName
    Right Field:itemoptotalvalue,itemintotalvalue, itemouttotalvalue,ItemTotalValue
    Border: Column Titles

    [Field: ItemTotalName]
    Use: Name Field
    Set as: "TOTAL "
    Skip: Yes
    Width: 25 % page

    [Field: itemoptotalvalue]
    Use: Amount Field
    Set as: $$Total:Itemopbalance
    Skip: Yes
    Width: 22.50% page

    [Field: itemintotalvalue]
    Use: Amount Field
    Set as: $$Total:Iteminbalance
    Skip: Yes
    Width: 15% page

    [Field: itemouttotalvalue]
    Use: Amount Field
    Set as: $$Total:ItemoutValue
    Skip: Yes
    Width: 15% page

    [Field: ItemTotalValue]
    Use: Amount Field
    Set as: $$Total:ItemValue
    Skip: Yes
    Width: 22.50% page




    ;============================== COLLECTION ITEM ======================
    [Collection : ItemOp]
    Source Collection : BatchOpSrc
    Walk : Batch Allocations
    By : BName : $BatchName
    By : IName : $StockItemName
    Compute : MyQty : $$FilterValue:$Closingbalance:DSDBATCHEXTRACT:1:isCorrectBatch
    Compute : MyRate : $$FilterValue:$ClosingRate:DSDBATCHEXTRACT:1:isCorrectBatch
    Compute : MyValue : $$FilterValue:$ClosingValue:DSDBATCHEXTRACT:1:isCorrectBatch

    [Collection : ItemPur]
    Source Collection : BatchPurSrc
    Walk : Inventory Entries, Batch Allocations
    By : BName : $BatchName
    By : IName : $StockItemName

    Compute : MyQty : $$FilterValue:$Closingbalance:DSDBATCHEXTRACT:1:isCorrectBatch
    Compute : MyRate : $$FilterValue:$ClosingRate:DSDBATCHEXTRACT:1:isCorrectBatch
    Compute : MyValue : $$FilterValue:$ClosingValue:DSDBATCHEXTRACT:1:isCorrectBatch

    Compute : MyopQty : $$FilterValue:$openingbalance:DSDBATCHEXTRACT:1:isCorrectBatch
    Compute : MyopRate : $$FilterValue:$openingRate:DSDBATCHEXTRACT:1:isCorrectBatch
    Compute : MyopValue : $$FilterValue:$openingValue:DSDBATCHEXTRACT:1:isCorrectBatch

    Compute : MyinQty : $$FilterValue:$inwardquantity:DSDBATCHEXTRACT:1:isCorrectBatch
    Compute : MyinValue : $$FilterValue:$inwardvalue:DSDBATCHEXTRACT:1:isCorrectBatch

    Compute : MyoutQty : $$FilterValue:$outwardquantity:DSDBATCHEXTRACT:1:isCorrectBatch
    Compute : MyoutValue : $$FilterValue:$outwardvalue:DSDBATCHEXTRACT:1:isCorrectBatch

    [Collection: MyItemBodyPart]
    Collection : ItemPur , ;ItemOp,
    Fetch : IName, BName , MyQty, MyRate, MyValue, MyopQty, MyopRate, MyopValue, MyinQty, MyinValue,MyoutQty, MyoutValue
    Sort : Default : $BName

    Variable: BeName : String : $BName
    Filter : MyItemFilter
    ;Filter : NotEmptyMyQty

    [Collection : DSD BATCH EXTRACT]
    Type : Batch
    Child of : ##pvItemName
    ParmVAR : pvItemName : String : $StockItemName
    Fetch : GodownName, ClosingBalance, Date, ClosingRate, ClosingValue, opening balance, opening rate, opening value, inward quantity, inward value, outward quantity, outward value
    [System: Formula]
    MyItemFilter :##BeName = $BName
    isCorrectBatch : $Name=$$ReqObject:$BatchName
    NOTEmptyMyQty : NOT $$IsEmpty:$MyQty

    [System: Variable]
    Variable : bename : String


    [Border: Thick Right and bottom]

    Right : Thick
    Bottom: thick
    Left: Thick
    Top: Thick
     
    anajetli likes this.


  2. priya

    priya Member


    Thank you; but if you provide it as attachment, it will be nice, as in this coding 'smilies' are occurring in the code. By the way, thank you for your reply and thanks again for such a wonderful work. Bye
     


  3. mpal2311

    mpal2311 Active Member


    Thanks for Sharing. :)
     


  4. V Shankar

    V Shankar New Member


    Thank you
     


Share This Page