Difference between revisions of "VAT setup, calculation and rounding rules"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
Line 47: Line 47:
 
* The vat rate IRPF (a vate rate calculated on total without tax, and substracted from total to obtain total with tax)
 
* The vat rate IRPF (a vate rate calculated on total without tax, and substracted from total to obtain total with tax)
  
== Setup ==
+
'''Setup'''
 
The two vat rate are applied automatically (if company has been setup to use them) on each lines (when added or edited). Value of rates are found into the dictionary table from the standard vat rate ([[Table llx_c_tva]]). Total with tax and total amount of vat is modified according to calculation.
 
The two vat rate are applied automatically (if company has been setup to use them) on each lines (when added or edited). Value of rates are found into the dictionary table from the standard vat rate ([[Table llx_c_tva]]). Total with tax and total amount of vat is modified according to calculation.
  
 
For standard vat rate 20, tax 2 (RE) is set with type 3 (tax is applied on net price, for products only), rate 1.4%
 
For standard vat rate 20, tax 2 (RE) is set with type 3 (tax is applied on net price, for products only), rate 1.4%
  
== Example ==
+
'''Example'''
 
{|class="wikitable centre" width="80%"
 
{|class="wikitable centre" width="80%"
 
|- valign="top"
 
|- valign="top"

Revision as of 12:06, 20 November 2013

En verysmall.png This page explains how vat calculation works (or can work depending of options you choose) into Dolibarr.

Fr verysmall.png Cette page explique les différentes règles de calcul des taxes dans Dolibarr.


Standard usage

Let's start with the example we will use. Imagine an invoice that contains the following lines (We also live into a country where total must be rounded with 2 decimal numbers).

  A
Description
B
Quantity
C
Unit price
D
Vat rate
E
Total without tax
=(B*D)
F
Exact tax amount
=(B*D*E)
G
Tax amount rounded
on 2 dec
=round(F)
H
Exact price
inc tax
=(E+F)
I
Price inc tax rounded
on 2 decimals
=(E+G)
1 Product alpha 1 1.24 10% 1.24 0.124 0.12 1.24+0.124=1.364 1.36
2 Product beta 1 1.24 10% 1.24 0.124 0.12 1.24+0.124=1.364 1.36

We have 2 ways to calculate the total of invoice: making a sum of rounding lines or rounding the sum of lines.

1) If we choose to make the sum of lines after rounding (on 2 decimals) lines, we get:

  • Total without tax: 1.24(E1) + 1.24(E2) = 2.48
  • Total tax 10%: 0.12(G1) + 0.12(G2) = 0.24 (we sum the rounded values of tax on each line)
  • Total inc tax (we sum total without tax + total tax): 2.48(Ex) + 0.24(Gx) = 2.72

Note that if we sum rounded price inc tax on each line, we get: 1.36(I1) + 1.36(I2) = 2.72 (same result so we know there is no error)

2) If we choose to round (on 2 decimals) amount after summing all lines, we get:

  • Total without tax: 1.24(E1) + 1.24(E2) = 2.48 (same than in method 1)
  • Total tax 10%: (1.24(E1) + 1.24(E2)) * 10% = 0.124 + 0.124 = 0.248 rounded to nearest to have a total on 2 decimals give 0.25 (we sum amount without tax for each lines, calculate vat rate on this and after we round value on 2 decimals)
  • Total inc tax (we sum total without tax + total tax): 2.48 + 0.25 = 2.73

First thing we can note is that result from method 1 differs of result from method 2. Difference is only 0.01 but if you have n times the same line, difference can be higher but always lower or equal to (n-1)*0.01. Also if you decide to round up or down instead of "to the nearest", you will have same problem (for example with a rounding down, try with a quantity of 2 on line 2 and you will have same differences between method 1 and 2). Difference will just appears with different data but will still occurs, so problem is not on how we make rounding but when.

Second thing we can note is that if we use method 2, we must not show the column I onto invoice, otherwise to total you show on your invoice (2.73) will not be same that total you get summing total of each line (1.36+1.36=2.72). Showing column H might be better but total will still differs because total (2.73) is rounded and result of summing column H lines (1.364+1.364=2.728) will still differs.

So what to do ?

  • In some countries, calculation must always be done using method 1 for generating invoice. As this is the default calculation rule for Dolibarr, there is nothing to do.
  • In other countries (very rare), calculation must always be done using method 2 for generating invoice. To avoid having total shown at the top of the invoice that differs from total of detailed line, just do not show column I on invoice. This is the case with Dolibarr default invoice templates, so that's not a problem. To enable this rule of calculation, you must use Dolibarr version 3.5+ and set constant MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND to 1 (Home - Setup - Other).
  • In most countries, the 2 methods are possible. So here, just use method 1 that will be more efficient when you will make accountancy (because, if you use method 2, total of vat on your invoice will not be sum of F, nor sum of G and this may create confusion later). If you prefer to use method 2, use Dolibarr version 3.5+ and set constant MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND to 1 (Home - Setup - Other).

For Spain

Specific management for spain are supported from Dolibarr 3.0.

In spain, there is 2 more vat rate for each line:

  • The vat rate RE (a vat rate calculated on total without tax, and added to total to obtain total with tax)
  • The vat rate IRPF (a vate rate calculated on total without tax, and substracted from total to obtain total with tax)

Setup The two vat rate are applied automatically (if company has been setup to use them) on each lines (when added or edited). Value of rates are found into the dictionary table from the standard vat rate (Table llx_c_tva). Total with tax and total amount of vat is modified according to calculation.

For standard vat rate 20, tax 2 (RE) is set with type 3 (tax is applied on net price, for products only), rate 1.4%

Example

  A
Description
B
Quantity
C
Unit price
D
Vat rate
D
RE
E
Total without tax
=(B*C*D)
F
Exact tax amount
=(B*D*E)
G
Tax RE (B*C*D)
H
Price inc standard vat + RE=(E+F+G)
1 Product alpha 10 10 10% 1.4% 100 10 1.4 111.4

For Canada - Quebec

Lexique.

  • TPS = Taxe sur les Produit et Services
  • TVQ = Taxe de Vente Québecoise
  • TVH = Taxe de Vente Harmonisé (parfoit utilisé pour désigné la TPS+TVQ pour les commerçants);

http://www.revenuquebec.ca/fr/entreprise/taxes/tvq_tps/calcul-taxes.aspx

For India

There is a second vat. It seems to work like vat RE for spain.