frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
17.76k stars 6.77k forks source link

If Item has Serial No then valuation is not calculated as set in configuration. #39472

Open chrisdent opened 6 months ago

chrisdent commented 6 months ago

Information about bug

Created a new instance and set Stock Settings with Moving Average Created a new item with Serial No. and set Valuation method as Moving Average. Created a two different Purchase Orders and Purchase Receipts each with a different buying rate, everything ok Created one Sales Order and everything ok. Created a Delivery Note and when when looking into the accounting ledger the valuation method is calculated as FIFO and not the Settings value Moving Average.

Module

stock

Version

ERPNext: v15.10.1 Frappe Framework: v15.10.0

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

No response

rohitwaghchaure commented 5 months ago

In the case of serial numbers/batches, the rate at which you inward the serial numbers/batches should match the rate used during outward transactions

As the system uses the same rate it's not a FIFO method.

For moving average don't use the serial or batches.

chrisdent commented 5 months ago

Thank you for your prompt response. I appreciate the clarification regarding the use of serial numbers/batches and moving average valuation in the system.

However, I would like to highlight that our business operations are subject to specific requirements from the government fiscal institution, necessitating the use of serial numbers and batches for traceability.

While I understand that the system recommends matching rates for serial numbers/batches during inward and outward transactions, it is crucial for us to adhere to the Moving Average valuation method as specified in the Stock Settings.

Is there a way we can ensure that the system accurately calculates valuation using the Moving Average method while still incorporating serial numbers and batches as required by our regulatory obligations? Your assistance in resolving this matter is highly appreciated.

Thank you for your understanding and support.

moizsami commented 3 weeks ago

Hi, is there any solution for this? I just moved some of my sites to version 15 and now I got to know that valuation rate is messed up if you have batches and system is using Moving average.

In version 14 there was no issue, it was calculating as expected. After upgrade we are facing issues in Manufacturing entry as I think its either calculating just based on the batches selected and not getting the overall average rate.

@rohitwaghchaure Kindly please can you share your input how to tackle this now. Alot of v15 features are very useful so dont want to rollback. at same time how to convince customer that suddenly the valuation rate will be calculated differently during the entries.

If you can explain briefly also how the calculation is done and why it is correct it might help me ..

chrisdent commented 3 weeks ago

We did this:

https://github.com/frappe/erpnext/pull/41952/files