Changes

m
Line 1: Line 1:  +
<!-- BEGIN origin interlang links -->
 +
<!-- You can edit this section but do NOT remove these comments
 +
    Links below will be automatically replicated on translated pages by PolyglotBot -->
 +
[[fr:Règles_de_paramétrage,_calcul_et_arrondi_de_TVA]]
 +
<!-- END interlang links -->
 +
 
This page explains how VAT calculations are done (or can be done depending on the options chosen) in Dolibarr ERP CRM.
 
This page explains how VAT calculations are done (or can be done depending on the options chosen) in Dolibarr ERP CRM.
 +
 +
=Automatic definition of the default VAT rate=
 +
 +
In Dolibarr the VAT rate can always be set to any value of your choice. However, to save you time, Dolibarr try to automatically set the value of VAT or sale tax to a default value that is autodetected according to the information you entered into the Setup of Dolibarr.
 +
 +
By default when creating prospects, invoices, orders etc. the Sales Tax rate that is suggested by default follows is defined like this:
 +
* If the seller is not subject to Sales tax, then Sales tax defaults to 0. End of rule.
 +
* If the (seller's country = buyer's country), then the Sales tax by default equals the Sales tax of the product in the seller's country. End of rule.
 +
* If the seller and buyer are both in the European Community and goods are transport-related products (haulage, shipping, airline), the default VAT is 0. This rule is dependant on the seller's country - please consult with your accountant. The VAT should be paid by the buyer to the customs office in their country and not to the seller. End of rule.
 +
* If the seller and buyer are both in the European Community and the buyer is not a company (with a registered intra-Community VAT number) then the VAT defaults to the VAT rate of the seller's country. End of rule.
 +
* If the seller and buyer are both in the European Community and the buyer is a company (with a registered intra-Community VAT number), then the VAT is 0 by default. End of rule.
 +
* In any other case the proposed default is Sales tax=0. End of rule.
      −
= Standard VAT and rounding rules =
+
Note, Special case for Europe: [[Loi_européenne_TVA_Vente_à_Distance_VAD_et_e-commerce_BtoC]]
 +
 
 +
=Standard VAT and rounding rules=
 
For an example we will use an invoice with two products, based in a country where the totals must be rounded to two decimal places.
 
For an example we will use an invoice with two products, based in a country where the totals must be rounded to two decimal places.
   −
{|class="wikitable centre" width="80%"
+
{| class="wikitable centre" width="80%"
 
|- valign="top"
 
|- valign="top"
||&nbsp;||A<br>Description||B<br>Quantity||C<br>Unit price||D<br>Vat rate||E<br>Total without tax<br>=(B*C)||F<br>Exact tax amount<br>=(D*E)||nowrap="nowrap"|G<br>Tax amount rounded<br>to 2 dec. places<br>=round(F)||nowrap="nowrap"|H<br>Exact price<br>inc tax<br>=(E+F)||nowrap="nowrap"|I<br>Price inc tax rounded<br>to 2 decimals<br>=(E+G)
+
||&nbsp;||A<br>Description||B<br>Quantity||C<br>Unit price||D<br>Vat rate||E<br>Total without tax<br>=(B*C)||F<br>Exact tax amount<br>=(D*E)|| nowrap="nowrap" |G<br>Tax amount rounded<br>to 2 dec. places<br>=round(F)|| nowrap="nowrap" |H<br>Exact price<br>inc tax<br>=(E+F)|| nowrap="nowrap" |I<br>Price inc tax rounded<br>to 2 decimals<br>=(E+G)
 
|-
 
|-
||1||nowrap="nowrap"|Product alpha||1||1.24||10%||1.24||0.124||0.12||1.24+0.124=1.364||1.36
+
||1|| nowrap="nowrap" |Product alpha||1||1.24||10%||1.24||0.124||0.12||1.24+0.124=1.364||1.36
 
|-
 
|-
||2||nowrap="nowrap"|Product beta||1||1.24||10%||1.24||0.124||0.12||1.24+0.124=1.364||1.36
+
||2|| nowrap="nowrap" |Product beta||1||1.24||10%||1.24||0.124||0.12||1.24+0.124=1.364||1.36
 
|}
 
|}
   Line 17: Line 37:     
