Question: Sales Return w/ Moving Average

Hello Frappe/ERPNext community,

I’m looking for some clarification on inventory returns when Moving Average is enabled. The test case below can be summarized as:

Line # Voucher Actual Qty Qty After Transaction Incoming Rate Valuation Rate Total Value
1577-1583 Stock Entry 5 5 $ 100.00 $ 100.00 $ 500.00
1584 Delivery Note -5 0 $ 100.00 $ 100.00 $ 0.00
1587-1593 Stock Entry 5 5 $ 200.00 $ 200.00 $ 1,000.00
1594-1600 Stock Entry 5 10 $ 300.00 $ 250.00 $ 2,500.00
1602-1618 Delivery Note 5 15 $ 250.00 $ 250.00 $ 3,750.00

My confusion is from line 1602-1618, I don’t understand why we use the last known valuation rate in the warehouse instead of the valuation rate at time of selling the product. I’m viewing a return as receiving goods at a specified cost. If the customer returns those 5pc, should the goods not be received into inventory at the price we paid $100 each?

Hi @dj12djdjs

The main reason ERPNext does not book sales returns at the original sale cost is that the Moving Average method is based on an overall averaged cost for the stock, not the cost of individual units over time. The method does not track costs per unit as distinct entries but recalculates a single average rate for each item.

In summary:

  • When a Sales Return is processed, the cost is based on the current moving average (not the original cost of the item at the time of the sale).
  • The average cost is recalculated after each return to maintain an updated cost across all units of stock

This approach helps to simplify inventory costing but means that you lose the granularity of tracking costs per individual transaction (sale/return) due the fact you are using Moving Average Valuation Method.

This ERPNext behavior may result in Chaos and effect on Accounting Reporting Drastically.

  • Accounting standards (e.g., GAAP, IFRS) require that revenues and their related expenses be matched in the same period.
  • When you reverse a sale, you should also reverse the exact COGS that was booked at the time of sale.
  • ERPNext’s method breaks this link, because the return is booked using the current average cost, which may be different.

This can overstate or understate inventory value and COGS, depending on how the average cost has moved.

  • Standard accounting systems allow you to trace back returns to the original invoice or delivery note and restore the same cost used at the time of the sale.
  • ERPNext, by not keeping this linkage in Moving Average, loses that traceability.