fix(medusa-plugin-brightpearl): account for shipping prices being tax inclusive (#2536)
**What** BP plugin was recording total shipping price based on the shipping_method.price; however, this value may be with or without taxes depending on the tax inclusivity setting. This change ensures that the shipping price is calculated correctly.
This commit is contained in:
1 parent
2e553ce42a
commit
61da5f3650
3 files changed
+10
-1
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"medusa-plugin-brightpearl": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(medusa-plugin-brightpearl): account for shipping prices being tax inclusive
|
||||||
@@ -25,6 +25,7 @@ const order = {
|
|||||||
{
|
{
|
||||||
name: "standard",
|
name: "standard",
|
||||||
price: 12399,
|
price: 12399,
|
||||||
|
subtotal: 12399,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
payment_method: {
|
payment_method: {
|
||||||
@@ -66,6 +67,7 @@ const krwOrder = {
|
|||||||
{
|
{
|
||||||
name: "standard",
|
name: "standard",
|
||||||
price: 12399,
|
price: 12399,
|
||||||
|
subtotal: 12399,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
payment_method: {
|
payment_method: {
|
||||||
@@ -109,6 +111,7 @@ const roundingOrder = {
|
|||||||
{
|
{
|
||||||
name: "standard",
|
name: "standard",
|
||||||
price: 0,
|
price: 0,
|
||||||
|
subtotal: 0,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
discounts: [
|
discounts: [
|
||||||
@@ -159,6 +162,7 @@ const TotalsService = {
|
|||||||
getShippingMethodTotals: () => {
|
getShippingMethodTotals: () => {
|
||||||
return {
|
return {
|
||||||
price: 0,
|
price: 0,
|
||||||
|
subtotal: 0,
|
||||||
discount_total: 0,
|
discount_total: 0,
|
||||||
tax_total: 0,
|
tax_total: 0,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -994,7 +994,7 @@ class BrightpearlService extends BaseService {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
return {
|
return {
|
||||||
price: accum.price + totals.price,
|
price: accum.price + totals.subtotal,
|
||||||
tax: accum.tax + totals.tax_total,
|
tax: accum.tax + totals.tax_total,
|
||||||
}
|
}
|
||||||
}, Promise.resolve({ price: 0, tax: 0 }))
|
}, Promise.resolve({ price: 0, tax: 0 }))
|
||||||
|
|||||||
Reference in new issue
Block a user