When generating documents, you must apply the following rules:
Quantity: 10 decimals
Unit price: 10 decimals
All documents: 2 decimals
This type of rounding takes the gross value of each detail line to get to both the net total and grand total, and then calculates the taxes as the difference between them.
This is the most common rounding when the prices are shown to customers as the amount to pay (for example in a supermarket)
Example: 9x pizzas for 2990 (gross with 19% tax included)
Net: 19860
Tax: 5859
Total: 25720
Net is calculated by substracting the tax from the detail gross value and then multiplying by Quantity (2990/1.19 * 9)
Grand total is calculated as multiplying the gross value by Quantity (2990*9)
Tax is the difference between these values (25720 - 19860)
This type of rounding takes the net value of each detail line to get to the net total and then adds up the taxes calculated on the net values to achieve the grand total
This is the most common rounding when the prices are shown to customers as net values (for example on consultancy services)
Example: 9x pizzas for 2512.605042 (net with 19% tax excluded)
Net: 19860
Tax: 5859
Grand total: 25719
Tax is calculated as 19% of the rounded net value (19860 * 0.19)
Grand total is calculated as the sum of net + tax (19860 + 5859)
We have prepared a simple table that allows you to choose country, document type and enter values in order to find out what the correct values are
https://docs.google.com/spreadsheets/d/1rBNbhkM19t9GIeL8R2dDyJvo9wV5mPAywBHlN7nEokc/edit?usp=sharing
🧮 Rounding