Where the cost on the Costings tab came from — transcript
Play this as a presentation — one slide per step, with the same narration. Every word of every step is on this page.
This lesson is for whoever gets asked why a cost is wrong. The most common question anyone puts to a finance system is not how to do something — it is where a number came from. The Costings tab on an item shows five or six cost figures that this screen does not calculate, and in about thirteen minutes you will know which process last wrote each one and how old it is.
Step 1 — Start from the fact that the tab computes nothing
After this step you will ask a better first question. Open an item’s Costings tab and you see a row per company with several cost columns. None of it is calculated when you open it. The tab reads one stored row per company from a stock-balance table and prints the columns it finds. Every figure there is a snapshot, written at some earlier moment by whichever process last touched that row. So when somebody says the cost is wrong, the useful question is not what the tab is doing — it is which transaction last moved this item for this company, and when. The tab is a window, not a calculator.
Reference: Doc Item Maintenance — The Costings tab
Step 2 — Trust the moving average as of the last finalised document
After this step you will know exactly how current one figure is. The moving average is maintained by the stock balance processor, and it runs on every inventory transaction line for that item and that company. Each line carries the running quantity and the running average forward from the line before it, so the figure on the tab is the tip of a chain. That makes it current as at the last finalised document that moved this item — and it also means a document still in draft has moved nothing and is not in that figure. For GadgetSphere, an item received into the Klang Valley warehouse this morning on a finalised goods receipt is in the average; the same receipt left unfinalised is not.
Reference: Doc Item Maintenance — The Costings tab
Step 3 — Read the weighted average as a last-month figure
After this step you will stop expecting one column to move. The weighted average is written by one thing only: a Refresh Stock Balance run. Nothing else touches it, so if nobody has run a refresh on your tenant it can be arbitrarily old. Worse for anybody reading it as a current cost, the run deliberately computes it from transactions dated before the first day of the current month. This month’s purchases are not in it and cannot be, however many refreshes you run. That is a reasonable design for a month-end valuation and a poor one for pricing a deal today. If a buyer is quoting against this column in the middle of the month, they are quoting on last month’s cost.
Reference: Doc Item Maintenance — The Costings tab
Step 4 — Expect moving average and FIFO to disagree
After this step you will stop treating a difference as an error. FIFO is maintained by a different processor, from a different mechanism — the first-in-first-out register baskets, updated on purchase-side and sales-side documents — and it is kept independently of the moving average. Two different methods on the same movements give two different answers, and neither is a corruption of the other. A rising cost of memory over a quarter will show a FIFO cost below the moving average and that is arithmetic, not a fault. Last purchase cost is a third thing again: written straight by the stock-balance processor when the line is a purchase, and it is simply the last price actually paid, not an average of anything.
Reference: Doc Item Maintenance — The Costings tab
Step 5 — Know the four columns that are empty everywhere
After this step you will not build anything on sand. LIFO, manual cost, replacement cost and the landed-cost columns appear on the tab with headings and cells like all the others. Nothing in the current build writes any of them: the LIFO call inside the costing processor is commented out, and the rest have no writer at all. This was measured across all ninety tenants — of roughly four hundred and forty thousand company stock-balance rows, those columns are zero or empty on every single row, in every tenant. A valuation, a margin report or a sell-below-cost rule built on them will compute quietly and be wrong quietly. Moving average, FIFO and last purchase cost are the three that carry real numbers.
Reference: Doc Item Maintenance — The Costings tab
Step 6 — Answer the cost that changed for a closed month
After this step you can settle an argument that recurs every month end. Somebody reports on a period, comes back a week later, and the cost is different. The usual cause is a back-dated document: when one is finalised, the moving-average chain for that company is rebuilt from the affected transaction forwards, because every later line’s running average was computed from a balance that has now changed. That is correct behaviour and the alternative would be worse — a chain that ignored the back-dated receipt would be permanently wrong from that point on. The move is to find the back-dated document before assuming the figure is broken. And remember the chain only ever runs at finalise, never at save, which is why nothing on the item screen changes a cost.
Reference: Doc Item Maintenance — What happens when you press Save
How the steps fit together
flowchart TD
s1["Step 1 — Start from the fact that the tab computes nothing"]
s2["Step 2 — Trust the moving average as of the last finalised document"]
s3["Step 3 — Read the weighted average as a last-month figure"]
s4["Step 4 — Expect moving average and FIFO to disagree"]
s5["Step 5 — Know the four columns that are empty everywhere"]
s6["Step 6 — Answer the cost that changed for a closed month"]
s1 --> s2
s2 --> s3
s3 --> s4
s4 --> s5
s5 --> s6
Check yourself
Three to five questions on what you just heard. Every correct answer links to the page that makes it correct, so you can check the source, not just the mark.
Answer key
- Reads one stored row per company and prints its columns — every figure is a snapshot written earlier — Doc Item Maintenance — The Costings tab
- It is written only by a Refresh Stock Balance run, and that run uses transactions dated before the first day of the current month — Doc Item Maintenance — The Costings tab
- Nothing is wrong — they are maintained by different processors from different mechanisms and are not expected to agree — Doc Item Maintenance — The Costings tab
- No — replacement cost, manual cost, LIFO and the landed-cost columns are empty on every row in every tenant measured — Doc Item Maintenance — The Costings tab
- A back-dated document that was finalised since, which rebuilds the moving-average chain from that point forward — Doc Item Maintenance — The Costings tab
Next: Loading a catalogue without loading a mess · Back to the series · Play this as a presentation