From e9b7a8c1f3c6f3d6d4447d8f57f15d20dedf0d28 Mon Sep 17 00:00:00 2001 From: William Bouchard <46496014+willbouch@users.noreply.github.com> Date: Wed, 8 Oct 2025 07:45:32 -0400 Subject: [PATCH] fix(dashboard): nan in tax total (#13699) CLOSES CORE-1210 --- .changeset/rude-adults-melt.md | 5 +++++ .../order-summary-section/order-summary-section.tsx | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/rude-adults-melt.md diff --git a/.changeset/rude-adults-melt.md b/.changeset/rude-adults-melt.md new file mode 100644 index 0000000000..0c729b0f61 --- /dev/null +++ b/.changeset/rude-adults-melt.md @@ -0,0 +1,5 @@ +--- +"@medusajs/dashboard": patch +--- + +fix(dashboard): nan in tax total diff --git a/packages/admin/dashboard/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx b/packages/admin/dashboard/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx index b05dbbac09..2a5da2a2cc 100644 --- a/packages/admin/dashboard/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx +++ b/packages/admin/dashboard/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx @@ -575,9 +575,10 @@ const CostBreakdown = ({ order.items.forEach((item) => { item.tax_lines?.forEach((line) => { + const currTotal = line.subtotal || 0 const prevTotal = taxCodeMap[line.code]?.total || 0 taxCodeMap[line.code] = { - total: prevTotal + line.subtotal, + total: prevTotal + currTotal, rate: line.rate, } }) @@ -585,9 +586,10 @@ const CostBreakdown = ({ order.shipping_methods.forEach((sm) => { sm.tax_lines?.forEach((line) => { + const currTotal = line.subtotal || 0 const prevTotal = taxCodeMap[line.code]?.total || 0 taxCodeMap[line.code] = { - total: prevTotal + line.subtotal, + total: prevTotal + currTotal, rate: line.rate, } })