vendure-ecommerce / vendure

The commerce platform with customization in its DNA.
https://www.vendure.io
Other
5.63k stars 995 forks source link

Order Line Price wrong calculation with pricesIncludeTax true in channel #3047

Open LavaSean opened 3 weeks ago

LavaSean commented 3 weeks ago

Describe the bug Currently the default tax rate is 9%, and this is my order as u can see the unit price is 366.06 without tax and 399.00 with tax, however when i change the quantity to 2, the line price (without tax) become 732.11 instead of 732.12, i believe it related to the MoneyStrategy in https://github.com/vendure-ecommerce/vendure/pull/3023 where this issue does not exist in vendure demo site with version 3.0.0, i believe the line price issue need to be fix another way instead of reusing the MoneyStrategy in order not to broke the discount issue in the pr attached above.

Screenshot 2024-09-06 at 6 15 45 PM

Note: im using the latest moneyStrategy for version 3.1.0-next.0

To Reproduce Steps to reproduce the behavior:

  1. Enable the 'Prices include tax for the default Zone' checkbox in channel
  2. Add default tax rate to 9%
  3. Create a product with price 399.00
  4. Create an order, add a line with 2 quantity of the product created

Expected behavior The line price (without tax) should be 732.12 instead of 732.11, it should be the value of unit price * quantity

Environment (please complete the following information):

Additional context Pr that might be related https://github.com/vendure-ecommerce/vendure/pull/3023 https://github.com/vendure-ecommerce/vendure/issues/2662

LavaSean commented 3 days ago

Related https://github.com/vendure-ecommerce/vendure/issues/3091