Station 6 of 10
Inventory and costing in ERPNext
What you leave this station with
A numerically measured difference between the two costing methods on your own data, and the ability to trace any figure in an inventory valuation report back to a stock ledger line.
This station answers the question left hanging at station four and station five: where exactly did the cost of goods sold figure come from?
The answer is not an accounting footnote. One line on an item card changes your margin by hundreds in the example you are about to run — and a company that cannot say which method it uses, or why, is managing its margin by accident.
The stock ledger is the source document
Before any arithmetic, understand where the truth lives. Every stock movement in ERPNext writes a line in the stock ledger: date, item, warehouse, quantity in or out, the valuation rate after it, the running balance, and the document that created it.
That ledger is the only source of truth for anything to do with inventory. The stock valuation report is built on it, the stock account balance on the balance sheet is built on it, and cost of goods sold is built on it.
Hence the practical rule you leave this paragraph holding: when an inventory figure is disputed, do not argue about reports — open the stock ledger and read the lines. Every number in every inventory report resolves to a line here, and someone who knows that diagnoses in minutes what costs everyone else a day.
The two methods, and the difference in figures
ERPNext offers two valuation methods on the item card:
- First in, first out — units are issued in the order they arrived, so what leaves today carries the cost of the oldest remaining consignment.
- Moving average — average cost is recomputed at every receipt, and what leaves carries the average at that moment.
The description is easy and teaches nothing. Figures teach. Run these three movements on one item, once under each method, on two identical items that differ in this single line:
- Buy 10 units at 100 each.
- Buy 10 units at 140 each.
- Sell 12 units at 200 each — revenue of 2,400.
The result:
| Method | Cost of goods sold | Margin | Closing stock value (8 units) |
|---|---|---|---|
| FIFO | 10×100 + 2×140 = 1,280 | 1,120 | 8×140 = 1,120 |
| Moving average | 12×120 = 1,440 | 960 | 8×120 = 960 |
A margin difference of 160 on twelve units, with identical purchases, identical sales and the same system. Scale that to a real company’s volume and you understand why this line is not left to a default.
And read the last column, because it carries the deeper point: the difference is not lost, it is deferred. What did not appear in today’s cost is sitting in stock valuation waiting to appear in tomorrow’s. The method does not change lifetime profit; it changes which month it appears in. That alone is enough to change a decision.
Which one to choose
| Situation | The method that fits | Why |
|---|---|---|
| Items with expiry dates or batch numbers | FIFO | It matches the actual physical flow |
| Homogeneous goods mixed in a silo or tank | Moving average | Tracking “which unit” has no meaning to begin with |
| Sharply volatile purchase prices | Moving average | It stops margin swinging month to month |
| You want margin to reflect your most recent costs | FIFO does not suit | It puts your oldest cost into today’s profit |
The governing rule, and the one enforced on real projects: the method is chosen once, documented, and never switched after the item has movement. Changing it on an item with a balance means a retrospective revaluation — a legitimate procedure in rare cases and a catastrophic one when performed without understanding.
Perpetual against periodic
You enabled perpetual inventory at station three. Now understand what you chose:
| Perpetual | Periodic | |
|---|---|---|
| An entry with every stock movement | Yes, automatically | No |
| Inventory value on the balance sheet | Correct at any moment | Correct only after a count |
| Cost of goods sold | Computed movement by movement | Derived at period end |
| What it demands of the team | Discipline about document timing | A disciplined physical count |
The verdict: perpetual is the correct default for any company whose inventory is worth managing. Periodic is chosen when the team cannot enter movements on time — which is a decision about the team’s capacity, not the system’s.
Physical counts and their adjustment
A count always reveals a difference between the book and reality. The adjustment in ERPNext is entered through a dedicated document that sets quantity, valuation, or both.
And here is the rule many people do not know: a count difference goes to the income statement, not the balance sheet. It is posted to the stock adjustment account as an expense or an income of the period.
Which means a shortage found at the count reduces the month’s profit directly. Understand that and you understand why the finance director cares about the count more than the storekeeper does, and why a count is never run after the period has been closed.
Run it yourself: enter an adjustment with a two-unit shortage, read the entry, and read its effect on the income statement. One line of expense that nobody purchased.
The test performed at every close
This is the check that separates people who understand the system from people who operate it:
The stock account balance in the general ledger must equal total inventory valuation in the valuation report — at the same date.
If they agree, the two ledgers are consistent. If they diverge, the cause is on a short list: a movement entered with a date before the close after the report was pulled, a manual journal written straight onto the stock account, or a document cancelled in part.
The manual journal on the stock account is the first thing to look for, and it is forbidden in any disciplined company. The stock account is not an account you write into; it is a reflection of the stock ledger. Write into it by hand and you have detached the two ledgers, and nobody can explain the difference afterwards.
Negative quantity
ERPNext can either prevent a negative balance or permit it. The switch looks technical and its effect is purely operational.
Permitting it makes the system flexible — a sale can be recorded before its receipt is entered. The price is that valuation temporarily loses its meaning, because the system is issuing at a cost for goods that have not arrived.
Preventing it imposes discipline: nothing leaves that did not enter. The price is that sales stop when a receipt entry is late.
The rule on projects: prevent, unless the team proves it cannot. Those who allow it “temporarily” at go-live keep it for years, then ask why stock valuation reconciles to nothing.
The acceptance test for this station
- Run the three movements above on two items differing only in costing method, and fill the table with your own figures. That table is a portfolio piece.
- Open the stock ledger after every movement and read the valuation rate and the running balance.
- Compare the stock account balance against the valuation report at the same date and confirm they agree.
- Enter a count adjustment with a shortage and read its effect on the income statement.
- Transfer quantity between two warehouses and confirm the total did not change while each warehouse balance did — and that the general ledger reflects the transfer between the two warehouse accounts.
Inventory logic independent of any product is set out in inventory and costing. Where this product sits against its alternatives on inventory and manufacturing is detailed in the ERPNext guide.
What comes next
You have correct movements and a valuation whose source you can name. The next station closes the month: bank reconciliation, the close checklist, and the intermediate accounts whose balances each name their own problem — and then reading the financial statements with confidence.
