Skip to content

Discount should be applied before tax is caclulated #831

@yhortuk

Description

@yhortuk
  • Lunar version: v0.2-rc1

Expected Behaviour:

In cart:
Item 1.96 x 2 = 3.92 USD
Shipping = 13 USD
Discount 10% = 0.39
Vat 24% = (3.92 - 0.39 + 13) * 0.24 = 3.97

Actual Behaviour:

In cart:
Item 1.96 x 2 = 3.92 USD
Shipping = 13 USD
Discount 10% = 0.39
Vat 24% = (3.92 + 13) * 0.24 = 4.06

Steps To Reproduce:

  1. Add tax rule
  2. Create discount
  3. Create a cart instance
  4. Add item and shipping option to the cart
  5. Call $cart->calculate()
  6. Call $cart->taxTotal

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions