craftcms / craftcms/commerce

Tax removal on order level broken

Open
#3,386 3 comments 0 reactions 1 assignee View on GitHub

@lukeholder is already working on this.

Since Feb 2, 2025.

commerce4
Dominant language
PHP
Stars
240
Forks
173
Avg merge
5d 11h
Merged PRs (30d)
8

Description

What happened?
Description

On an order when you have a valid EU vat-id the tax doesn't get removed on order level because it gets removed by the discount logic.

Steps to reproduce
  1. Tax zone "EU"
  • Country: Belgium
  1. Tax Rates "Eu"
  • Taxable subject: Order total taxable price
  • Tax Zone: EU
  • Disqualify with valid business tax ID?: EU VAT ID checked
  • Rate: 21%
  • Included in price?: checked
  • Adjust price when included rate is disqualified?: false
  • Remove the included tax when a valid EU VAT ID is present?: true
  1. Create an order with Belgium as country and have a valid "Organization Tax ID"
Expected behavior

Negative tax applied on order level

Actual behavior

Tax line just removed https://github.com/craftcms/commerce/blob/develop/src/adjusters/Discount.php#L139

Solution?
  1. Why isn't it a negative "tax" adjustment instead of a "discount"? Makes also the getTotalTax() / getTotalTaxIncluded() and getTotalDiscount() more logical in its values.
  2. Actually all discount adjusters on order level are broken
Craft CMS version

4.7.3

Craft Commerce version

4.4.1.1

PHP version

8.3.2

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.