How to Create automatic batches while Creating Purchase Voucher

Discussion in 'Free Source Codes' started by Vineet Jindal, Feb 21, 2024.

    
  1. Vineet Jindal

    Vineet Jindal Member


    Dear Experts

    Please tell me how to create auto batches in purchase voucher entry.
     


  2. sivam

    sivam Active Member


    Code:
    [#Field: VCHBATCH GRNName]
    
    Add : Option : VCHBATCH NrmlName KNS : @@IsPurchase
    
    [!Field: VCHBATCH NrmlName KNS]
    
    Set By Condition : $$InCreateMode : 123456
    
    You can add Anything as your logic

    You Should Try.
     


  3. sattam

    sattam Active Member


    Use $$RandomNumber
     


  4. Vineet Jindal

    Vineet Jindal Member


    But it creates same batches, there is no variation or difference in those batches while creating purchase entry...
    As Suggested by KNSivam Sir, I have use this logic
    $$Numsets: (ST/) +1
    But it is not working
     


  5. sattam

    sattam Active Member


    [#Field: VCHBATCH GRNName]

    Add : Option : VCHBATCH NrmlName KNS : @@IsPurchase

    [!Field: VCHBATCH NrmlName KNS]

    Set By Condition : $$InCreateMode : ($$RandomNumber:100000:999999)
     


  6. Vineet Jindal

    Vineet Jindal Member


    Sir, Thank you so much for your Immediate reply....Sir It worked for new entries only but not working in early entires which are already posted. All entries are about 100 + entries how can I give them auto batches while editing them.....All Entries are in Primary Batches now.... pls help me on this....

    Can I can send you the data and the code file to review the errors...
    Kindly Share your email so I will sent you the DATA and Source Code file.
     

    Attached Files:

    Last edited: Feb 22, 2024


  7. Himanshu-2002

    Himanshu-2002 Active Member


    Do it like this:

    [#Field: VCHBATCH GRNName]

    Add : Option : VCHBATCH NrmlName KNS : @@IsPurchase

    [!Field: VCHBATCH NrmlName KNS]

    Set By Condition : Yes: If $$IsEmpty:$$Value Or $$IsEqual:$$Value:"Primary Batch" Then $$RandomNumber:1:999 Else $$Value

    Note: You would need to re-accept purchase vouchers in order to update batch names
     


  8. Vineet Jindal

    Vineet Jindal Member


    1.How to calculate no of days from Purchase Voucher Date to Sale Voucher Date in report?
    2.How to calculate subtotals only of Stock Opening & Closing Qty, Rate & Value?

    Please Help......
     

    Attached Files:



  9. sivam

    sivam Active Member


    1. #SalesDateField - #PurchaseDateField
    2. I think you use Explode. So, we can't total it. If you need grand total, you should add values in Main line.
     


  10. Vineet Jindal

    Vineet Jindal Member


    Yes Sir I have use explode but unable to get grand total of opening and closing stock ....The value of opening and closing stock get double due to it takes totals including explode..
     


  11. Vineet Jindal

    Vineet Jindal Member


    Can I share you the anydesk screen
     


Share This Page