erpnext
erpnext copied to clipboard
Item and stock valuation Error
Description of the issue
I am using Erpnext version 13.5.1, and facing an issue with calculating the items valuation rate, I am using FIFO on the stock valuation method setting, it seems that it calculates the valuation as average, as an example, the image below shows an item which has only two purchase prices (117, 143) but it gives a faulty stock balance value and makes a weird drop on the incoming rate, as shown in the following image:
Context information (for bug reports)

On the third row, the stock qty is 5 but it gives stock valuation as if it is 1 piece (5 pcs * 117 rate, should be 585, but it shows 117). On the 4th and 5th rows, the valuation rate has become 23 and 70 which is faulty and does not exist in reality.
Output of bench version
erpnext 13.5.1
frappe 13.5.1
Steps to reproduce the issue
Observed result
Expected result
Stacktrace / full error message
(paste here)
Additional information
OS 20.04/ubuntu, Frappe install method, etc.
Faced this as well
This issue is still not fixed. We set default valuation method to 'FIFO' in Stock Settings. But system adopts an average valuation rate to value outgoing items instead of valuing them in a first-in-first-out manner.

This is a basic accounting feature, and customers/propsects will be very concerned.
@THEOSKaris
Consider you have an Item A which you have purchased first time with Qty as 10 with rate as 100. After two days you have purchased same item with Qty as 5 with Rate as 150.
Now the total stock available is 15 and Balance as 1000 + 750 = 1750
Now here the valuation rate is 1750 / 15 = 116.66
But at the time of issue / consumption system will follow the FIFO. Essentially valuation method applies when we do actual consumption / issue / dispatch. In stock ledger report we have added column called Value Change. If you divide value change / qty then you will get the rate in which it has been dispatched.

So here valuation rate shows the average value of available stock and not shows the rate at which the materials has been consumed. Maybe we can show one more column like Consumption Rate which will show the rate at which the materials has been consumed
Fixed https://github.com/frappe/erpnext/pull/33088