1 parent
b43b285125
commit
e9b7a8c1f3
2 files changed
+9
-2
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/dashboard": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(dashboard): nan in tax total
|
||||||
+4
-2
@@ -575,9 +575,10 @@ const CostBreakdown = ({
|
|||||||
|
|
||||||
order.items.forEach((item) => {
|
order.items.forEach((item) => {
|
||||||
item.tax_lines?.forEach((line) => {
|
item.tax_lines?.forEach((line) => {
|
||||||
|
const currTotal = line.subtotal || 0
|
||||||
const prevTotal = taxCodeMap[line.code]?.total || 0
|
const prevTotal = taxCodeMap[line.code]?.total || 0
|
||||||
taxCodeMap[line.code] = {
|
taxCodeMap[line.code] = {
|
||||||
total: prevTotal + line.subtotal,
|
total: prevTotal + currTotal,
|
||||||
rate: line.rate,
|
rate: line.rate,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -585,9 +586,10 @@ const CostBreakdown = ({
|
|||||||
|
|
||||||
order.shipping_methods.forEach((sm) => {
|
order.shipping_methods.forEach((sm) => {
|
||||||
sm.tax_lines?.forEach((line) => {
|
sm.tax_lines?.forEach((line) => {
|
||||||
|
const currTotal = line.subtotal || 0
|
||||||
const prevTotal = taxCodeMap[line.code]?.total || 0
|
const prevTotal = taxCodeMap[line.code]?.total || 0
|
||||||
taxCodeMap[line.code] = {
|
taxCodeMap[line.code] = {
|
||||||
total: prevTotal + line.subtotal,
|
total: prevTotal + currTotal,
|
||||||
rate: line.rate,
|
rate: line.rate,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in new issue
Block a user