driesvints / vat-calculator

Handle all the hard stuff related to EU MOSS tax/vat regulations, the way it should be.
MIT License
1.2k stars 88 forks source link

GB is no longer EU #124

Closed Timhbl closed 2 years ago

Timhbl commented 3 years ago

VIES (https://ec.europa.eu/taxation_customs/vies/vatRequest.html) dropped support for GB.

Should it be removed from the vat-calculator?

driesvints commented 3 years ago

Yes, although you still need to pay taxes when you reach a certain threshold.

This will be removed in a future version but for now you can overwrite it in the config file if you want.

GrahamCampbell commented 3 years ago

See https://www.gov.uk/guidance/the-vat-rules-if-you-supply-digital-services-to-private-consumers#the-place-of-supply-of-digital-services (assuming you are selling digital services :trollface:).

driesvints commented 3 years ago

@GrahamCampbell first paragraph on the register page:

You must register your business for VAT with HM Revenue and Customs (HMRC) if its VAT taxable turnover is more than £85,000.

So yes, if you exceed that number only you need to register. In reality I suspect that whoever is doing that probably has better ways to calculate tax than this package 😅

GrahamCampbell commented 3 years ago

That line only applies to UK companies. I don't know where to find correct information for an EU company selling B2C digital services into the UK. ~I would suspect the threshold is the same as it was under MOSS due to the porting of EU law into UK law as part of the Brexit process, so it'd be the GBP equivalent of 10k EUR.~

GrahamCampbell commented 3 years ago

It looks like there is actually no registration threshold. Any non-UK entity must register for VAT with HMRC when they make there first B2C digital services sale. https://blog.taxamo.com/insights/vat-and-brexit

driesvints commented 3 years ago

That doesn't seems to be true from what some accountants in Belgium say. Honestly I don't think anyone knows what the actual rules are at this point 🤷🏻‍♂️

jbarmanet commented 2 years ago

Hi, did anyone managed to disable successfully GB tax rate, or at least put this GB vat rate to 0%, with the new Laravel Spark? @driesvints I published the config file as advised, and wrote

'rules' => [
    'GB' => 0,
],

in it, but the United Kingdom Vat is still stuck to the old 20% rate when selecting the country in the Spark form...

driesvints commented 2 years ago

@jbarmanet no idea why it wouldn't work for you in spark sorry.

jbarmanet commented 2 years ago

@driesvints the issue is with the class Mpociot\VatCalculator\VatCalculator as it takes an optional $config argument as constructor... And if you don't pass anything into this constructor (that is what Spark does, it just instantiates the class without any configuration argument:$vatCalculator = new VatCalculator;), then the overriden config value is not taken in account when Spark makes the call to $vatCalculator->getTaxRateForLocation(...) method. An improvement idea would be to make VatCalculator able to know by itself if there is an overriden config to check or not...

jbarmanet commented 2 years ago

Just sharing my solution so far if it can help anyone, I duplicated the VatCalculator class into a custom location of mine, in order to intercept GB country code and return 0 instead of 0.2 after line 630 in the method getTaxRateForLocation. At the end it looks like this:

public function getTaxRateForLocation($countryCode, $postalCode = null, $company = false, $type = null)
    {
        if ($company && strtoupper($countryCode) !== strtoupper($this->businessCountryCode)) {
            return 0;
        }
        $taxKey = 'vat_calculator.rules.'.strtoupper($countryCode);
        if (isset($this->config) && $this->config->has($taxKey)) {
            return $this->config->get($taxKey, 0);
        }
        /**** DULL OVERRIDE HERE ****/
        if (strtoupper($countryCode) == 'GB') {
            return 0;
        }
        // Rest of the class.......... 

Then in your composer file you must redirect the original namespace to point to your duplicated-modified file, and exclude the original file to avoid a warning about ambiguous class resolution, as is:

"autoload": {
        "psr-4": {
            "App\\": "app/",
            "Mpociot\\VatCalculator\\": "app/Overrides/"
        },
        "exclude-from-classmap": ["vendor/mpociot/vat-calculator/src/Mpociot/VatCalculator/VatCalculator.php"]
    },

At the end don't forget to run composer dump-autoload to apply your changes.

driesvints commented 2 years ago

that is what Spark does, it just instantiates the class without any configuration argument

Thanks for noting me that. I'm checking in on that 👍

driesvints commented 2 years ago

@jbarmanet we released Spark v1.1.8 which fixes that : )

driesvints commented 2 years ago

I've released v3.0.0 of the package which removes this VAT rule.