href / duties

Swiss Online Import Costs Calculator
MIT License
4 stars 1 forks source link

Incorrect computation of VAT #3

Closed matalek closed 1 year ago

matalek commented 1 year ago

Consider the following example: Price: 50 CHF Shipping: 0 CHF Courier: Post

For this example the calculator displays Your 7.7% VAT is 5.20., even though 7.7% out of 50 is 3.85 CHF. The VAT should be computed based on the product price, not (product price + fees).

From Post FAQ:

VAT: Consignments are exempt from duties if the goods do not exceed the following value (including shipping costs):

  • 65 francs at a VAT rate of 7.7%

Similarly, in the example specified in this blog post, the VAT is computed based on value of goods.

This makes a big difference especially for small values, since it makes taxes non-zero for lower values than it actually should.

I think the fix would be to change this line to compute r.vat only based on r.worth, not r.worth + r.duty.

href commented 1 year ago

Thanks for your report.

I'm not sure that you are correct. From what I recall - it's been a while since I wrote this - the VAT is applied to the worth and duty. See also the following page from the federal government, which seems to agree with me:

https://www.bazg.admin.ch/bazg/en/home/information-individuals/online-shopping--mail-and-courier-consignments/onlineshopping--sample-calculation---taxable-goods-value.html

However, I haven't used this tool in a while, as many shops delivering to Switzerland now calculate that price for you. I also didn't read up about this in a long time.

So I'm not saying you're wrong, but I have a hard time judging if you are right. If you can explain the difference between the Post example, and the link I posted above (or maybe tell my why that does not apply), then I'm happy to change to code to your suggestion. I leave it up to you to get to the bottom of this, and I'll gladly change the code if you can.

I'm also happy to take a PR. Note that there is a tests.js file, that includes a few examples. Those would have to be updated.

matalek commented 1 year ago

You're right that one has to pay VAT also on duties. But from the links I shared it looks like this VAT is not included in the 5 CHF exemption limit. Which makes sense - if you're below the limit there are no duties applied.

I propose to make the logic explicitly follow the logic described on Post FAQ, i.e. compare the value of goods with 65/200 CHF limit. This makes more sense than just checking the computed VAT, because already for 64.65 CHF the rounded 7.7% VAT is 5 CHF, yet, per FAQ, you don't need to pay taxes then.

For the values above the threshold, the current logic will stay the same - we will compute VAT for both value of goods and duties.

I'll send a PR shortly. The tests file is actually currently failing, I'll fix that as well.

href commented 1 year ago

As noted in the PR, LGTM.

Thanks for your help!