Difference between revisions of "How Price Including Taxes are Calculated"

From InfiniteERP Wiki
Jump to: navigation, search
(Net Amount Calculation)
 
(11 intermediate revisions by the same user not shown)
Line 17: Line 17:
 
To calculate the tax rate we need to calculate the tax amount that corresponds to the gross price. If we divide that tax amount by the gross price we get the tax rate.
 
To calculate the tax rate we need to calculate the tax amount that corresponds to the gross price. If we divide that tax amount by the gross price we get the tax rate.
  
{|style="border-left:solid 10px black;border-right:solid 20px black;border-top:solid 30px black;border-bottom:solid 40px black;" align="left"  
+
{| class="wikitable"
 
|
 
|
 
 
             tax amount of gross price
 
             tax amount of gross price
tax rate = -------------------------
+
tax rate = -------------------------------
                  gross price
+
                  gross price
 
 
 
|}
 
|}
  
<br />
 
  
 
Having the tax rate we can calculate the net price:
 
Having the tax rate we can calculate the net price:
{|style="border-left:solid 10px black;border-right:solid 20px black;border-top:solid 30px black;border-bottom:solid 40px black;" align="left"  
+
{| class="wikitable"
 
|
 
|
 
               gross price   
 
               gross price   
net price =  -------------
+
net price =  ----------------------------
 
                 tax rate
 
                 tax rate
 
|}
 
|}
Line 48: Line 45:
 
After solving the issue {{IssueReference|issuenum=32265}}, to help reducing the impact of this rounding issue instead of using the price, the total gross amount is used to calculate the net amount which once divided by the quantity, allow us to obtain the net price. The formula used then is:
 
After solving the issue {{IssueReference|issuenum=32265}}, to help reducing the impact of this rounding issue instead of using the price, the total gross amount is used to calculate the net amount which once divided by the quantity, allow us to obtain the net price. The formula used then is:
  
<code>
+
{| class="wikitable"
 +
|
 
                                             gross amount  
 
                                             gross amount  
 
  net price = gross amount * ( ------------------------------------------- ) / quantity
 
  net price = gross amount * ( ------------------------------------------- ) / quantity
 
                               gross amount + tax amount of gross amount
 
                               gross amount + tax amount of gross amount
</code>
+
|}
  
 
== Taxes Calculation ==
 
== Taxes Calculation ==
Line 63: Line 61:
  
 
As the net amounts are known, the standard methods to calculate the tax amounts based on net amounts are used. However, the calculated net amount has to be rounded to the standard precision of the currency.
 
As the net amounts are known, the standard methods to calculate the tax amounts based on net amounts are used. However, the calculated net amount has to be rounded to the standard precision of the currency.
 
{{AvailableFrom|3.0PR17Q2}}
 
 
We can have some rounding issues when working with taxes calculated at document level. This is solved in issue {{IssueReference|issuenum=32265}}:
 
  
 
In some cases, the sum of the tax amounts and the net amount might not be equal to the total gross amount. The difference will be adjusted when completing the document in the tax amounts, by adding or subtracting the difference to the higher tax amount so the final sum is correct.
 
In some cases, the sum of the tax amounts and the net amount might not be equal to the total gross amount. The difference will be adjusted when completing the document in the tax amounts, by adding or subtracting the difference to the higher tax amount so the final sum is correct.
Line 125: Line 119:
 
|}
 
|}
  
[[Category:HowTo]]
+
[[Category:HowTo_Process]]

Latest revision as of 06:28, 20 December 2021

Introduction

Since the availability of the "Price Lists Including Taxes" feature, there has been some doubts on how net prices/amounts and tax amounts are calculated.

This how is aimed to explain these calculations in a simple way.

The calculation can be split into two steps:

  1. First one is to calculate the Net Amount based on a given Gross Amount and then the corresponding Tax Rate
  2. Second one is to calculate the Tax Amount based on the newly calculated Net Amount which then needs to be adjusted so the Net Amount plus the Tax Amount is equal to the Gross Amount.

Net Amount Calculation

In Openbravo cascade taxes calculation is supported. This means that when the Net Amount is being calculated we might not have a single rate to work with, but a relation of different tax rates.

Cascade taxes make the calculation of a net amount from a given gross amount a bit more difficult. You would normally divide the gross amount by the rate to get the net amount, but the rate might not be a unique one, in other words it might not be available therefore it has to be calculated.

To calculate the tax rate we need to calculate the tax amount that corresponds to the gross price. If we divide that tax amount by the gross price we get the tax rate.

           tax amount of gross price

tax rate = -------------------------------

                 gross price


Having the tax rate we can calculate the net price:

              gross price  

net price = ----------------------------

               tax rate

If we substitute the tax rate by the previous formula and simplify it we get:

This method returns the exact result, but its implementation requires to round the calculated tax amount.

In former Openbravo MPs this was rounded to the Price Precision of the currency, thus having a higher price precision was recommended.

After solving the issue 24378, a 50 decimals precision is used.

Bulbgraph.png   This feature is available starting from 3.0PR17Q2.

After solving the issue 32265, to help reducing the impact of this rounding issue instead of using the price, the total gross amount is used to calculate the net amount which once divided by the quantity, allow us to obtain the net price. The formula used then is:

                                            gross amount 
net price = gross amount * ( ------------------------------------------- ) / quantity
                              gross amount + tax amount of gross amount

Taxes Calculation

Once the net amount is calculated it is time to calculate the final tax amount of the Order or the Invoice.

When taxes are calculated we also need to consider different possible configurations. Tax amounts might be rounded either at line or document level.

Besides, a single line might have tax amounts of different tax rates, if cascade tax rates are being used. So subtracting the net amount to the gross amount is not a valid option.

As the net amounts are known, the standard methods to calculate the tax amounts based on net amounts are used. However, the calculated net amount has to be rounded to the standard precision of the currency.

In some cases, the sum of the tax amounts and the net amount might not be equal to the total gross amount. The difference will be adjusted when completing the document in the tax amounts, by adding or subtracting the difference to the higher tax amount so the final sum is correct.

It is also possible that the sum of line net amounts is not equal to the total net amount. The difference will be adjusted when completing the document, by adding or subtracting the difference to the higher line net amount so the final sum is correct.


Some examples with different taxes and gross prices
Tax Example Gross Amt Net Amt Rounded Net Tax Amount Adjusted Tax
Simple 21% 1.53 1.26446 1.26 0.26 0.27
Simple 21% 1.21 1.00 1.00 0.21 0.21
Simple 21% 1.64 1.35537 1.36 0.29 0.28
6.25% + 1% 1.56 1.454545 1.45 0.09+0.01 0.10+0.01
6.25% + 1% 1.61 1.501165 1.50 0.10+0.01 0.10+0.01
6.25% + 1% 1.65 1.538461 1.54 0.10+.0.02 0.09+0.02