AutoFill Batch Number in Sale Voucher

Discussion in 'Tally Developer' started by Hasan@123, Jul 22, 2020.

    
  1. Hasan@123

    Hasan@123 Member


    Dear developers,
    I have added a Batch field before Item name and i want that batch field value to auto fill in Item allocation batch field when i pass a sale entry. How can i do that? Please check my code.




    [#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 : "Items"
    SubTitle : "Closing Qty"
    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



    Untitled.jpg Untitled11.jpg
     
    Madhu M likes this.


  2. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    study the [!Field: VCHBATCH NrmlName] .....

    better work on a backup data...as you are changing Tally's default field.
    I do not recommend it, but it is your choice and your risk.
     


  3. Madhu M

    Madhu M New Member


    Super superb
    I am looking same can u Please send me sir

    That Above Code is not Working
    Madhu.gstp@gmail.com
     


  4. Madhu M

    Madhu M New Member


    Super superb
    I am looking same can u Please send me sir

    That Above Code is not Working
    Madhu.gstp@gmail.com
     


Share This Page