1) If we choose to sum the rounded lines (to 2 decimal places) lines, we get:
 
1) If we choose to sum the rounded lines (to 2 decimal places) 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 without tax: 1.24(E1) + 1.24(E2) = '''2.48'''
* Total inc tax (we sum total without tax + total tax): 2.48(Ex) + 0.24(Gx) = '''2.72'''
+
*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 the rounded price inc. tax on each line, we get: 1.36(I1) + 1.36(I2) = '''2.72''' (the same result, so we know there is no error)
 
Note that if we sum the rounded price inc. tax on each line, we get: 1.36(I1) + 1.36(I2) = '''2.72''' (the same result, so we know there is no error)
    
2) If we choose to round the amount (to 2 decimals) after summing the unrounded lines, we get:
 
2) If we choose to round the amount (to 2 decimals) after summing the unrounded lines, we get:
* Total without tax: 1.24(E1) + 1.24(E2) = '''2.48''' (same as method 1)
+
 
* Total tax 10%: (1.24(E1) + 1.24(E2)) * 10% = 0.124 + 0.124 = 0.248 rounded to nearest two decimals gives '''0.25''' (we sum the amount without tax for each lines, calculate vat rate on this and subsequently we round the value to 2 decimals)
+
*Total without tax: 1.24(E1) + 1.24(E2) = '''2.48''' (same as method 1)
* Total inc tax (we sum each line without tax and add the total tax): 2.48 + 0.25 = '''2.73'''
+
*Total tax 10%: (1.24(E1) + 1.24(E2)) * 10% = 0.124 + 0.124 = 0.248 rounded to nearest two decimals gives '''0.25''' (we sum the amount without tax for each lines, calculate vat rate on this and subsequently we round the value to 2 decimals)
 +
*Total inc tax (we sum each line without tax and add the total tax): 2.48 + 0.25 = '''2.73'''
    
The first  point to note is that the result of Method 1 differs from the result of method 2 by 0.01.  If you have n times the same line, the difference can be higher but is always lower than/equal to (n-1)*0.01.
 
The first  point to note is that the result of Method 1 differs from the result of method 2 by 0.01.  If you have n times the same line, the difference can be higher but is always lower than/equal to (n-1)*0.01.
Line 34: Line 56:     
'''So what to do ?'''
 
'''So what to do ?'''
* In some countries, calculations must always be done using method 1 for generating invoices. As this is the default calculation rule for Dolibarr, there is nothing to change from the default configuration..
  −
* In other countries (rarely), calculations must always be done using method 2 for generating invoices. To avoid having the total shown at the top of the invoice that differs from the totals of detailed lines, 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 add/override the constant MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND to 1 (in Home - Setup - Other).
  −
* In most countries, both methods are possible. In this case just use method 1 that will be more accurate for accounting (since if you use method 2, the total of vat collected on your invoice will not be the sum of F, nor the sum of G and this may create confusion subsequently). If you prefer to use method 2, use Dolibarr version 3.5+ and set constant MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND to 1 (Home - Setup - Other).
     −
= Second or Third Tax =
+
*In some countries, calculations must always be done using method 1 for generating invoices. As this is the default calculation rule for Dolibarr and recommended in most countries nowdays, there is nothing to change from the default configuration..
Some countries may apply two or three taxes on each invoice line. This can be setup in the Dictionary for Sales taxes.
+
*In few countries (rarely), calculations must always be done using method 2 for generating invoices. To avoid having the total shown at the top of the invoice that differs from the totals of detailed lines, 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 add/override the constant MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND to 1 (in Home - Setup - Other). It seems there is no more example of countries in the world today that need this.
 +
