Try ERPNext Buy Support Partners Foundation

Issue In using FIFO as Valuation Method


We have added the default Valuation Method as FIFO in the Stock Settings. So for each item that we create the default valuation method will be FIFO.

We have created an item with opening stock 10 with a standard selling rate as Rs.5 each. At this instance the valuation rate is Rs 5 based on FIFO (checked in stock ledger).

Now for the same item, we have made another stock entry i.e. Material Receipt with 10 items and the rate of the item is Rs 10 each.

So, again based on FIFO the valuation rate should be Rs 10, but in stock ledger it shows as Rs 7.5

Now we try to create a Delivery Note (Note: In selling settings we’ve checked the checkbox for Validate Selling Price for Item against Purchase Rate or Valuation Rate)

So, when we make the Delivery Note to sell 10 items, based on FIFO the valuation of those 10 items should be Rs. 5, but we get the validation that the selling rate of Rs. 5 is less than the valuation rate of Rs. 7.5 and does not allow us to save the delivery note.

So, how can we ensure that the selected valuation method (in this case FIFO) is used and the valuation rate is based on that method?

For video of above issue you can refer to this link:

Hi, you could share screenshots. It will help others understand you better. Rgds

These are the screenshots of stock ledger ,as you can see the valuation rate in second transaction has been change to 7.5 here,As per FIFO it should be 5rs for available stock and 10 rs for incoming stock.


The 2nd screenshot you provided shows that your Balance Value (total cost of all your inventory) is Rs 150. This means the valuation rate of the first set of items was Rs 5, which the valuation rate of the second set was Rs 10.

Since you are selling 10 items, on FIFO basis, system will:

a) Cost the first 5 items at Rs 5, and
b) Cost the second 5 items at Rs 10.

I am not how Rs 7.5 came about; but still the selling rate of Rs 5 is less than both Rs 7.5 adn Rs 10. That’s why the validation is giving you warnings.

But as we know by method valuation rate for the first batch should be rs 5 and second batch should be 10
so we should able to sell the first batch item at rs 5 and second batch item at rs 10. So ideally when we sell the first batch item at the selling rate of Rs 5 , it should be allowed us to sell those items at Rs 5.

If we have a total of 20 items in the warehouse first 10 from 1st Batch(Rs 5) and second 10 from 2nd batch (Rs 10)
Now if we want to sell 15 items, then the prices of the should be first 10 items of Rs 5 and next 5 items of Rs. 10, As the FIFO method suggests.
As clearly the case this is not happening here.

Valuation is current value of total inventory. See screen shot.


Right ,But as we know for the first 10 items the valuation rate is 5rs as per FIFO,So System should allowed us to sell the item at same rate i.e. Rs 5 ,Which is not happening.

You have shown how the system calculates the valuation rate. Unfortunately, the calculation method you exhibit here shows that the system didn’t use FIFO but Average, which is a huge bug.

okay.So This is the bug in ERPnext so anyone is Resolving this issue from ERPnext team?

In case it is top priority, kindly raise an Issue on GitHub and bring it to their attention here:

1 Like

Which ERPNext version are you using. Found some hardecoded settings in V11 today. So maybe those codes ignore settings fro GUI.

I am currently using version 12.

Found this issue related stock accounting entry precision in V11. So go through the code of V12 and you may find the error.

It is a bug of business logic not necessarily of software as it may be behavi. Although we are big fans of ERPnext, we feel the business bugs do not get the priority deserved for a business software. For example multi-currency is somewhat of a mess.

Related to stock valuation this development so that valuation is per batch when batches are used as is logical should be finally incorporated to core.