# Shopware 6 and counting of VAT

**URL:** https://forum.shopware.com/t/shopware-6-and-counting-of-vat/72720
**Category:** Programming (EN)
**Created:** [11. Februar 2021 um 15:02 UTC](https://forum.shopware.com/t/shopware-6-and-counting-of-vat/72720 "2021-02-11T15:02:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![DouglasMurrel](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@DouglasMurrel](https://forum.shopware.com/u/DouglasMurrel)
#### Post date: [11. Februar 2021 um 15:02 UTC](https://forum.shopware.com/t/shopware-6-and-counting-of-vat/72720/1 "2021-02-11T15:02:39Z")

</div>

Hello,

Can anyone explain how Shopware counts VAT in total price for Cart?

I have a cart with one product that costs 1.309 euro. Tax rate is 19%, so tax value is 0.24871. This I can understand: 1.309/100\*19=0,24871.

But then it adds shipping cost (2 euro). It somehow makes 3.3074732824427 euro (don’t konow how), but even more strange for me that 19% from this amount makes 0.56871. How they are calculating this? 3.307/100\*19 is about 0.63, and 3.307/119\*19 is about 0.53, but not 0.57.

Also, is there any way to change this algorithm programmatically? I use in my Calculator $this-\>taxCalculator-\>calculateNetTaxes() for every product, but it doesn’t count total sum. And method $toCalculate-\>setPrice() in my CartProcessor doesn’t work.

---

<div class="post-metadata">

### Author: ![frezno](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/frezno/32/7801_2.png) [@frezno](https://forum.shopware.com/u/frezno)
#### Post date: [12. Februar 2021 um 07:30 UTC](https://forum.shopware.com/t/shopware-6-and-counting-of-vat/72720/2 "2021-02-12T07:30:11Z")

</div>

no idea what you are calculating / how do you come up with those numers.  
Let’s break it down:

cost of the product 1.309 net price  
shipping costs 2.000 net or gross price (how did you set it up in your shipping matrix?)

shipping 2 net price:  
1.309 + 2 = 3.309 + 19% = 3.9377

shipping 2 gross price  
1.309 + 1.6807 = 2.9897 + 19% = 3.5577

crucial is setting up the tax (product, shipping & handling) for the various countries / states

---

<div class="post-metadata">

### Author: ![DouglasMurrel](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@DouglasMurrel](https://forum.shopware.com/u/DouglasMurrel)
#### Post date: [12. Februar 2021 um 09:41 UTC](https://forum.shopware.com/t/shopware-6-and-counting-of-vat/72720/3 "2021-02-12T09:41:53Z")

</div>

> no idea how do you come up with those numers.

It’s just what I’m trying to understand

---

<div class="post-metadata">

### Author: ![DouglasMurrel](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@DouglasMurrel](https://forum.shopware.com/u/DouglasMurrel)
#### Post date: [12. Februar 2021 um 10:00 UTC](https://forum.shopware.com/t/shopware-6-and-counting-of-vat/72720/4 "2021-02-12T10:00:52Z")

</div>

Here is part of dump of total price:

```
 #calculatedTaxes: [Shopware\Core\Checkout\Cart\Tax\Struct\CalculatedTaxCollection](https://elbfood.yourwebstudio.ru/_profiler/open?file=vendor/shopware/platform/src/Core/Checkout/Cart/Tax/Struct/CalculatedTaxCollection.php&line=15#line15) {[#5617 ▼](https://elbfood.yourwebstudio.ru/checkout/confirm#sf-dump-1240599430-ref25617 "2 occurrences
[Ctrl+click] Expand all children") #elements: array:1 [▼ 19 =\> [Shopware\Core\Checkout\Cart\Tax\Struct\CalculatedTax](https://elbfood.yourwebstudio.ru/_profiler/open?file=vendor/shopware/platform/src/Core/Checkout/Cart/Tax/Struct/CalculatedTax.php&line=8#line8) {#5604 ▼ #tax: 0.56871 #taxRate: 19.0 #price: 3.3074732824427 #extensions: [] } ] #extensions: [] }

```

So, how 19% from 3.3074732824427 can equals 0.56871 ?