*In some countries, both methods are still possible. In this case just use method 1 that will be more accurate for accounting (since if you use method 2, the total of vat collected on your invoice will not be the sum of F, nor the sum of G and this will create confusion subsequently). If you prefer to use method 2 (WARNING: this is a very very bad idea not compliant with today's requirements on line accounting), use Dolibarr version 3.5+ and set constant MAIN_ROUNDOFTOTAL_NOT_TOTALOFROUND to 1 (Home - Setup - Other).
 +
 
 +
=Second or Third Tax=
 +
Some countries may apply two or three taxes on each invoice line. This can be setup in the Dictionary (Home - Setup - Dictionaries - Sales taxes).
    
Possible local tax types are:<br>
 
Possible local tax types are:<br>
Line 46: Line 69:  
3: local tax is applied to products only without vat (localtax is calculated on amount without tax)<br>
 
3: local tax is applied to products only without vat (localtax is calculated on amount without tax)<br>
 
4: local tax is applied to products only including vat (localtax is calculated on amount + main vat)<br>
 
4: local tax is applied to products only including vat (localtax is calculated on amount + main vat)<br>
5 : local tax is applied to services only without vat (localtax is calculated on amount without tax)<br>
+
5: local tax is applied to services only without vat (localtax is calculated on amount without tax)<br>
6 : local tax is applied to services only including vat (localtax is calculated on amount + tax)
+
6: local tax is applied to services only including vat (localtax is calculated on amount + tax)
 +
 
 +
 
 +
==For Argentina==
 +
 
 +
In Argentina, you may need to add a second tax on the tax profile that is a Gross Income Tax like IIBB. Note that if you have several rates for IVA and several rates for IBB, you must add one profile of tax for each combination you commonly use.
 +
 
 +
[[File:Warning.png]] Note that the second tax will be added only if you setup your company into '''Home - Setup - Company - Use 2nd tax to yes''' (this option is visible for country whose a second tax is defined into dictionary tables of vats).
   −
== For Brazil ==
+
 
 +
==For Brazil==
    
See page [[BrasilTaxes]]
 
See page [[BrasilTaxes]]
      −
== For Canada ==
+
==For Canada==
    
'''Lexical'''
 
'''Lexical'''
   −
* GST = Goods and Services Tax (TPS = Taxe sur les Produit et Services for Quebec)
+
*GST = Goods and Services Tax (TPS = Taxe sur les Produit et Services for Quebec)
* PST = Provincial sales taxes (TVQ = Taxe de Vente Québecoise for Quebec = QST = Quebec Sale Tax)
+
*PST = Provincial sales taxes (TVQ = Taxe de Vente Québecoise for Quebec = QST = Quebec Sale Tax)
    
'''Setup'''
 
'''Setup'''
Line 65: Line 96:  
The GST is applied automatically on each lines (when added or edited).
 
The GST is applied automatically on each lines (when added or edited).
 
Value of rate for second tax PST is automatically extracted by system from the dictionary table of VAT rates, for the GST vat rate line used and your country ([[Table llx_c_tva]]).  
 
Value of rate for second tax PST is automatically extracted by system from the dictionary table of VAT rates, for the GST vat rate line used and your country ([[Table llx_c_tva]]).  
* [[File:Warning.png]] Note that the second tax will be added only if you setup your company into '''Home - Setup - Company - Use 2nd tax to yes''' (this option is visible for country whose a second tax is defined into dictionary tables of vats).
+
 
 +
[[File:Warning.png]] Note that the second tax will be added only if you setup your company into '''Home - Setup - Company - Use 2nd tax to yes''' (this option is visible for country whose a second tax is defined into dictionary tables of vats).
      Line 76: Line 108:  
'''Example of calculation'''
 
'''Example of calculation'''
   −
{|class="wikitable centre" width="80%"
+
{| class="wikitable centre" width="80%"
 +
|- valign="top"
 +
||&nbsp;||A<br>Description||B<br>Quantity||C<br>Unit price||D1<br>Vat rate GST||D2<br>Vat rate PST||E<br>Total without tax<br>=(B*C)||F<br>Tax GST<br>=(B*C*D1)=(D1*E)|| nowrap="nowrap" |G<br>Tax PST (B*C*D2)=(D2*E)|| nowrap="nowrap" |H<br>Price inc GST + PST=(E+F+G)
 +
|-
 +
||1|| nowrap="nowrap" |Product alpha||10||10||5%||9.975%||100||5||9.98||114.98
 +
|}
 +
 
 +
 
 +
==For Congo==
 +
 
 +
In Congo, alias Republic of Congo or Congo-Brazzaville, there is another tax of 5% on the amount of VAT.
 +
 +
'''Setup'''
 +
 
 +
Example of user setup: Go into Home - Setup - Dictionary - VAT and sale tax, into column "Rate" enter a vat rate with value 18, into column "Tax 2" enter a VAT rate 0.9 with '''type "1"'''
 +
(Type "1" means the tax 2 is calculated for product and services on the price without the VAT). Because 5% on the amount of VAT is same than 0.9% on the price without tax when the tax is 18%.
 +
 
 +
'''Example of calculation'''
 +
 
 +
{| class="wikitable centre" width="80%"
 
|- valign="top"
 
|- valign="top"
||&nbsp;||A<br>Description||B<br>Quantity||C<br>Unit price||D1<br>Vat rate GST||D2<br>Vat rate PST||E<br>Total without tax<br>=(B*C)||F<br>Tax GST<br>=(B*C*D1)=(D1*E)||nowrap="nowrap"|G<br>Tax PST (B*C*D2)=(D2*E)||nowrap="nowrap"|H<br>Price inc GST + PST=(E+F+G)
+
||&nbsp;||A<br>Description||B<br>Quantity||C<br>Unit price||D1<br>Vat rate||D2<br>Tax 2 rate||E<br>Total without tax<br>=(B*C)||F<br>Tax<br>=(B*C*D1)=(D1*E)|| nowrap="nowrap" |G<br>Tax 2 (B*C*D2)=(D2*E)|| nowrap="nowrap" |H<br>Price inc both tax=(E+F+G)
 
|-
 
|-
||1||nowrap="nowrap"|Product alpha||10||10||5%||9.975%||100||5||9.98||114.98
+
||1|| nowrap="nowrap" |Product alpha||10||10||18%||0.9%||100||18||0.9||118.9
 
|}
 
|}
   −
== For India ==
  −
There is SGST, CGST and IGST.
  −
Setup is available by default with 6.0
     −
== For Italy ==
+
==For India==
 +
There is SGST, CGST and IGST. Setup is available by default with 6.0+:
 +
 
 +
Go into '''Home - Setup - Company''', check that your country has been set to India then enable the second and third tax.
 +
 
 +
Go into '''Home - Setup - Display''' and set your language to English (India) to get the correct term for the taxes.
 +
 
 +
You can also check the rates into '''Home - Setup - Dictionaries - Rate of sales tax'''.
 +
 
 +
 
 +
==For Italy==
 
You may need to add a negative withholding tax calculated on net amount.
 
You may need to add a negative withholding tax calculated on net amount.
   Line 98: Line 156:  
'''Example or calculation'''
 
'''Example or calculation'''
   −
{|class="wikitable centre" width="80%"
+
{| class="wikitable centre" width="80%"
 
|- valign="top"
 
|- valign="top"
||&nbsp;||A<br>Description||B<br>Quantity||C<br>Unit price||D1<br>Vat rate||D2<br>Vat rate withholding tax||E<br>Total without tax<br>=(B*C)||F<br>Tax VAT<br>=(B*C*D1)||nowrap="nowrap"|G<br>Tax 2 (B*C*D2)||nowrap="nowrap"|H<br>Price inc VAT + Tax 2=(E+F+G)
+
||&nbsp;||A<br>Description||B<br>Quantity||C<br>Unit price||D1<br>Vat rate||D2<br>Vat rate withholding tax||E<br>Total without tax<br>=(B*C)||F<br>Tax VAT<br>=(B*C*D1)|| nowrap="nowrap" |G<br>Tax 2 (B*C*D2)|| nowrap="nowrap" |H<br>Price inc VAT + Tax 2=(E+F+G)
 
|-
 
|-
||1||nowrap="nowrap"|Product alpha||10||10||22%||-20%||100||22||-20||102
+
||1|| nowrap="nowrap" |Product alpha||10||10||22%||-20%||100||22||-20||102
 
|}
 
|}
      −
== For Spain ==
+
==For Spain==
 
Specific tax rules for Spain are supported from Dolibarr 3.0.
 
Specific tax rules for Spain are supported from Dolibarr 3.0.
    
In Spain, there are two additional vat rates possible for each line:
 
In Spain, there are two additional vat rates possible for each line:
* The vat rate RE. Recargo de Equivalencia - a vat rate calculated on the total without tax for '''products''', and '''added''' to the invoice total to obtain a total with tax.
+
 
* The vat rate IRPF. Impuesto sobre la Renta de las Personas Físicas - a vate rate calculated on total without tax for '''services''', and '''subtracted''' from the invoice total to obtain a total with tax.
+
*The vat rate RE. Recargo de Equivalencia - a vat rate calculated on the total without tax for '''products''', and '''added''' to the invoice total to obtain a total with tax.
 +
*The vat rate IRPF. Impuesto sobre la Renta de las Personas Físicas - a vate rate calculated on total without tax for '''services''', and '''subtracted''' from the invoice total to obtain a total with tax.
    
Both additional taxes cannot be on the same invoice: RE is applied only for products and IRPF only for services. Because IRPF tax is always negative, in credit notes/invoices the total IRPF will be positive.
 
Both additional taxes cannot be on the same invoice: RE is applied only for products and IRPF only for services. Because IRPF tax is always negative, in credit notes/invoices the total IRPF will be positive.
Line 120: Line 179:     
Setup example: For standard vat rate 10, Localtax 1 (RE) is set with type "3" (tax is applied on net price, for products only), rate 1.4%
 
Setup example: For standard vat rate 10, Localtax 1 (RE) is set with type "3" (tax is applied on net price, for products only), rate 1.4%
 +
 +
[[File:Warning.png]] Note that the second tax will be added only if you setup your company into '''Home - Setup - Company - Use 2nd tax to yes''' (this option is visible for country whose a second tax is defined into dictionary tables of vats).
    
'''Example of calculation'''
 
'''Example of calculation'''
   −
{|class="wikitable centre" width="80%"
+
{| class="wikitable centre" width="80%"
 
|- valign="top"
 
|- valign="top"
||&nbsp;||A<br>Description||B<br>Quantity||C<br>Unit price||D1<br>Vat rate||D2<br>RE||E<br>Total without tax<br>=(B*C)||F<br>Exact tax amount<br>=(B*C*D1)=(D1*E)||nowrap="nowrap"|G<br>Tax RE (B*C*D2)=(D2*E)||nowrap="nowrap"|H<br>Price inc standard vat + RE=(E+F+G)
+
||&nbsp;||A<br>Description||B<br>Quantity||C<br>Unit price||D1<br>Vat rate||D2<br>RE||E<br>Total without tax<br>=(B*C)||F<br>Exact tax amount<br>=(B*C*D1)=(D1*E)|| nowrap="nowrap" |G<br>Tax RE (B*C*D2)=(D2*E)|| nowrap="nowrap" |H<br>Price inc standard vat + RE=(E+F+G)
 
|-
 
|-
||1||nowrap="nowrap"|Product alpha||10||10||10%||1.4%||100||10||1.4||111.4
+
||1|| nowrap="nowrap" |Product alpha||10||10||10%||1.4%||100||10||1.4||111.4
 
|}
 
|}
    
'''Example of calculation in credit notes'''
 
'''Example of calculation in credit notes'''
   −
{|class="wikitable centre" width="80%"
+
{| class="wikitable centre" width="80%"
 
|- valign="top"
 
|- valign="top"
||&nbsp;||A<br>Description||B<br>Quantity||C<br>Unit price||D1<br>Vat rate||D2<br>IRPF||E<br>Total without tax<br>=(B*C)||F<br>Exact tax amount<br>=(B*C*D1)=(D1*E)||nowrap="nowrap"|G<br>Tax RE (B*C*D2)=(D2*E)||nowrap="nowrap"|H<br>Price inc standard vat + RE=(E+F+G)
+
||&nbsp;||A<br>Description||B<br>Quantity||C<br>Unit price||D1<br>Vat rate||D2<br>IRPF||E<br>Total without tax<br>=(B*C)||F<br>Exact tax amount<br>=(B*C*D1)=(D1*E)|| nowrap="nowrap" |G<br>Tax RE (B*C*D2)=(D2*E)|| nowrap="nowrap" |H<br>Price inc standard vat + RE=(E+F+G)
 
|-
 
|-
||1||nowrap="nowrap"|Product alpha||10||-10||21%||-21%||-100||0||21||100
+
||1|| nowrap="nowrap" |Product alpha||10||-10||21%||-21%||-100||0||21||100
 
|}
 
|}
   Line 143: Line 204:  
R.E. (Localtax1) is applied to sales of product and not to supply of services. But a service may be invoiced in the same invoice with a product sale if this is related to the product sale and it increases its cost (ex: shipping costs).
 
R.E. (Localtax1) is applied to sales of product and not to supply of services. But a service may be invoiced in the same invoice with a product sale if this is related to the product sale and it increases its cost (ex: shipping costs).
   −
Currently to treat this case you must enter these services (ex: shipping costs) as a free line, and indicating the type as product, not as service.
+
Currently to manage this case you must enter these services (ex: shipping costs) as a free line, and indicating the type as product, not as service.
 +
 
 +
==For Tunisia==
 +
You may need to manage the fiscal thumb. For this, just enable the option into Home - Setup - Company/Organization.
 +
 
 +
You may need to add a FODEC tax. For example a 1% tax on price without VAT. That VAT must include the VAT. See http://www.profiscal.com/Etudiants/TCA/tca_ch11_06.htm
 +
 
 +
'''Configuration'''
 +
 
 +
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.
 +
 
 +
Because VAT in Dolibarr is calculated before adding the second TAX and for FODEC we need to add the second Tax before calculating VAT, we must use a workaround to support the FODEC currently in Dolibarr.
 +
The solution is to create a VAT Rate that include bot the VAT rate + a delta to include the VAT based on FODEC.
 +
 
 +
'''Exemple''': Imagine the VAT is 18% and the FODEC is 1%. You must go into Setup - Dictionaries - VAT and tax rates. Create a new VAT rate with field Code = "18+FODEC", Rate="18.18", Use Tax2=Yes with type 1, Rate of Tax2="1", Note="VAT 18.0 including 1% FODEC, so 18.18%"
 +
 
 +
{| class="wikitable centre" width="80%"
 +
|- valign="top"
 +
||&nbsp;||A<br>Description||B<br>Quantity||C<br>Unit price||D1<br>Vat rate||D2<br>FODEC||E<br>Total without tax<br>=(B*C)||F<br>Exact VAT amount<br>=(B*C*D1)=(D1*E)|| nowrap="nowrap" |G<br>Tax FODEC (B*C*D2)=(D2*E)|| nowrap="nowrap" |H<br>Price inc standard vat + FODEC=(E+F+G)
 +
|-
 +
||1|| nowrap="nowrap" |Product alpha||10||10||18.18%||1%||100||18.18||1||119.18
 +
|}
 +
 
 +
This workaround will work around for calculation of each part and calculation of total. However, on PDF generated document, you will see the text "18.18%" for the VAT rate instead of "18% after adding the 1%"