Delivery note for specific batch pulling cost from different batch

Have a test instance on 12.1.15. Created 2 batches 123 and 456. Received 123 first at $1/unit cost and 456 later at $0.50/unit.

Did 2 delivery notes for batch 123 which left quantity in batch 123 and correctly pulled cost at $1/unit.

Did third delivery for batch 456 and this is reflected correctly in stock balance for each lot BUT it pulled cost from Inventory to Cost of Goods sold of $1/unit NOT $0.50/unit.

Is this an incorrect setup on our end? ERPnext appears to be doing FIFO on costing, but when you can specific ID batches that is incorrect.

Hi tonto,

ERPNext currently does not store incoming rate/valuation rare in the Stock Ledger separately for each Batch yet. However, I have developed this feature and I will contribute this to the core in the near future.

1 Like

Thank you for the good news. Approximate timing as have a company we want to migrate to ERPnext that needs that behavior.

I assume 1 week to 2 week.

1 Like

Thanks @saifi0102 for this feature. Have looked into how landed cost voucher can be added after the inventory has been sold? Currently, we backdate the landed cost voucher to the time when the particular inventory was received but not sold. Sometimes this is a very short window item received in system at 1 PM but sold at 1:15 PM leading to only 15 minutes. Its difficult to always find it accurately.

This scenario occurs when items are received and sold but the components of landed cost voucher (transport, customs fees etc.) are know a much later time.

This is quite off topic, however…

Landed Cost Voucher can be submitted anytime regardless of Purchase Receipt’s Posting Date and it works by revaluing and reposting the Stock Ledger and General Ledger of Purchase Receipt and it’s future related entries. There are limitations with ERPNext’s Stock Ledger such that Incoming Rate of Stock Entries(Transfer, Repack, Manufacture), Purchase Returns are not updated and Outgoing Rate of Sales Returns is not updated accordingly either.

@saifi0102 It appears this was never merged into core, is that correct? This is basic, logical and much needed functionality.

Did it include having the landed cost voucher be batch specific?

What is needed to get this behavior into core?

Thanks for the work.

It dealt with stock valuation being batch specific in general so, yes it did include LCV being batch specific.

To be honest, I don’t know what is needed to get this into the core, I’m more interested in customizing the core for business needs

Have not tested in latest release, but the github modification linked in this thread was never merged into core. Was this basic functionality incorporated another way?

This is merged in v14. feat!: batch-wise valuation rates by ankush · Pull Request #29804 · frappe/erpnext · GitHub

1 Like

Excellent. Thanks for update. Our companies are on ver 12 and had not planned to go to 14, but may have to as this is important to us.

The upgrade from 13 to 14 will handle giving all batches in inventory at that moment the current valuation I presume? and the new feature will only affect batches received after the date of the upgrade?

wow. That’s a great question. TBH we have to dig in the PR.