Articles in this section

How net, VAT, and gross amounts are calculated

Published:
Updated:

Every line item on a Beleg (receipt/expense document) has three calculated amounts: net, VAT, and gross. This article explains exactly how they are computed and rounded, so the numbers you see always reconcile. You do not enter these amounts; the platform derives them from quantity, unit price, and VAT rate.

The formulas

For each line item, the amounts are computed in this order:

  1. Net amount = quantity × unit price
  2. VAT amount = net amount × (VAT rate ÷ 100)
  3. Gross amount = net amount + VAT amount

If a line item has no VAT rate, the VAT amount is treated as zero and gross equals net.

How values are rounded

Rounding is applied at each step using "round half away from zero" (MidpointRounding.AwayFromZero), so a half unit always rounds up in magnitude — 0.125 rounds to 0.13, not 0.12. The decimal places are:

ValueDecimal places
Quantity4
Unit price2
VAT rate (percentage)2
Net amount2
VAT amount2
Gross amount2

The inputs are rounded first (quantity to 4 places, unit price and VAT rate to 2), then net, VAT, and gross are each rounded to 2 places as they are computed.

A worked example

Take a fuel line of 50 litres at 1.859 per litre with 19% VAT:

  • Unit price rounds to 1.86 (2 places, away from zero).
  • Net = 50 × 1.86 = 93.00.
  • VAT = 93.00 × 0.19 = 17.67 → 17.67.
  • Gross = 93.00 + 17.67 = 110.67.
Note: Because unit price is rounded to 2 places before the net is calculated, enter the price already rounded to your currency's minor unit if you want to avoid surprises. A raw price of 1.859 becomes 1.86 in the stored net.

Why rounding at each step matters

Rounding the VAT amount per line (rather than only on the header total) means the sum of the line VAT amounts always equals the difference between the header gross and net totals. This keeps the Beleg internally consistent and makes the dashboard tax summary, which groups VAT by rate, reconcile against the line items.

When amounts are recomputed

The amounts are recalculated every time the line items are saved — on create, on edit, and when an authorized reviewer applies a financial correction. You never edit net, VAT, or gross directly; changing the quantity, unit price, or VAT rate and saving is what updates them.

Tip: A quantity must be greater than zero and a unit price must be zero or greater, so a valid line always produces a non-negative net. A zero-priced line (net 0.00) is allowed, for example a free item recorded for completeness.

Related

  • How header totals are recomputed on every change
  • Add line items to a Beleg
  • Tag line items with VAT rate, cost center, and GL mapping
  • Edit line items: create, update, and delete
AH
Written by Alexander Hagemann
Updated:
Access denied
Access denied