Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EU B2B rule #155

Closed
Tychodewaard opened this issue Aug 18, 2018 · 4 comments · Fixed by #304
Closed

EU B2B rule #155

Tychodewaard opened this issue Aug 18, 2018 · 4 comments · Fixed by #304

Comments

@Tychodewaard
Copy link

Describe the solution you'd like

EU requires VAT not to be calculated within the EU when:

  • The transaction is B2B
  • The invoice address and the shipping address are not in the same country as the shop country.

In an ideal world this setup is flexible as the actual law is a more complex. https://www.baldwin.agency/blog/management/vat-rules-for-webshops/

But the first stated rule covers most situations, I think.
That is: I have no private persons as customers and no companies that exceed thresholds in other countries.

@Navilois
Copy link
Contributor

Navilois commented Nov 5, 2019

I'm running into similar problems in my B2B only shop. What it comes down to is the tax exemption number. I've implemented the input at checkout, but I need to remove tax once a valid tax exemption number has been added.
This needs to be overruled by tax rules for specific EU countries though.

I'll have a solution soon (tm)

@Navilois
Copy link
Contributor

Navilois commented Jun 25, 2020

It appears Soon (tm) = 8 months in this case.
I have a working solution in a custom controller. However I believe it would benefit Hotcakes greatly to implement this enhancement for EU users - it's a must have for European webshops.

This is the basic commit for Hotcakes: Navilois@d767231

  • There's a VatNumber input [id="@(Model.Prefix + "vatnumber")"] at _CheckoutAddress.cshtml
  • OnChange() calls Checkout.js / ApplyEUVatRules() -> AJAX Request to Checkout/ApplyEUVatRules
  • If it's a valid VAT number and the store's country != the VAT number country -> set all order.Items to TaxExempt = true
  • Refresh the totals table

Remarks:

  • Can't use user.TaxExempt, because there's no user yet when using GuestCheckout.
  • I'm using a custom workflow to store the VAT number in the TaxExemptionNumber field of the user later when processing the order
  • Possible breaking change when resetting the TaxExempt flag to false on invalid VAT numbers - items that have been legit TaxExempt aren't any longer. Requires a little more work, e.g. don't set to false but to the LineItem value.

Todo:

  • Admin setting to activate EU VAT rules
  • RegEx is hardcoded in this commit. It won't change often (Brexit is next) but it's definitely not best practice ;)

There's probably some more things to think about, which exceed my knowledge of Hotcakes. If you're willing to put some work into this, I'll be happy to help implementing a proper solution @hismightiness

Navilois added a commit to Navilois/hotcakes-commerce-core that referenced this issue Jun 26, 2020
@Navilois
Copy link
Contributor

This PR is live at https://www.sierzega.com/en-us/products/checkout

  • Moved it from a custom controller to my Hotcakes fork
  • Fixed the item.TaxExempt reset to reflect the products default
  • Still missing feedback to the user on invald VAT. Coming soon (tm)

@Navilois
Copy link
Contributor

Added localized validation msg via controller.resx

@WillStrohl WillStrohl added this to the 03.04.02 milestone Jul 22, 2020
@WillStrohl WillStrohl linked a pull request Jul 22, 2020 that will close this issue
WillStrohl pushed a commit that referenced this issue Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants