Costing Internals
Watch this as a presentation — 1 on this page, slides with narration.
You are the stock controller at GadgetSphere, and somebody has just asked you why the cost of a laptop moved. Perhaps the margin on last week’s sales changed after you had already reported it, or the Penang branch shows a different average from Klang Valley, or the month-end cost of sales does not match what the margin report said. This page explains where every cost figure comes from, when it is written, what makes it jump, and which checks BigLedger leaves to you. It is an explanation to read once and come back to; the one procedure in it is correcting a wrong average. About fifteen minutes.
Meet GadgetSphere
In March, branch GS-KV-01 receives 40 units of an ultraportable laptop on a purchase invoice at RM 3,000 each, then 60 more on 17 March at RM 3,300. During the month it sells 70, one at a time. Three numbers come out of that month, and all three are correct:
| Figure | Value | Where you see it |
|---|---|---|
| Moving-average cost | RM 3,180 a unit | The cost on each cash bill line after 17 March, and the item’s Costings tab |
| FIFO cost of the 70th sale | RM 3,300 | The FIFO cost on that line |
| Cost of sales for March | RM 222,600 (moving average) or RM 219,000 (FIFO) | The cost-of-sales journal written by Month End Processing |
They differ because they are worked out by three different mechanisms. The rest of this page is those three mechanisms.
Where a cost figure comes from
Every stock-moving document you finalise adds one movement per item line to the item’s stock history, in date order. A cost is always worked out from the movement before it: the new average is the old average adjusted by this movement. That single idea explains most surprises.
The cost is not written when you press FINAL. A background job writes the movement, a second works out its cost and copies it back onto your document line, and a third (where FIFO is switched on) adds the FIFO figures. So:
- A document viewed seconds after FINAL can show no cost yet. Look again a moment later. If it stays empty, the document did not move stock (a sales order, a quotation) or its job failed; the Stock Balance related-applets page lists which documents move stock.
- Two averages exist: one per location and one per company. The figure copied onto documents, used for closing stock and shown on the item’s Costings tab is the company average. The MA Price column on the Stock Balance screen is the location’s average. Penang and Klang Valley can show different MA Prices for the same laptop while every invoice carries the same company figure. Neither is wrong.
- A document in a foreign currency moves stock at its ringgit value. When you finalise a USD purchase invoice from a Singapore distributor, BigLedger makes a ringgit copy of it behind the scenes, converted at the exchange rate on the document, and that copy moves the stock. The cost worked out on the copy is converted back and shown on your USD lines. So the rate on the document at FINAL sets the stock cost. A wrong rate becomes a wrong average, and nothing later corrects it.
Moving average: the cost most screens show
The average is total stock value divided by quantity on hand. What matters is which documents change the value and which only move stock at the value it already has.
Documents that change the value, each at its own amount: purchase invoice, purchase return, stock adjustment, GRN stock-in and GIN stock-out, consignment GRN and GIN, and purchase trade-in.
Documents that move stock at the current average: sales invoice, cash bill, sales return, stock transfers, delivery orders. A sale takes stock out at RM 3,180 and leaves the average where it was. A sales return comes back at today’s average, not at the cost it left with.
With GadgetSphere’s numbers:
- After the two receipts: RM 120,000 + RM 198,000 = RM 318,000 over 100 units, which is RM 3,180. The 70 sales each take out RM 3,180 and the average does not move. That is why an average stays flat between purchases and jumps on each receipt.
- If you instead return 5 of the RM 3,300 laptops to the distributor while 100 are on hand, the return leaves at its own price: RM 318,000 − RM 16,500 = RM 301,500 over 95 units, which is RM 3,173.68. A purchase return moves the average whenever its price differs from the average.
- When the quantity or value reaches zero, the last average is kept. If the branch sells out and a customer then returns one laptop, it comes back at RM 3,180, not at zero.
What makes an average jump
When somebody asks why a cost moved, it is almost always one of these. Most of them are a document somebody finalised, so the item’s Stock Card tab (its movement history) will show you which one.
| Cause | What you see | Where to look |
|---|---|---|
| A receipt at a very different price, often a wrong unit or a missing discount | The average steps up or down on that date | The purchase invoice line’s unit price |
| A stock adjustment entered with the wrong amount, or with none | A step on the adjustment date; a zero-amount adjustment of 50 units dilutes the average | The adjustment’s amount column |
| Opening stock loaded at zero cost | The first receipt does not set the average, it blends with the free units: 50 at zero plus 40 at RM 3,000 gives RM 1,333.33 | Your go-live adjustment |
| A foreign-currency purchase at a wrong exchange rate | A step on the invoice date, out by the rate error | The rate on the document header |
| Selling more than you have | Sales carry on at the last average while stock is negative, and the next receipt then blends against a negative quantity, which can give an average far from anything you paid | Stock Report › Stock Balance Pricing Report with Option Balance set to NEGATIVE, one location at a time. The Stock Balance screen never shows a negative row |
| A backdated document | Costs change on documents dated after it, including ones you already reported | Next section |
| A Reset MA | A deliberate step to the value somebody chose | The Reset MA listing |
Two more figures sit beside the average. Last purchase cost is simply the unit price on the most recent purchase invoice, not an average of anything. Weighted average is a prior-month figure, refreshed only by a stock balance refresh; the item Costings tab explains how old it can be. LIFO, manual and replacement cost are never filled in on stock movements, whatever the screens offer.
A backdated document rewrites costs you have already seen
Suppose that on 25 March somebody finalises a purchase invoice dated 10 March for 20 laptops at RM 2,900. BigLedger inserts it into the history on 10 March and replays every later movement from there. Every sale after 10 March gets a new average, and the cost printed on each of those sales documents is rewritten. The margin you reported on 20 March is no longer the margin the system shows.
What it does not do is repost anything. A sales journal never had a cost line to change (see Cost of sales below), so the ledger only feels a backdated document when cost of sales is next worked out for that month. The replay runs a moment after FINAL; until it finishes, the balance still shows the old figure.
This is the right design for a business that receives invoices late. The alternative, refusing a backdated purchase, would leave the stock and the supplier balance wrong instead. But the system cannot know which months you have already reported, so controlling backdating is your job, and the hand-over is at the end of this page.
FIFO — a register of receipts, consumed oldest first
FIFO (first in, first out) is not derived from the average. It is a separate record of every receipt, consumed oldest first:
- Receipts that FIFO counts: purchase invoice, sales return, positive stock adjustment. Each is recorded at its own line amount divided by its quantity. A GRN stock-in, a transfer in, or opening stock loaded any other way is not a FIFO receipt.
- Issues that FIFO counts: sales invoice, cash bill, purchase return, negative stock adjustment. Each takes the oldest receipts still open for the company, across all its locations.
- Every issue line gets two FIFO figures: what this line’s units actually cost (the 70th sale: RM 3,300), and the average of what is still on hand.
GadgetSphere’s 70th sale took its unit from the RM 3,300 receipt, because sales 1 to 40 used up the RM 3,000 one. The moving average on the same line says RM 3,180. They are answering different questions, and they are not expected to agree.
Four things to know before you rely on FIFO:
- FIFO runs only where it is switched on for your BigLedger account. If the FIFO columns are empty on your sales, it is not switched on. Ask BigLedger support.
- A shortfall is silent. If a sale takes more than the open receipts hold, for example because opening stock was loaded in a way FIFO does not count, the uncovered units get no FIFO cost and no error appears.
- A sales return re-enters FIFO at the return line’s own amount. For a return, that is normally the price refunded to the customer, not what the laptop cost. Only a FIFO rebuild re-costs a return at the original sale’s FIFO price.
- A backdated document marks FIFO for rebuilding but does not rebuild it. The moving average replays on its own. FIFO does not: the item is only flagged, and the rebuild runs when somebody starts it. It is a repair tool, and we have not found it set to run on a schedule for any company. Until it runs, the FIFO costs after the backdated date are the ones worked out in the original order.
LIFO does not work. The option appears on screens and reports, but nothing fills it in.
Cost of sales: worked out at month end, not on each sale
No sales document posts a cost line. A cash bill’s journal holds the receivable, sales, discount, tax and exchange lines, nothing more. During the month, purchase invoices post to your Purchases account and a GRN stock-in to your inventory-not-invoiced account. Of the documents on this page, only stock adjustments and Reset MA documents post to the stock account itself.
Cost of sales arrives when you run Month End Processing in the Financial Report applet. Each time you create or re-process a month, it deletes that month’s earlier cost-of-sales journal and writes a new one:
cost of sales = opening stock + purchases (net of purchase returns) − closing stock
The journal clears the Purchases and Purchase Returns accounts and puts the difference into cost of sales, using the company’s Default GL Codes. It does not set the stock account to your closing stock: it moves it by closing stock minus opening stock, less whatever the month’s stock adjustments and Reset MA documents already posted to it, so the account’s movement over the month comes to closing minus opening. Both figures are worked out from the stock history when you run the close, not read from the account. So the account ends the month at closing stock only if it started the month at opening stock. Any earlier difference, such as something else coded to the stock account or an earlier month not re-processed after a back-dated document, carries forward into every later month. Stock report versus the stock account on the balance sheet shows how to tie the two out. Opening and closing stock are, for each item, the quantity on hand at the company multiplied by a cost. Which cost is set once per company in Inventory Closing Base On: moving average (the default when nothing is chosen), weighted average, FIFO, LIFO, replacement or manual. A manual closing stock figure entered for the month overrides the calculation.
GadgetSphere’s March, starting with no stock:
- Moving average: RM 318,000 − (30 × RM 3,180 = RM 95,400) = RM 222,600.
- FIFO: RM 318,000 − (30 × RM 3,300 = RM 99,000) = RM 219,000.
The RM 3,600 between them is the whole reason the setting exists, and choosing between them is a decision for your finance manager and your auditor, not a technical one. Three cautions:
- FIFO closing stock uses the last movement’s price, not the value of what is left. Each item is valued at quantity on hand × the per-unit FIFO cost of that item’s last movement before the date. For GadgetSphere that happens to be right: the last sale took a RM 3,300 unit, and all 30 left are RM 3,300 units. But if the month’s last sale had been 4 units, 2 at RM 3,000 and 2 at RM 3,300, its per-unit cost is RM 3,150, and 30 units that all cost RM 3,300 would be valued at RM 94,500.
- LIFO, replacement and manual value closing stock at zero, because nothing fills those costs in. Cost of sales then equals all of the month’s purchases.
- Stock adjustments and Reset MA documents in the month. They post straight to the stock account, and closing stock also includes their effect. So under the calculation above, the stock account ended the month above closing stock by the amount of any adjustments. The backend was changed on 24 September 2026 to bring those postings into the same calculation, so the stock account now lands exactly on closing stock. A month processed before your company received that change, and not processed again since, can still carry the difference; processing it again rewrites the journal under the new rule.
Serial numbers, batches and bins
Serial numbers, batch numbers and bins are recorded under each movement, but they carry no cost of their own. A laptop with serial number SN-4471 costs the item’s average, the same as every other unit. If you need what one particular unit cost, for a warranty claim or an insurance loss, the answer is the unit price on the purchase invoice that received that serial; the serial numbers page shows how to trace it.
A serial is identified by its exact text. sn-4471, or SN-4471 with a trailing space, is a different serial number, with its own balance.
Correcting a wrong average: Reset MA
By the end of this procedure the laptop’s company average at GS is the figure it should be, the balance sheet reflects the change, and you know which journal did it. Ten minutes, and it should be done by finance only; the Stock Adjustment applet page explains how to hide the menu from everyone else.
Before you start, check that the company has a Reset MA default GL code under Chart of Account > Company > Default GL Codes, or decide which account you will pick on the document. If neither is set, the cost still changes but the journal is refused, and nothing on screen names the missing default as the cause.
Stock Adjustment → Reset MA → company, item and date → type the new unit cost (the other three cost boxes fill in) → Save → FINAL.
What FINAL does:
- Changes the company average, by adding a zero-quantity movement worth the adjustment (new total value − current total value). The next sale carries the new cost. If there is no stock on hand, the new unit cost is kept for the next receipt to start from.
- Posts the journal at once: the adjustment amount between the stock account and the reset account. Raising the cost debits stock; lowering it credits stock.
- Records each location’s share under Reset MA By Location. This is a record only.
Three things it does not do:
- It does not change any location’s average. The MA Price on the Stock Balance screen stays where it was. Check the item’s Costings tab, which shows the company figure.
- It does not re-cost documents already finalised. It changes cost from its date forward. A reset dated in the past is a backdated movement and replays later costs, as described above.
- It cannot be posted twice. A second FINAL is refused with a message that the reset has already been posted.
For many items at once use File Import Reset MA. A document line flagged for an automatic rebate adjustment creates and finalises a reset on its own, and those appear under Stock Adjustment by Reset MA.
The parts of the job BigLedger leaves to you
The software keeps the arithmetic. These parts of costing were a person’s job before BigLedger, and they still are. Each one is something the product does not do, handed to whoever does it instead.
- Review cost movements before the month is closed. BigLedger does not flag an average that jumped. Who: the stock controller. When: monthly, before Month End Processing. How you know it is right: for your top-selling items, the Costings tab average sits within a few percent of the last purchase cost. Anything further out has a cause in the table above, and you can name the document.
- Control backdated documents. BigLedger accepts them and quietly re-costs later sales. Who: the finance manager sets a cut-off (for example, nothing dated in a month already reported without their approval), and the purchasing clerk follows it. When: at every invoice entered after its month. How you know it is right: after a late document, re-run Month End Processing for the affected month and re-run the margin report. Both now agree with each other.
- Ask for a FIFO rebuild when FIFO is your basis. Nothing runs it on its own. Who: your system administrator, through BigLedger support. When: after backdated documents or sales returns, before the month is closed on FIFO. How you know it is right: FIFO costs on sales after the backdated date change, and returns carry the original sale’s FIFO cost.
- Check the exchange rate before finalising a foreign-currency purchase. Nothing questions it, and it becomes the stock cost. Who: whoever finalises supplier invoices. When: before FINAL. How you know it is right: the ringgit total on the invoice matches the supplier’s amount at your bank’s rate for that day, within cents.
- Watch for negative stock. BigLedger does not block selling ahead of receiving, and the Stock Balance screen will not show you the result: it never lists a zero or negative balance, so a branch that has gone negative looks clean there. Who: branch supervisors, with the stock controller. When: daily. How you know it is right: in Stock Report, open Stock Balance Pricing Report, pick your branch’s location and set Option Balance to NEGATIVE: at close of day it returns no rows. Each row is an item, with the negative balances of the locations you picked added together and no location column, so pick one location per run when you need to know where. Then open the item on Stock Movement Report for that location to find the sale that overshot.
- Load opening stock with a cost, in a form FIFO counts. Nothing warns you of zero-cost or FIFO-invisible opening stock. Who: whoever runs go-live. When: once, before the first sale. How you know it is right: pick three items after loading and see a non-zero average and FIFO cost on their Costings tabs.
- Separate who resets a cost from who approves it. Reset MA has no approval step. Who: one person prepares the reset with the evidence in its remarks, and a second person reviews the journal. When: every reset. How you know it is right: every Reset MA journal in the month has remarks that explain it and a reviewer who can say who asked for it.
- Reconcile the stock account to closing stock. BigLedger writes the journal but does not compare the result. Who: the accountant. When: after each Month End Processing. How you know it is right: the stock account’s balance at month end equals the closing stock figure the cost-of-sales journal used, or differs by an amount you can name.
What success looks like
After a Reset MA, open the item’s Costings tab: the company moving average is your new cost. Open the Stock Card tab and find the reset movement, with quantity 0 and the adjustment amount. Open the journal for that date: two lines for the same amount, stock against your reset account. At month end, check that the stock account balance equals closing stock. Five minutes.
Common mistakes
| Mistake | What you see | Fix |
|---|---|---|
| Expecting a cost line on a sales journal | No cost of sales until month end; margin looks wrong mid-month | Cost of sales is periodic. Run Month End Processing |
| Reading the Stock Balance MA Price after a Reset MA | The old figure, because that column is the location’s average | Read the item’s Costings tab, which shows the company average |
| Loading opening stock at zero cost | The first receipt blends with free units, and the average is far too low | Reset MA to the right cost, then check the Costings tab |
| Choosing LIFO, manual or replacement for closing stock | Closing stock zero; cost of sales equals all purchases | Use moving average, weighted average or FIFO |
| Choosing FIFO for closing stock where FIFO is not switched on | Closing stock zero | Leave the basis on moving average, or have FIFO switched on and rebuilt first |
| Backdating a purchase into a reported month | Margins on later sales change after you reported them | Follow your cut-off, then re-run Month End Processing for that month |
| Expecting a sales return to come back at its original cost | It returns at today’s average, and in FIFO at the refunded amount | That is the rule. Only a FIFO rebuild re-costs FIFO returns at the original cost |
| Finalising a Reset MA with no Reset MA default GL code and none on the document | The cost changes but no journal appears, and no message names the cause | Add the default under Default GL Codes, then post the journal by hand for the reset already finalised |
Related documentation
- Related applets — Stock Balance — which documents move quantity, VOID and backdating
- Stock Balance applet — the enquiry screen, and why its MA Price is per location
- Item maintenance — the Costings tab — the company cost figures and how old each can be
- Stock Adjustment applet — the Reset MA screens and who should see them
- Financial Report applet — Month End Processing and the cost-of-sales journal
- Stored figures and live figures — which numbers are snapshots and which are recomputed
- Stock management guide — opening balances and the first reset