How FIFO and Moving Average valuation works

Stock valuation in ERPNext is the process of calculating the worth of inventory based on the valuation method set for the items in the system. It tracks and updates the value of inventory as items are bought, manufactured, or sold. ERPNext primarily supports the following stock valuation methods:

FIFO

In FIFO (First In, First Out) stock valuation, the oldest stock is always used first when items are sold or consumed. This method ensures that the cost of goods sold (COGS) reflects the cost of the earliest inventory on hand. Here's how it works step-by-step

FIFO
  1. Initial Purchase

    • You buy 10 units at a price of $10 each.
    • This means you have 10 units at $10, with a total value of $100.

    Stock Ledger:

    • Quantity: 10 units
    • Valuation: $100
  2. Second Purchase

    • You buy another 10 units, but this time the price is $12 each.
    • Now you have 10 units at $10 and 10 units at $12.

    Stock Ledger:

    • Quantity: 20 units (10 units at $10, 10 units at $12)
    • Valuation: $220 ($100 for the first lot + $120 for the second lot)
  3. Sale of 5 Units

    • Now, you sell 5 units.
    • Using FIFO, the system will remove the units that were purchased first, meaning the 5 units from the first lot at $10 each.
    • So, the cost of goods sold (COGS) for this sale would be 5 x $10 = $50.

    Remaining Stock:

    • Quantity: 15 units (5 units at $10 and 10 units at $12)
    • Valuation: $170 ($50 for 5 units at $10 + $120 for 10 units at $12)
  4. Sale of 10 More Units

    • If you sell 10 more units, the system will first
    • -
Moving Average

Moving Average

In the **Moving Average** stock valuation method, the value of inventory is recalculated every time new stock is received, such as through purchases or production. The updated valuation reflects the average cost of the items in stock, including the newly received items

New stock value = Old Stock Value + New Purchase Value / Total Quantity After Purchase

  • Old Stock Value = Total value of the stock before the new purchase.
  • New Purchase Value = Cost of the newly purchased units.
  • Total Quantity After Purchase = The total number of units in stock after the new purchase is added.

Example: Initial Stock: You have 10 units in stock at $10 each.

Total value of current stock = 10 units × $10 = $100. New Purchase: You purchase 10 more units at $12 each.

Value of new purchase = 10 units × $12 = $120. New Average Stock Value:

New total stock quantity = 10 units (existing) + 10 units (new) = 20 units. New total stock value = $100 (old stock value) + $120 (new purchase value) = $220. New average cost per unit = $220

New average cost per unit = 220 / 20 = 11