question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Current shipping rate VAT calculation is incorrect more often than not

See original GitHub issue

Bug report

Describe the bug

A clear and concise description of what the bug is.

https://www.taxdoo.com/en/blog/how-to-determine-the-vat-rate-on-shipping-costs-etc-and-how-to-reduce-the-vat-rate-on-some-products-7795/

If the shipping cost is 6 euros 

Book “Effect of spices”: 10 euros plus 0.70 euros Value Added Tax (7 percent Value Added Tax)
Tonka beans: 20 euros plus 3.80 euros Value Added Tax (19 percent Value Added Tax)
Shipping costs (book): 2 euros plus 0.14 euros Value Added Tax (7 percentValue Added Tax)
Shipping costs (tonka beans): 4 euros plus 0.76 euros Value Added Tax (19 percent Value Added Tax).

System information

Medusa version (including plugins): 1.7.0 Node.js version: v16.18.1 Database: PostgreSQL Operating system: Windows 10

Steps to reproduce the behavior

  1. npm run seed
  2. Go to tax settings / EU 2.1. Change default tax rate to 21% 2.2 Add a new reduced 7% tax rate with an override for the Medusa Mug
  3. Create a draft order that only contains the single Medusa Mug and uses PostFake Standard

image

Screenshots

image

Expected behavior

Tax should be 1.40€

  • 0.7€ product VAT since Mug costs 10€
  • 0.7€ shipping VAT since shipping costs 10€

Current behavior

Tax is 2.80€

  • 0.7€ product VAT
  • 2.1€ shipping VAT

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
josetrcommented, Dec 18, 2022

My bad, I meant the math was wrong, not the tax calculation method itself.

I do agree that using TaxJar / Avalara is the right way to do it, but those options are not free, and adding the option that I’m suggesting will be enough for a lot of people, especially those that are only making domestic sales (as long as it’s not the US).

0reactions
olivermrblcommented, Dec 18, 2022

I think the 2nd tax calculation that you’ve provided is also wrong

The override is for the shipping option with a price of $10 (I updated my example as I noticed it was missing the option), so I don’t think it’s directly wrong - at least not in all cases. As you mention, it depends on the country you’re shipping to and how you calculate shipping tax. Right now, we do it in isolation from products. But let us not dwell on details here.

I think your suggestion on making shipping tax depend on products rather than being a separate calculation is reasonable, and I will bring this up for our tax specialists.

Yes, taxes are indeed notoriously complex and hard to handle. Our current way of calculating taxes likely falls short in some areas and can be inadequate for merchants. For those cases, I recommend integrating with an advanced taxes engine like TaxJar or Avalara. These are specialized tools built to cover all cases. We’ve created a tax-provider interface, that should make the integration work less heavy. Alternatively, you can also build your own tax-calculation strategy giving you full control of the calculation done on items in your cart.

I will get back with an update from our taxes team soon 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

VAT on shipping costs in 2021: Everything you need to know
Always calculate VAT based on the subtotal amount for the order plus the shipping costs.
Read more >
Wrong tax rate calculation in CA - WordPress.org
Hi,. We received a purchase from Los Angeles, CA 90046 and our website calculated this tax https://snipboard.io/wKxzbk.jpg which doesn't seem to be correct ......
Read more >
EU OSS (One Stop Shop) - End pricing issues, wrong price ...
€99 should always be €99, regardless of 19% VAT or 20% VAT or 25% VAT, only the VAT part of the total price...
Read more >
Setting up Taxes in WooCommerce
The team at WooCommerce.com can help with setting up tax rates in the WooCommerce settings and how the platform handles taxes/VAT/GST based on...
Read more >
Troubleshoot Shipment Issues - ShipStation Help
Common error messages that occur when getting rates or creating ... Skip label warnings do not stop you from creating shipping labels, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found