> For the complete documentation index, see [llms.txt](https://docs.flowretail.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowretail.com/docs/day-to-day-operations/prices/how-cost-price-is-calculated.md).

# How cost price is calculated

What moves a product's average cost, what leaves it alone, and how the weighted average is worked out.

A product's **average cost** is what Flow Retail thinks your stock is worth. It is held per warehouse, it moves only when stock comes *in*, and it is a weighted average rather than FIFO.

## Three prices, three questions

| Price          | Question it answers                      | VAT          |
| -------------- | ---------------------------------------- | ------------ |
| Sales price    | What does the customer pay?              | Includes VAT |
| Purchase price | What does the supplier charge?           | Excludes VAT |
| Average cost   | What is the stock I hold actually worth? | Excludes VAT |

The purchase price is what you negotiate and maintain. The average cost is *derived* — you rarely set it directly, and it is the one that drives margin.

## How the average moves

When stock arrives, the incoming cost is blended with what you already held, weighted by quantity:

`new average = ((incoming cost × incoming qty) + (old average × old qty)) ÷ (incoming qty + old qty)`

Rounded to the nearest øre.

**Worked example.** You hold 10 units at an average cost of 100.00. A delivery of 30 units arrives at 120.00 each:

|                      |                        |
| -------------------- | ---------------------- |
| Incoming value       | 120.00 × 30 = 3 600.00 |
| Existing value       | 100.00 × 10 = 1 000.00 |
| Total value          | 4 600.00               |
| Total quantity       | 40                     |
| **New average cost** | **115.00**             |

The average becomes 115.00, not 120.00. That is the point of a weighted average — one expensive delivery does not reprice everything you already owned.

## The four rules

The calculation has exactly four outcomes, in this order:

| When                                                       | What happens to average cost                    |
| ---------------------------------------------------------- | ----------------------------------------------- |
| A stocktaking or an explicit cost adjustment               | **Overwritten** with the new cost. No blending. |
| You held no stock (quantity was zero)                      | **Set** to the incoming cost outright           |
| Stock is going *out* (a sale, a transfer out, a write-off) | **Unchanged**                                   |
| Stock is coming *in*                                       | **Blended**, as above                           |

Two of these surprise people:

**Selling never changes cost.** However much you sell, the average cost per unit stays where it was. Only incoming stock moves it.

**A stocktaking overwrites rather than blends.** Counting stock and correcting the cost replaces the average outright. That is usually what you want — you are asserting a known value — but it means a stocktaking can move margin on every subsequent sale of that product.

## Where the incoming cost comes from

When goods are received, the cost booked per unit is:

1. **The price per unit entered on the receivement line**, if there is one.
2. **Otherwise the purchase order's net unit cost in local currency** — the line price *after* any agreed discount, converted from the order's currency.

The fallback is deliberately the net cost rather than the list price. Falling back to list price would value your stock at what the supplier asked before the discount was agreed. See [Receiving goods](/docs/day-to-day-operations/purchase-and-receivement/receiving-goods.md).

Note that freight is part of that cost — shipping is capitalised into the value of the stock rather than expensed separately. See [Purchase order](/docs/day-to-day-operations/purchase-and-receivement/purchase-order.md).

## Why weighted average and not FIFO

FIFO values each sale at the cost of the oldest unit still in stock, so margin jumps around depending on when purchase orders happened to land. A weighted average smooths that out, which makes product profitability readable over time rather than sawtoothed.

The trade-off is that a weighted average will not tell you the exact cost of the specific unit you sold. For retail reporting that is almost always the better bargain.

## What this means for you

* **Check cost per warehouse, not per product.** The same product can carry different average costs in two warehouses, because each blends its own receipts.
* **Enter the real delivered price when it differs from the order.** The cost is fixed at the moment of receiving; a correction agreed afterwards does not revalue stock already taken in.
* **Expect margin to shift after a stocktaking.** That is the overwrite rule working, not a fault.

## Limitations

* Cost is booked when stock is received. There is no retrospective revaluation of stock already in hand.
* The average is rounded to the nearest øre on every movement, so a long series of movements carries a few øre of rounding.

***

*Last updated 19.09.2026*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flowretail.com/docs/day-to-day-operations/prices/how-cost-price-is-calculated.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
