@@ -87,45 +87,108 @@ Tax computation
8787  The tax has a fixed amount in the default currency. The amount remains the same, regardless of the
8888  sales price.
8989
90- .. example ::
91-    A product has a sales price of $1000, and we apply a $10 * fixed *  tax. We then have:
90+    .. example ::
91+       A product has a sales price of $1000, and we apply a $10 :guilabel: ` fixed `  tax. We then have:
9292
93-    +-------------+-------------+----------+----------+ 
94-    |  Product     |  Price       |  Tax      |  Total    | 
95-    |  sales price |  without tax |           |           | 
96-    +=============+=============+==========+==========+ 
97-    |  1,000       |  1,000       |  10       |  1,010.00 | 
98-    +-------------+-------------+----------+----------+ 
93+       +-------------+-------------+----------+----------+ 
94+       |  Product     |  Price       |  Tax      |  Total    | 
95+       |  sales price |  without tax |           |           | 
96+       +=============+=============+==========+==========+ 
97+       |  1,000       |  1,000       |  10       |  1,010.00 | 
98+       +-------------+-------------+----------+----------+ 
9999
100100- **Percentage of price **
101101
102-   The *sales price * is the taxable basis: the tax amount is computed by multiplying the sales price
103-   by the tax percentage.
102+   The tax rate is a percentage of the **tax-excluded ** subtotal.
104103
105- ..  example :: 
106-    A product has a  sales price of $1000, and we apply a * 10% of Price *  tax. We then have :
104+   The exact tax computation depends on the  :ref: ` taxes/included-in-price ` field, which determines 
105+   whether the  sales price should be treated as  tax-excluded or tax-included :
107106
108-    +-------------+-------------+----------+----------+ 
109-    |  Product     |  Price       |  Tax      |  Total    | 
110-    |  sales price |  without tax |           |           | 
111-    +=============+=============+==========+==========+ 
112-    |  1,000       |  1,000       |  100      |  1,100.00 | 
113-    +-------------+-------------+----------+----------+ 
107+   .. tabs ::
108+      .. tab :: Tax-excluded 
109+ 
110+         If :guilabel: `Included in Price ` is unchecked, the computation is :math: `\text {tax amount}
111+         = \text {sales price} \times  \text {tax rate}`.
112+ 
113+         .. example ::
114+            A product has a sales price of $1000, and we apply a 10% :guilabel: `Percentage of Price `
115+            tax that is not :guilabel: `Included in Price `. We then have:
116+ 
117+            +-------------+-------------+----------+----------+ 
118+            |  Product     |  Price       |  Tax      |  Total    | 
119+            |  sales price |  without tax |           |           | 
120+            +=============+=============+==========+==========+ 
121+            |  1,000       |  1,000       |  100      |  1,100.00 | 
122+            +-------------+-------------+----------+----------+ 
123+ 
124+      .. tab :: Tax-included 
125+ 
126+         If :guilabel: `Included in Price ` is checked, the computation is :math: `\text {tax amount} =
127+         \text {sales price} \times  \frac {\text {tax rate}}{1  + \text {tax rate}}`.
128+ 
129+         .. example ::
130+            A product has a sales price of $1000, and we apply a 10% :guilabel: `Percentage of Price `
131+            tax that is :guilabel: `Included in Price `. We then have:
132+ 
133+            +-------------+-------------+----------+----------+ 
134+            |  Product     |  Price       |  Tax      |  Total    | 
135+            |  sales price |  without tax |           |           | 
136+            +=============+=============+==========+==========+ 
137+            |  1,000       |  909.09      |  90.91    |  1,000.00 | 
138+            +-------------+-------------+----------+----------+ 
114139
115140- **Percentage of Price Tax Included **
116141
117-   The ** total ** is the taxable basis: the  tax amount  is a percentage of the total.
142+   The tax rate  is a percentage of the ** tax-included **  total.
118143
119- .. example ::
120-    A product has a Sales Price of $1000, and we apply a *10% of Price Tax Included * tax. We then
121-    have:
144+   The exact tax computation depends on the :ref: `taxes/included-in-price ` field, which determines
145+   whether the sales price should be treated as tax-excluded or tax-included:
122146
123-    +-------------+-------------+----------+----------+ 
124-    |  Product     |  Price       |  Tax      |  Total    | 
125-    |  sales price |  without tax |           |           | 
126-    +=============+=============+==========+==========+ 
127-    |  1,000       |  1,000       |  111.11   |  1,111.11 | 
128-    +-------------+-------------+----------+----------+ 
147+   .. tabs ::
148+      .. tab :: Tax-excluded 
149+         If :guilabel: `Included in Price ` is unchecked, the computation is :math: `\text {tax amount}
150+         = \text {sales price} \times  \frac {\text {tax rate}}{1  - \text {tax rate}}`.
151+ 
152+         .. example ::
153+            A product has a sales price of $1000, and we apply a 10% :guilabel: `Percentage of Price 
154+            Tax Included ` tax that is not :guilabel: `Included in Price `. We then have:
155+ 
156+            +-------------+-------------+----------+----------+ 
157+            |  Product     |  Price       |  Tax      |  Total    | 
158+            |  sales price |  without tax |           |           | 
159+            +=============+=============+==========+==========+ 
160+            |  1,000       |  1,000       |  111.11   |  1,111.11 | 
161+            +-------------+-------------+----------+----------+ 
162+ 
163+            Note that the real tax rate in terms of the tax-excluded price is
164+            :math: `\frac {111.11 }{1000 } = 11.111 \%`.
165+ 
166+      .. tab :: Tax-included 
167+ 
168+         If :guilabel: `Included in Price ` is checked, the computation is :math: `\text {tax amount} =
169+         \text {sales price} \times  \text {tax rate}`.
170+ 
171+         .. example ::
172+            A product has a sales price of $1000, and we apply a 10%
173+            :guilabel: `Percentage of Price Tax Included ` tax that is :guilabel: `Included in Price `.
174+            We then have:
175+ 
176+            +-------------+-------------+----------+----------+ 
177+            |  Product     |  Price       |  Tax      |  Total    | 
178+            |  sales price |  without tax |           |           | 
179+            +=============+=============+==========+==========+ 
180+            |  1,000       |  900         |  100      |  1,000.00 | 
181+            +-------------+-------------+----------+----------+ 
182+ 
183+            Note that the real tax rate in terms of the tax-excluded price is
184+            :math: `\frac {100 }{900 } = 11.111 \%`.
185+ 
186+   .. warning ::
187+      This tax computation is rarely used and only useful in countries (e.g. Brazil, Bolivia) that
188+      quote tax rates as a percentage of the tax-included total.
189+      For the more usual need to compute tax amounts from a tax-included price, use the
190+      :guilabel: `Percentage of Price ` tax computation with the :ref: `taxes/included-in-price `
191+      option.
129192
130193- **Python code **
131194
@@ -134,9 +197,9 @@ Tax computation
134197  :guilabel: `Python Code ` defines the amount of the tax, and :guilabel: `Applicable Code ` defines if
135198  the tax is to be applied. The formula is found at the bottom of the :guilabel: `Definition ` tab.
136199
137- .. example ::
138-    :guilabel: `Python Code `: `result = price_unit * 0.10 `
139-    :guilabel: `Applicable Code `: `result = true `
200+    .. example ::
201+       :guilabel: `Python Code `: `result = price_unit * 0.10 `
202+       :guilabel: `Applicable Code `: `result = true `
140203
141204.. _taxes/active :
142205
@@ -256,19 +319,22 @@ invoice line.
256319Included in price
257320~~~~~~~~~~~~~~~~~ 
258321
259- With this option activated, the total (including the tax) equals the **sales price **.
322+ With this option activated, the tax will treat the sales price on which it is applied as a total
323+ including the tax amount. The tax computation will split the sales price into a base amount and a
324+ tax amount. This makes it suitable for B2C sales in most countries where prices are quoted
325+ tax-inclusive.
260326
261327`Total = Sales Price = Computed Tax-Excluded price + Tax `
262328
263329.. example ::
264-    A product has a sales price of $1000, and we apply a * 10% of Price *  tax, which is * included in 
265-    the price  * . We then have:
330+    A product has a sales price of $1000, and we apply a 10% :guilabel: ` Percentage  of Price`  tax
331+    with  :guilabel: ` Included in Price ` checked . We then have:
266332
267333   +-------------+-------------+----------+----------+ 
268334   |  Product     |  Price       |  Tax      |  Total    | 
269335   |  sales price |  without tax |           |           | 
270336   +=============+=============+==========+==========+ 
271-    |  1,000       |  900.10       |  90.9      |  1,000.00 | 
337+    |  1,000       |  909.09       |  90.91     |  1,000.00 | 
272338   +-------------+-------------+----------+----------+ 
273339
274340.. note ::
0 commit comments