fix(medusa): totals calculation with gift card (#5075)

**What**
Resolve potential discrepency between what is calculated in the `createFromCart` and the cart/order totals calculation.
When the giftCard is taxable then the following calculation is applied 
```ts
cart.subtotal + cart.shipping_total - cart.discount_total
```
otherwise
```ts
 cart.subtotal +
          cart.shipping_total +
          cart.tax_total -
          cart.discount_total
```

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Adrien de Peretti
2023-10-25 10:29:30 +00:00
committed by GitHub
co-authored by Oli Juhl
parent 8bb8eb530b
commit e64823d1b9
6 changed files with 84 additions and 29 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---
fix(medusa): totals calculation with gift card