Öresavrundning
This page is the reason Knox exists. If you read one page, read this one.
The problem
A Swedish Fortnox company almost always has öresutjämning switched on. It lives under Inställningar → Fakturering → Registreringsvy, and it rounds every invoice total to the nearest whole krona, booking the difference to account 3740 Öres- och kronutjämning.
A webshop, meanwhile, charges the customer an exact amount to the öre.
Those two facts cannot both hold. A customer who paid 499,50 kr gets an invoice for 500,00 kr, and 0,50 goes to 3740. It happens on most orders, in both directions, and nothing in either system ever mentions it. It surfaces months later at the bank reconciliation as a drift of small unexplained differences that nobody can trace back to an order.
Every Fortnox e-commerce integration has this problem. Most of them are simply quiet about it.
What Knox does
Four things, in four different places, because they are four different problems.
1. It models Fortnox's arithmetic, not its own
Before sending, Knox computes the invoice the way Fortnox will: each row total is unit price × quantity rounded to the öre, then VAT is recomputed per rate from those row totals — which is how VAT is reported and how Fortnox sums it.
Restating Craft's own arithmetic would prove nothing. The entire risk lives in the difference between the two models, so Knox implements theirs and compares.
2. It closes its own residual with a real rounding row
Grouping VAT per rate (Fortnox) and rounding per line (Commerce) can leave a few öre between them. Knox adds an explicit öresavrundning row at 0% VAT, posted to 3740, carrying exactly the residual.
A 0% row moves the total by precisely that amount with no VAT consequences — which is exactly what a Swedish bookkeeper does by hand. You can set Knox to refuse the invoice instead if you would rather see it than fix it.
3. It predicts your company's rounding, in words
Knox's own residual it can fix. Your company's öresutjämning it cannot: no set of rows produces a 499,50 total in a company that rounds to the krona.
So instead of failing silently, Knox says so before it sends:
Fortnox will round this invoice to 500,00 because öresutjämning is set to "krona" on the company — 0,50 away from the 499,50 the customer paid. No invoice can match an öre amount while that setting is on; it lives under Inställningar → Fakturering → Registreringsvy.
4. It re-checks the total Fortnox actually returned
Fortnox recomputes every total itself, so its answer is the only proof the model was right. Knox compares it against what the customer was charged after every create.
When they disagree, the invoice is marked Does not match the order in the control panel, with both figures and the cause. This is also how you find out three months after go-live that somebody changed the setting.
Detecting the setting
Fortnox exposes no endpoint for öresutjämning. But its effect is visible: an invoice that was
rounded carries a non-zero RoundOff.
So Knox reads your company's recent invoices and infers it. Press Detect from Fortnox on the settings screen, or:
php craft knox/connect/rounding
It reports the mode, how confident it is, and how it decided. A company with no invoices yet, or whose recent invoices all happen to land on whole kronor anyway, is genuinely undecidable — and Knox says that rather than guessing.
Settings
| Setting | What it does |
|---|---|
| Öresutjämning | Match this to your Fortnox company setting so the model is right. Off, Nearest 50 öre, Nearest krona. |
| When the rows do not add up exactly | Add an öresavrundning row (default), Refuse the invoice, or Send it and record the difference. |
| Rounding row name | What that row is called on the printed invoice. Default Öresavrundning. |
| Verify after creating | Compare the total Fortnox returns against the order. Leave this on. |
| Reconciliation tolerance (öre) | Slack allowed between the two. Zero is correct. |
The recommendation
Turn öresutjämning off in Fortnox. Your invoices will then match your payments exactly, your reconciliation becomes trivial, and account 3740 stays empty.
Knox works either way. It just will not pretend.
If you cannot turn it off — some accountants want it on for cash handling — leave it on and set Knox's Öresutjämning to match. Every invoice will be a few öre out, but you will know which ones and by how much, which is the difference between a known rounding policy and a mystery.