Closed
Description
Describe the bug
When the tax zone of an order is changed, via a custom TaxZoneStrategy
, the new tax rate isn't applied to the existing order line.
To Reproduce
Steps to reproduce the behavior:
- Setup your current channel to use NL
- Create a Tax zone NL with rate 21%
- Create a Tax Zone LU with rate 17%
- Use the AddressBasedTaxZoneStrategy to determine zone based on address
- Add an item to cart. See in admin it will have tax rate 21%
- Set an address in Luxembourg on the order
- See in the admin that the tax rate in the order summary is still 21%
Some findings:
- I have confirmed that this line does set the tax rate to 17%, but it's somehow not persisted.
- The
orderLine.productVariant.taxRateApplied
is 17%, but theorderLine.taxLines
is[{ "description": "NL standaard", "taxRate": 21 }]
- Adding a new item, after the tax zone is changed, does set both
orderLine.productVariant.taxRateApplied
andorderLine.taxLines
to 17%
It seems a determined
It becomes even stranger when I add a new item to cart: The order will now have both tax rates applied.
I am still investigating this.
Environment (please complete the following information):
- @vendure/core version: 3.1.1
- Nodejs version 18
- Database (mysql/postgres etc): MySQL
Additional context
Add any other context about the problem here.