fix(utils,medusa,order,cart): fix totals when promotions are included (#9014)
* fix(utils): fix totals when promotions are included * chore: update totals calc * chore: ignore taxes when taxable amount is 0 * chore: use subtotals everywhere * chore: fix shipping totals + tests
This commit is contained in:
@@ -211,7 +211,7 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
||||
expect(created.summary).toEqual(
|
||||
expect.objectContaining({
|
||||
transaction_total: 68,
|
||||
pending_difference: -20.21999000999001,
|
||||
pending_difference: -20.10799200799201,
|
||||
paid_total: 68,
|
||||
refunded_total: 0,
|
||||
})
|
||||
@@ -236,7 +236,7 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
||||
expect(serializedOrder.summary).toEqual(
|
||||
expect.objectContaining({
|
||||
transaction_total: 48,
|
||||
pending_difference: -0.21999000999001,
|
||||
pending_difference: -0.10799200799201,
|
||||
paid_total: 68,
|
||||
refunded_total: 20,
|
||||
})
|
||||
@@ -255,7 +255,7 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
||||
expect(serializedOrder2.summary).toEqual(
|
||||
expect.objectContaining({
|
||||
transaction_total: 68,
|
||||
pending_difference: -20.21999000999001,
|
||||
pending_difference: -20.10799200799201,
|
||||
paid_total: 68,
|
||||
refunded_total: 0,
|
||||
})
|
||||
@@ -282,7 +282,7 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
||||
paid_total: 68,
|
||||
refunded_total: 50,
|
||||
transaction_total: 18,
|
||||
pending_difference: 29.78000999000999,
|
||||
pending_difference: 29.89200799200799,
|
||||
})
|
||||
)
|
||||
|
||||
@@ -301,7 +301,7 @@ moduleIntegrationTestRunner<IOrderModuleService>({
|
||||
paid_total: 68,
|
||||
refunded_total: 70,
|
||||
transaction_total: -2,
|
||||
pending_difference: 49.78000999000999,
|
||||
pending_difference: 49.89200799200799,
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user