how to select batch before stock item in sales voucher

Discussion in 'Tally Developer' started by kamal, Jun 9, 2012.

    
  1. kamal

    kamal Member


    Dear sir,
    how to select batch number before stock item in sales voucher
    plz arrange the tdl code.
     



  2. Hi Kamal.

    1st thing bathes depends on items. there are types of batchs related to Item. But Only Batches Does Not Exit.
    You cant Add Batch Before StockItem. Becuase reverse is not possible.

    But tell me in which case you required batches before stockitem?
    do you have any specific requirement like that . by knowing the requirment i can suggest you work around.
     


  3. kamal

    kamal Member


    Dear sir,
    ThankQ for ur reply
    i have a computer business we maintain batch details for product serial numbers first we select item then batch number.
    if batch number comes first it will select item automatically its reduce time to search for stock item.
    plz find the sample attachment.
     

    Attached Files:




  4. Hi Kamal,
    Tell me. You Only Purchase the Items and Sell.
    At That Time You Can Construct A Collecttion With Purchase items and Batches. in the Collection Put 1st batch Name and Then The Item Name. and when you select the Batch autofill the Item Name. One Major Issues is How Will You remove that from the Table once it get Selected.
    Please Check It out what i am saying.
    Give Me Some Time I will also try it and Let You Know
     


  5. kamal

    kamal Member


    dear sir,
    i required this option only in sales voucher.
    we purchase item and sale item no other transcation.
     



  6. Hi Kamal,

    Please check out this code it may help you as you required..

    Code:
    ;; Sri Ganeshji : Sri Balaji : Sri Pitreshwarji : Sri Durgaji : Sri Venkateshwara
     
    [#Line : EI InvInfo]
        Option : DSD EI InvInfo : $$IsSales:##SVVoucherType
       
    [!Line : DSD EI InvInfo]
        Add : Fields      : Before : VCH StockItem  : VCH Batch Name New
       
        Local : Field : VCH StockItem : Type    : String : Forced
        Local : Field : VCH StockItem : SEt As : $$Table:VCHBatchNameNew:$StockItemName
        Local : Field : VCH StockItem :  Set Always : Yes
       
     
        [Field : VCH Batch Name New]
            Use        : Batch Name Field
            Table        : DSD Batches VCH Extract : $$Line =1
            Table        : DSD Batches VCH Extract,EndOfList : $$Line > 1
            Show Table    : Always
            Storage        : Batch Name New
            Set Always    : yes
       
           
     
    [System : UDF]
        Batch Name New : String : 1947
           
     
    [Collection: DSD Batches VchSrc]
        Type        : Vouchers : VoucherType
        Child Of    : "Purchase"
        Belongs To    : Yes
       
     
    [Collection : DSD Batches VCH Extract]
        Title :  "List Of Serial Numbers"
        Source Collection : DSD Batches VchSrc
        Walk    : InventoryEntries,BatchAllocations
        By        : StockItemName    : $StockItemName
        By        : BatchName            : $BatchName
        Compute : CLBalance            : $$FilterValue:$Closingbalance:DSDBATCHEXTRACT:1:isCorrectBatch    ;; use to Get the Closing Balance Of batch for That item
       
        SubTitle : "Batch Name"  ;;Serial number
        SubTitle : "StockItem Name"
        SubTitle : "Closing Balance"
        Full Height : Yes
        Align        : right
     
        Format  : $BatchName,20
        Format    : $StockItemName ,20   
        Format  : $CLBalance,15
        Filter    : NOTEmptyCLBalance
     
    [System : Formula]
        isCorrectBatch : $Name=$$ReqObject:$BatchName
        NOTEmptyCLBalance : NOT $$IsEmpty:$CLBalance
     
     
    [Collection : DSD BATCH EXTRACT]
        Type        : Batch
        Child of    : ##pvItemName
        ParmVAR        : pvItemName    :  String    : $StockItemName
        Fetch        : GodownName, ClosingBalance, Date, ClosingRate, ClosingValue, MfdOn, ExpiryPeriod
       
       
     
      
     


  7. kamal

    kamal Member


    dear sir,
    after applying this code its working fine but after saving the voucher and reopen item name QTY RATE details are not displaying in all vouchers. plz find the attachment
     

    Attached Files:




  8. Hi Kamal,
    Its Woking Fine.

    I Have made a slight change in it. Please check it out. and check in this test Data.
    still you face any problem. Let me know.



    Code:
    ;; Sri Ganeshji : Sri Balaji : Sri Pitreshwarji : Sri Durgaji : Sri Venkateshwara
     
    [#Line : EI InvInfo]
        Option : DSD EI InvInfo : $$IsSales:##SVVoucherType
       
    [!Line : DSD EI InvInfo]
        Add : Fields      : Before : VCH StockItem  : VCH Batch Name New
       
     
    [#Line : EI InvInfo]
        Option : DSD NEW EI InvInfo : $$InCreateMode and $$IsSales:##SVVoucherType
       
    [!Line : DSD NEW EI InvInfo]
       
        Local : Field : VCH StockItem : Type    : String : Forced
        Local : Field : VCH StockItem : SEt As : $$Table:VCHBatchNameNew:$StockItemName
        Local : Field : VCH StockItem :  Set Always : Yes
       
     
        [Field : VCH Batch Name New]
            Use        : Batch Name Field
            Table        : DSD Batches VCH Extract : $$Line =1
            Table        : DSD Batches VCH Extract,EndOfList : $$Line > 1
            Show Table    : Always
            Storage        : Batch Name New
            Set Always    : yes
       
           
     
    [System : UDF]
        Batch Name New : String : 1947
           
     
    [Collection: DSD Batches VchSrc]
        Type        : Vouchers : VoucherType
        Child Of    : "Purchase"
        Belongs To    : Yes
       
     
    [Collection : DSD Batches VCH Extract]
        Title :  "List Of Serial Numbers"
        Source Collection : DSD Batches VchSrc
        Walk    : InventoryEntries,BatchAllocations
        By        : StockItemName    : $StockItemName
        By        : BatchName            : $BatchName
        Compute : CLBalance            : $$FilterValue:$Closingbalance:DSDBATCHEXTRACT:1:isCorrectBatch    ;; use to Get the Closing Balance Of batch for That item
       
        SubTitle : "Batch Name"  ;;Serial number
        SubTitle : "StockItem Name"
        SubTitle : "Closing Balance"
        Full Height : Yes
        Align        : right
     
        Format  : $BatchName,20
        Format    : $StockItemName ,20   
        Format  : $CLBalance,15
        Filter    : NOTEmptyCLBalance
     
    [System : Formula]
        isCorrectBatch : $Name=$$ReqObject:$BatchName
        NOTEmptyCLBalance : NOT $$IsEmpty:$CLBalance
     
     
    [Collection : DSD BATCH EXTRACT]
        Type        : Batch
        Child of    : ##pvItemName
        ParmVAR        : pvItemName    :  String    : $StockItemName
        Fetch        : GodownName, ClosingBalance, Date, ClosingRate, ClosingValue, MfdOn, ExpiryPeriod
       
       
     
      
     

    Attached Files:

    Muhammadhaneef likes this.


  9. kamal

    kamal Member


    DEAR SIR,
    ITS WORKING FINE
    AFTER SELECTING THE ITEM AGAIN ITS ASKING FOR BATCH PLZ REMOVE BATCH FOR SECOND TIME
    PLZ FIND THE ATTACHMENT
     

    Attached Files:

    PKR likes this.



  10. Hi Kamal,
    you have to auto fill the batch name which you have selected in Inventory Entries Level To Batch Allocation Level.

    Just Push The Value By assigning it in Batch Level.
     


  11. laxman

    laxman Member


    Dear sir,

    If Possible Batch Wise Reorder Procces.
     


  12. Gopaalran

    Gopaalran New Member


    Hi Dinesh,
    This code is working fine but it is not showing opening Batches.
     


  13. Prateek Mudugal

    Prateek Mudugal New Member


    Dear Sir,
    Thank You For the Code
    But Batch is Not Selecting Automatically in Batch Allocation Screen Sir
     


  14. RAJdon

    RAJdon New Member


    If some one need very simple Programming for this. please make write note below , we will surely share a better code for the above
     


  15. sivam

    sivam Active Member


    Dear All
    Please try with collection
    Code:
    [Collection: Test]
       
        Type        : Batches in Godown
        Child Of    : "Main Location"
        Belongs To    : Yes
        Format        : $Name
        Format        : $Parent
        Fetch        : Name, BatchName, Parent
     
    sanskruti and Muhammadhaneef like this.


  16. B PRAVEENKUMAR

    B PRAVEENKUMAR New Member


    anyone finished this tdl
     


  17. suyash

    suyash New Member


    Thanks & Nice Code
    its working fine but data hang Because of use filter collection used for fetch batch closing qty..
    any other way to fetch batch closing qty
     


  18. gtendra

    gtendra Member


    This code is working fine but it is not showing opening Batches.
     


Share This Page