Inventory

How FIFO costing and cost of goods sold work

How Sentribooks values stock with FIFO cost layers, works out cost of goods sold on each sale, and shows profit by item, invoice and customer.

Updated · 3 min read

← Back to docs

Three purchases form three cost layers. A sale of 140 units uses all 100 units of the oldest layer and 40 of the next, giving a cost of goods sold of AED 1,460.

What FIFO means

FIFO stands for first in, first out. When you sell an item, its cost is taken from the oldest stock you still hold. It matches how most distributors move goods, and it keeps the value of the stock left on your shelf close to current prices.

Cost layers

Every time stock comes in, Sentribooks creates a cost layer: a quantity and what each unit cost.

  • A purchase invoice creates one layer per item. The unit cost is the line's net value, plus its share of service lines and landed costs, divided by the quantity.
  • Opening stock creates a layer at the starting cost you entered.
  • A sales credit note that restocks goods puts them back as a layer.

A worked example

You bought Basmati Rice 5kg three times:

LayerBoughtQuantityUnit cost
13 October10010.00
218 October8011.50
32 November12012.20

You invoice 140 units. Sentribooks takes all 100 from layer 1 and 40 from layer 2:

FromUnitsUnit costCost
Layer 110010.001,000.00
Layer 24011.50460.00
Cost of goods sold1401,460.00

That leaves 40 units at 11.50 and 120 at 12.20: stock worth 1,924.00. The invoice posts 1,460.00 from Inventory to Cost of Goods Sold. If you sold the 140 units at 15.00 each, revenue is 2,100.00 and gross profit is 640.00.

See it in the COGS Layers report

Open Reports > COGS Layers. Choose a period and one of five views:

ViewWhat it answers
Purchase LevelFor each purchase: how much is left, what it cost, and the profit made on what was sold from it.
Sales LevelFor each sale: which cost was used, the cost per unit, profit and gross margin. Also what was returned to suppliers or lost to shrinkage.
Item LevelProfit and margin by item.
Invoice LevelProfit and margin by invoice.
Customer LevelProfit and margin by customer.

Filter by category, subcategory or SKU to narrow it down.

What else uses up layers

Shrinkage, stock counts and quantity returns to a supplier use the oldest layers in the same way, at their cost.

When a purchase cost changes after a sale

By default, a purchase line's cost is locked once stock from it has been sold, because that cost is already in your cost of goods sold.

Two things can change it. An admin can switch on Allow PO cost edit after COGS consumption. And linking a landed cost bill always re-prices the layers. In both cases Sentribooks updates the cost of goods sold on every invoice that used that stock, so margins stay true.

Common questions

Does Sentribooks use FIFO or weighted average cost?

FIFO. Each sale takes its cost from the oldest stock still on hand.

Where do I see the cost of an item?

In Reports > COGS Layers. The Purchase Level view lists each layer with its unit cost and the quantity remaining.

Does freight affect cost of goods sold?

Yes, if you link the freight bill to the purchase as a landed cost. It raises the unit cost of that stock, and so the cost of goods sold when it is sold.

How is gross margin calculated?

Revenue less the FIFO cost of the units sold, as a percentage of revenue. The COGS Layers report shows it by sale, item, invoice and customer.