During the last two days I spent quite some time configuring a Swiss B2C Magento v184.108.40.206 store with 8% VAT. For clients from Switzerland and Liechtenstein, prices should display including tax (gross = Brutto) on all catalog pages. Both in the shopping cart and on the checkout confirmation page, VAT should be correctly shown in the order totals as indicated in the screenshot below.
Sales / Tax Settings
The first set of the configurations that needs to be taken care of is under Sales/Tax in your Magento backend. You might want to delete the US tax rates, classes and rules that come with the default installation before you create new ones.
Manage Tax Rates
First you will have to create two different tax rates, one for Switzerland and one for Liechtenstein.
Product Tax Class
After that, create a tax class called 8% MwSt. or 8% TVA if you’re from the French part of Switzerland.
Manage Tax Rules
In the last step create a tax rule where you select your just created product tax class and both new tax rates.
System / Configuration / Sales / Tax Settings
The second set of configurations is under System / Configuration / Sales / Tax. Although Magento lets you decide whether you want catalog prices to be entered in the backend including or excluding tax, for a B2C store excluding tax is the only viable option, because if you set this to including tax and enter all product prices as gross prices you will end up with VAT added on top of product prices which does not make sense.
So here’s how the tax setting look in my B2C store.
That would now all be very straight forward if it wasn’t for something called Swedish rounding.
The term Swedish rounding is used mostly in Australia, where such a method has been practiced since the 1990s. In Switzerland it is called 5 cent rounding (5-Rappen-Rundung). It means rounding with 0.05 intervals.
If a products costs e.g. 49.00 CHF (Swiss Francs) including 8% tax, it is entered in the Magneto backend excluding tax (net) for 45.3704 CHF. It is required that you use at least 4 decimal places (Nachkommastellen), so that the 5 cent rounding is working OK. If you add 8% to the net price, it will amount to 49.000032, but as only 2 decimal places are shown, it will be 49.00.
After saving a product with 4 decimal places in Magento, the backend will only display 2 decimal places, but in the database it will store all 4. The problem here is that if you save this product for the second time, it will then only save 2 decimal places in the database which will then result in incorrect rounding, i.e. if you add 8% tax to 45.37 you will end up with a gross price of 48.99.
Although I imported all prices with 4 decimal places into my client’s B2C store, I have some rare instances where the Swedish rounding is not working as expected. I checked those products in the database and can confirm that they have 4 decimal places, but still end up with prices not rounded to 0.05 intervals.
I will take another approach next week to understand why this is happening and will then try to share more insights in this article.
If you want to learn more about this complex subject matter, the Magento Knowledge Base holds very detailed information about Magento tax settings. Once I get this 100% right, I will try to get this information directly into the knowledge base.