Developer forum

Forum » Dynamicweb 10 » VAT calculation on taxes

VAT calculation on taxes

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a project in DW 10 where I need to add some taxes.
I have tried first with a flat rate provider and I have noticed that the values returned by the TemplateTags for "With VAT" and "Without VAT" are both the same, including VAT.
Is this by design or a bug?

I am running on DW 10.17.6

Thank you,
Adrian


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Tax providers create order lines, and don't update VAT properties. Take a look at the order in the backend / frontend / database and you'll see lines of type 4 which means it's a tax line.

To see the implementation, look at EcomTaxProvider and the base class TaxProvider

Imar

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

And there are no VAT ontax lines...

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have tried accessing the properties in the ViewModel (cart summary) and this tag: order.TotalTax.PriceWithoutVATFormatted correctly returned the value of the tax without VAT.
I can see why the tax would not be (usually) a VAT carrier, but one of my customers is using a form of Charges that is (apparently) subject to VAT charges as well.
We cannot handle this as a regular product for various reasons. So far, it seems that the ViewModel properties are doing what we expect them to do. Based on your response, I suppose that the template tags will not be adjusted to reflect the same approach, right?

Thank you,
Adrian

 

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

One more thing about this topic.
If I set the tax (flat rate provider) to 50, the displayed tax is 60.5 (50 + 21% VAT rate).

Therefore, some logic exists for VAT and Taxes.

I hope this helps.
Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi

VAT on taxes is affected on 2 things - if the prices in database is set to be with vat or not - and then the tax provider it self has VAT=true/false. The flat tax provider is hardcoded to vat = true - so it actually adds VAT. That should probably be a setting so it can be controlled.

The Ecom:Order.Taxes.Total tags are reflected by the setting "show prices with vat" - so if you add ?PricesWithVAT=false|true - the tax amount would change accordingly.

So we could change those 2 things - to correctly calculate sum of order taxes when VAT is included - and being able to set that on the flattaxprovider.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Ok. It makes sense. Maybe also correct the template tags to reflect the with/without VAT values correctly?

That's assuming the template tags will still be a thing for a while.

Thank you,
Adrian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Added a bug to fix the totals using the order renderer. https://doc.dynamicweb.dev/documentation/fundamentals/dw10release/releasenotes/workiteminfo.html?workitemid=25988

Added a feature to implement a setting to control VAT using the flattaxprovider. https://doc.dynamicweb.dev/documentation/fundamentals/dw10release/releasenotes/workiteminfo.html?workitemid=25989

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Worth noting that Ecom:Order.Taxes.Total.* tags will get the correct values.

"Ecom:Order.Taxes.TotalPrice" tags will remain unchanged and will show taxes depending on if prices are shown with or without VAT

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thank you,

Adrian

 

You must be logged in to post in the forum