Tax removal on order level broken
Open
@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
- Tax zone "EU"
- Country: Belgium
- 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
- 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?
- Why isn't it a negative "tax" adjustment instead of a "discount"? Makes also the
getTotalTax() / getTotalTaxIncluded()andgetTotalDiscount()more logical in its values. - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.