# Question about tax calculation

**URL:** https://discuss.tryton.org/t/question-about-tax-calculation/5466
**Category:** Developer
**Created:** [August 11, 2022, 5:44pm UTC](https://discuss.tryton.org/t/question-about-tax-calculation/5466 "2022-08-11T17:44:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![iehoshia](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/iehoshia/32/243_2.png) [@iehoshia](https://discuss.tryton.org/u/iehoshia)
#### Post date: [August 11, 2022, 5:44pm UTC](https://discuss.tryton.org/t/question-about-tax-calculation/5466/1 "2022-08-11T17:44:53Z")

</div>

Hi,

I have the follow case with tax calculation with a gas product that has a fixed tax.

1. I created a tax of type Fix ( $ 4.70) and added it to a category and products.
2. The price of product without tax is $ $ 29.29. After the tax is $ 33.99
3. A client purchase $ 200 of gas. To calculate the unit of the invoice I divide $ 200 / $ 33.99 = 5.8841 (rounded)
4. The invoice line has: Units 5.8841 \* 29.29 = $ 172.35 amount (rounded)
5. The invoice tax is $ 27.66.
6. The total amount of the invoice is $ 200.01

I’m not sure how to calculate the units of the invoice line in these case.

Thanks in advance.

---

<div class="post-metadata">

### Author: ![rmartin](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/rmartin/32/2135_2.png) [@rmartin](https://discuss.tryton.org/u/rmartin)
#### Post date: [August 11, 2022, 6:17pm UTC](https://discuss.tryton.org/t/question-about-tax-calculation/5466/2 "2022-08-11T18:17:47Z")

</div>

Might this help you?

> [@Tax-inclusive price definition](https://discuss.tryton.org/t/tax-inclusive-price-definition/3716):
>
> In Tryton it’s easy to adjust prices for each sale or sale-subscription - which is great. Given the logic of accounting, this are net process (tax-excluded), which is perfectly fine for almost all cases. Now in our CAS - which is B2C - the customer defines the price (there is a standard price to some members are adding a solidarity-amount to). The customer’s POV is tax-inclusive. So he/she says “I’m going to pay 25€”. So when entering the sale, we need to use a calculator to calculate the net-p…

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 11, 2022, 9:13pm UTC](https://discuss.tryton.org/t/question-about-tax-calculation/5466/3 "2022-08-11T21:13:57Z")

</div>

You must increase the [price decimal](https://docs.tryton.org/projects/modules-product/en/latest/configuration.html#price-decimal) if you want to be able to have the exact same result. The number of decimal depend of the kind of calculation done like the rate of the taxes, the range of quantity etc.

---

<div class="post-metadata">

### Author: ![iehoshia](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/iehoshia/32/243_2.png) [@iehoshia](https://discuss.tryton.org/u/iehoshia)
#### Post date: [August 11, 2022, 10:44pm UTC](https://discuss.tryton.org/t/question-about-tax-calculation/5466/4 "2022-08-11T22:44:39Z")

</div>

Thanks @ced

I increased decimal of quantity field and it works like a charm now.

Thanks.

---

<div class="post-metadata">

### Author: ![system](https://discuss-cdn.tryton.org/uploads/default/original/1X/c6f8ec0a40525cdcd50058c734283450a4b3d38b.png) [@system](https://discuss.tryton.org/u/system)
#### Post date: [September 10, 2022, 10:45pm UTC](https://discuss.tryton.org/t/question-about-tax-calculation/5466/5 "2022-09-10T22:45:37Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
