Describe your bug or feature request.

Currently, the EuropeanUnionVat tax type plugin inherits the applies() logic from its parent (LocalTaxTypeBase).

The applicability is determined based on either the store address, or the tax registration.

The EU VAT logic shouldn't apply only because a store is based in Europe for example, since a store might not be required to collect VAT until a certain threshold (See https://www.avalara.com/vatlive/en/eu-vat-rules/eu-vat-number-registrati...).

I'm suggesting we replace:


  /**
   * {@inheritdoc}
   */
  public function applies(OrderInterface $order) {
    $store = $order->getStore();
    return $this->matchesAddress($store) || $this->matchesRegistrations($store);
  }

By

  /**
   * {@inheritdoc}
   */
  public function applies(OrderInterface $order) {
    $store = $order->getStore();
    return $this->matchesRegistrations($store);
  }

This is an important change, that might break existing installations.

In order to mitigate the impact, we should write a post update function updating all EU stores to set, if a EU VAT tax type is present on the site.
The update should update the tax registration field and should set it to match the store country.

The tests need to be updated to reflect this new logic.

I'm thinking the July 2021 VAT changes should be implemented separately, as part of #3216754: Prepare Commerce Tax for the EU July 2021 eCommerce VAT package.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jsacksick created an issue. See original summary.

jsacksick’s picture

Issue summary: View changes
jsacksick’s picture

Title: EU VAT application should be determined based on the tax registration » Local tax type application should be determined based on the tax registrations

Retitling, as this applies to all local tax type plugins.

jsacksick’s picture

Status: Active » Needs review
FileSize
15.29 KB

Status: Needs review » Needs work

The last submitted patch, 4: 3246388-4.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

jsacksick’s picture

Status: Needs work » Needs review
FileSize
17.07 KB
jsacksick’s picture

Status: Needs review » Fixed

Committed.

  • jsacksick committed 6aecb2f on 8.x-2.x
    Issue #3246388 by jsacksick, dwkitchen: Local tax type application...

  • jsacksick committed f3b573a on 3.0.x
    Issue #3246388 by jsacksick, dwkitchen: Local tax type application...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.