@medusajs/dashboard 2.10.0-snapshot-20250828141936 → 2.11.0-snapshot-20250828185926

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/{add-campaign-promotions-UQVBTTWK.mjs → add-campaign-promotions-U277KTL4.mjs} +3 -3
  2. package/dist/app.css +0 -6
  3. package/dist/app.js +211 -120
  4. package/dist/app.mjs +2 -2
  5. package/dist/{campaign-detail-FIO6336E.mjs → campaign-detail-6454LL3C.mjs} +3 -3
  6. package/dist/{chunk-H3JGGHAQ.mjs → chunk-6OHAQHB4.mjs} +1 -1
  7. package/dist/{chunk-RQYKGJZ4.mjs → chunk-BZIE4MY6.mjs} +1 -1
  8. package/dist/{chunk-D4T3GFML.mjs → chunk-F7LJJHQT.mjs} +7 -0
  9. package/dist/{chunk-G4ARHIQV.mjs → chunk-FLUC3I3N.mjs} +1 -1
  10. package/dist/{chunk-SJFXY376.mjs → chunk-MFN6KGYE.mjs} +26 -26
  11. package/dist/{chunk-XDYQGXJ3.mjs → chunk-OQXWDAEB.mjs} +2 -1
  12. package/dist/{chunk-WLTKZNOI.mjs → chunk-YTDRSPOL.mjs} +1 -1
  13. package/dist/{order-create-claim-DBL2BU5Q.mjs → order-create-claim-ATLKY2SH.mjs} +1 -1
  14. package/dist/{order-create-edit-INKNOFBY.mjs → order-create-edit-5LOTLPD6.mjs} +1 -1
  15. package/dist/{order-create-exchange-6E2VLPU3.mjs → order-create-exchange-TOELYZPA.mjs} +1 -1
  16. package/dist/{order-create-refund-HJMKDY6S.mjs → order-create-refund-ZZNAUXIA.mjs} +1 -1
  17. package/dist/{order-create-return-IIEBZOZZ.mjs → order-create-return-2HT4V6UE.mjs} +1 -1
  18. package/dist/{order-detail-BDX6VUSZ.mjs → order-detail-M27ZGXL3.mjs} +202 -119
  19. package/dist/{order-edit-billing-address-K2SUQK3S.mjs → order-edit-billing-address-5HQFWKN2.mjs} +1 -1
  20. package/dist/{order-edit-email-FSHV32T6.mjs → order-edit-email-2W33H5CV.mjs} +1 -1
  21. package/dist/{order-edit-shipping-address-RV2QZCR5.mjs → order-edit-shipping-address-VE2BJEHO.mjs} +1 -1
  22. package/dist/{order-request-transfer-NJ24WZ26.mjs → order-request-transfer-U52O2EVC.mjs} +1 -1
  23. package/dist/{product-attributes-HQ2HQQSE.mjs → product-attributes-FNQQW6CA.mjs} +3 -3
  24. package/dist/{product-create-Q5ZIYMOR.mjs → product-create-GCG6XFQ4.mjs} +3 -3
  25. package/dist/{product-detail-YMCONFSY.mjs → product-detail-YQGIWWU4.mjs} +3 -3
  26. package/dist/{product-edit-SRWVIV2Z.mjs → product-edit-BDWF7CKD.mjs} +3 -3
  27. package/dist/{product-media-F74IPY26.mjs → product-media-XWTASBCL.mjs} +2 -2
  28. package/dist/{product-organization-PKNCLB6W.mjs → product-organization-U3LA5VZE.mjs} +3 -3
  29. package/dist/{product-shipping-profile-266AXOO6.mjs → product-shipping-profile-7V5PNI7H.mjs} +3 -3
  30. package/dist/{promotion-detail-X5XWYLTC.mjs → promotion-detail-EDLXBH4V.mjs} +2 -2
  31. package/dist/{promotion-list-R7J2AWA3.mjs → promotion-list-QT6HW6VF.mjs} +3 -3
  32. package/dist/{reset-password-OIRVPF4I.mjs → reset-password-O3M4BVYH.mjs} +1 -1
  33. package/dist/{tax-region-create-VO65RBTI.mjs → tax-region-create-MXQGPOV2.mjs} +1 -1
  34. package/package.json +9 -9
  35. package/src/i18n/translations/$schema.json +5 -1
  36. package/src/i18n/translations/en.json +2 -1
  37. package/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx +238 -177
  38. package/src/routes/orders/order-detail/constants.ts +7 -0
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  usePromotionTableColumns,
3
3
  usePromotionTableQuery
4
- } from "./chunk-WLTKZNOI.mjs";
5
- import "./chunk-G4ARHIQV.mjs";
4
+ } from "./chunk-YTDRSPOL.mjs";
5
+ import "./chunk-FLUC3I3N.mjs";
6
6
  import "./chunk-MSDRGCRR.mjs";
7
7
  import "./chunk-ADOCJB6L.mjs";
8
8
  import "./chunk-LQTHYS2Z.mjs";
@@ -30,7 +30,7 @@ import {
30
30
  useRouteModal
31
31
  } from "./chunk-4TC5YS65.mjs";
32
32
  import "./chunk-4GQOUCX6.mjs";
33
- import "./chunk-XDYQGXJ3.mjs";
33
+ import "./chunk-OQXWDAEB.mjs";
34
34
  import "./chunk-LPEUYMRK.mjs";
35
35
  import "./chunk-OC7BQLYI.mjs";
36
36
  import "./chunk-67ORSRVT.mjs";
package/dist/app.css CHANGED
@@ -2283,9 +2283,6 @@ video {
2283
2283
  .grid-cols-\[15px_1fr\] {
2284
2284
  grid-template-columns: 15px 1fr;
2285
2285
  }
2286
- .grid-cols-\[1fr_1fr_1fr\] {
2287
- grid-template-columns: 1fr 1fr 1fr;
2288
- }
2289
2286
  .grid-cols-\[1fr_1fr_1fr_20px\] {
2290
2287
  grid-template-columns: 1fr 1fr 1fr 20px;
2291
2288
  }
@@ -4865,9 +4862,6 @@ video {
4865
4862
  .sm\:max-w-\[560px\] {
4866
4863
  max-width: 560px;
4867
4864
  }
4868
- .sm\:grid-cols-\[1fr_1fr_1fr\] {
4869
- grid-template-columns: 1fr 1fr 1fr;
4870
- }
4871
4865
  .sm\:grid-cols-\[1fr_1fr_1fr_1fr_20px\] {
4872
4866
  grid-template-columns: 1fr 1fr 1fr 1fr 20px;
4873
4867
  }
package/dist/app.js CHANGED
@@ -9867,7 +9867,8 @@ var init_en = __esm({
9867
9867
  itemSubtotal: "Item Subtotal",
9868
9868
  shippingSubtotal: "Shipping Subtotal",
9869
9869
  discountSubtotal: "Discount Subtotal",
9870
- taxTotal: "Tax Total"
9870
+ taxTotal: "Tax Total",
9871
+ totalAfterDiscount: "Total After Discount"
9871
9872
  },
9872
9873
  transfer: {
9873
9874
  title: "Transfer ownership",
@@ -120111,14 +120112,21 @@ var init_constants8 = __esm({
120111
120112
  // --- TOTALS ---
120112
120113
  "total",
120113
120114
  "credit_line_total",
120115
+ "item_subtotal",
120114
120116
  "item_total",
120117
+ "item_tax_total",
120118
+ "original_item_tax_total",
120119
+ "item_discount_total",
120115
120120
  "shipping_subtotal",
120116
120121
  "original_total",
120122
+ "original_tax_total",
120117
120123
  "subtotal",
120118
120124
  "discount_total",
120119
120125
  "discount_subtotal",
120120
120126
  "shipping_total",
120121
120127
  "shipping_tax_total",
120128
+ "original_shipping_tax_total",
120129
+ "shipping_discount_total",
120122
120130
  "tax_total",
120123
120131
  "refundable_total",
120124
120132
  "order_change"
@@ -124045,7 +124053,7 @@ var init_shipping_info_popover = __esm({
124045
124053
  });
124046
124054
 
124047
124055
  // src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx
124048
- var import_react140, import_react_i18next152, import_react_router_dom74, import_icons75, import_ui156, import_date_fns6, import_jsx_runtime222, OrderSummarySection, Header10, Item3, ItemBreakdown, Cost, CostBreakdown, CreditLinesBreakdown, InventoryKitBreakdown, ReturnBreakdownWithDamages, ReturnBreakdown, ClaimBreakdown, ExchangeBreakdown, Total2;
124056
+ var import_react140, import_react_i18next152, import_react_router_dom74, import_icons75, import_ui156, import_date_fns6, import_jsx_runtime222, OrderSummarySection, Header10, Item3, ItemBreakdown, Cost, CostBreakdown, DiscountAndTotalBreakdown, InventoryKitBreakdown, ReturnBreakdownWithDamages, ReturnBreakdown, ClaimBreakdown, ExchangeBreakdown, Total2;
124049
124057
  var init_order_summary_section = __esm({
124050
124058
  "src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx"() {
124051
124059
  "use strict";
@@ -124171,7 +124179,7 @@ var init_order_summary_section = __esm({
124171
124179
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(Header10, { order, orderPreview }),
124172
124180
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(ItemBreakdown, { order, reservations }),
124173
124181
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(CostBreakdown, { order }),
124174
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(CreditLinesBreakdown, { order, plugins }),
124182
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(DiscountAndTotalBreakdown, { order, plugins }),
124175
124183
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(Total2, { order }),
124176
124184
  (showAllocateButton || showReturns || showPayment || showRefund) && /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
124177
124185
  showReturns && (receivableReturns.length === 1 ? /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Button, { asChild: true, variant: "secondary", size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
@@ -124411,40 +124419,29 @@ var init_order_summary_section = __esm({
124411
124419
  const { t: t5 } = (0, import_react_i18next152.useTranslation)();
124412
124420
  const [isTaxOpen, setIsTaxOpen] = (0, import_react140.useState)(false);
124413
124421
  const [isShippingOpen, setIsShippingOpen] = (0, import_react140.useState)(false);
124414
- const discountCodes = (0, import_react140.useMemo)(() => {
124415
- const codes = /* @__PURE__ */ new Set();
124416
- order.items.forEach(
124417
- (item) => item.adjustments?.forEach((adj) => {
124418
- codes.add(adj.code);
124419
- })
124420
- );
124421
- return Array.from(codes).sort();
124422
- }, [order]);
124423
- const taxCodes = (0, import_react140.useMemo)(() => {
124424
- const taxCodeMap = {};
124425
- order.items.forEach((item) => {
124426
- item.tax_lines?.forEach((line) => {
124427
- taxCodeMap[line.code] = (taxCodeMap[line.code] || 0) + line.total;
124422
+ const taxes = (0, import_react140.useMemo)(() => {
124423
+ const taxes2 = [];
124424
+ if (order.original_item_tax_total) {
124425
+ taxes2.push({
124426
+ type: "item",
124427
+ total: order.original_item_tax_total
124428
124428
  });
124429
- });
124430
- order.shipping_methods.forEach((sm) => {
124431
- sm.tax_lines?.forEach((line) => {
124432
- taxCodeMap[line.code] = (taxCodeMap[line.code] || 0) + line.total;
124429
+ }
124430
+ if (order.original_shipping_tax_total) {
124431
+ taxes2.push({
124432
+ type: "shipping",
124433
+ total: order.original_shipping_tax_total
124433
124434
  });
124434
- });
124435
- return taxCodeMap;
124435
+ }
124436
+ return taxes2;
124436
124437
  }, [order]);
124437
- const automaticTaxesOn = !!order.region?.automatic_taxes;
124438
- const hasTaxLines = !!Object.keys(taxCodes).length;
124439
- const discountTotal = automaticTaxesOn ? order.discount_total : order.discount_subtotal;
124438
+ const hasTaxes = !!Object.keys(taxes).length;
124440
124439
  return /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "text-ui-fg-subtle flex flex-col gap-y-2 px-6 py-4", children: [
124441
124440
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
124442
124441
  Cost,
124443
124442
  {
124444
- label: t5(
124445
- automaticTaxesOn ? "orders.summary.itemTotal" : "orders.summary.itemSubtotal"
124446
- ),
124447
- value: getLocaleAmount(order.item_total, order.currency_code)
124443
+ label: t5("orders.summary.itemSubtotal"),
124444
+ value: getLocaleAmount(order.item_subtotal, order.currency_code)
124448
124445
  }
124449
124446
  ),
124450
124447
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
@@ -124456,9 +124453,7 @@ var init_order_summary_section = __esm({
124456
124453
  onClick: () => setIsShippingOpen((o) => !o),
124457
124454
  className: "flex cursor-pointer items-center gap-1",
124458
124455
  children: [
124459
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { children: t5(
124460
- automaticTaxesOn ? "orders.summary.shippingTotal" : "orders.summary.shippingSubtotal"
124461
- ) }),
124456
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { children: t5("orders.summary.shippingSubtotal") }),
124462
124457
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
124463
124458
  import_icons75.TriangleDownMini,
124464
124459
  {
@@ -124470,10 +124465,7 @@ var init_order_summary_section = __esm({
124470
124465
  ]
124471
124466
  }
124472
124467
  ),
124473
- value: getLocaleAmount(
124474
- automaticTaxesOn ? order.shipping_total : order.shipping_subtotal,
124475
- order.currency_code
124476
- )
124468
+ value: getLocaleAmount(order.shipping_subtotal, order.currency_code)
124477
124469
  }
124478
124470
  ),
124479
124471
  isShippingOpen && /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "flex flex-col gap-1 pl-5", children: (order.shipping_methods || []).sort(
@@ -124491,39 +124483,24 @@ var init_order_summary_section = __esm({
124491
124483
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(shipping_info_popover_default, { shippingMethod: sm }, i)
124492
124484
  ] }) }),
124493
124485
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "relative flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
124494
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(
124495
- automaticTaxesOn ? sm.total : sm.subtotal,
124496
- order.currency_code
124497
- ) })
124486
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(sm.subtotal, order.currency_code) })
124498
124487
  ]
124499
124488
  },
124500
124489
  sm.id
124501
124490
  );
124502
124491
  }) }),
124503
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
124504
- Cost,
124505
- {
124506
- label: t5(
124507
- automaticTaxesOn ? "orders.summary.discountTotal" : "orders.summary.discountSubtotal"
124508
- ),
124509
- secondaryValue: discountCodes.join(", "),
124510
- value: discountTotal > 0 ? `- ${getLocaleAmount(discountTotal, order.currency_code)}` : "-"
124511
- }
124512
- ),
124513
124492
  /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(import_jsx_runtime222.Fragment, { children: [
124514
124493
  /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "flex justify-between", children: [
124515
124494
  /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(
124516
124495
  "div",
124517
124496
  {
124518
- onClick: () => hasTaxLines && setIsTaxOpen((o) => !o),
124497
+ onClick: () => hasTaxes && setIsTaxOpen((o) => !o),
124519
124498
  className: (0, import_ui156.clx)("flex items-center gap-1", {
124520
- "cursor-pointer": hasTaxLines
124499
+ "cursor-pointer": hasTaxes
124521
124500
  }),
124522
124501
  children: [
124523
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { className: "txt-small select-none", children: t5(
124524
- automaticTaxesOn ? "orders.summary.taxTotalIncl" : "orders.summary.taxTotal"
124525
- ) }),
124526
- hasTaxLines && /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
124502
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { className: "txt-small select-none", children: t5("orders.summary.taxTotal") }),
124503
+ hasTaxes && /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
124527
124504
  import_icons75.TriangleDownMini,
124528
124505
  {
124529
124506
  style: {
@@ -124534,98 +124511,216 @@ var init_order_summary_section = __esm({
124534
124511
  ]
124535
124512
  }
124536
124513
  ),
124537
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "text-right", children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { size: "small", leading: "compact", children: getLocaleAmount(order.tax_total, order.currency_code) }) })
124514
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "text-right", children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { size: "small", leading: "compact", children: getLocaleAmount(order.original_tax_total, order.currency_code) }) })
124538
124515
  ] }),
124539
- isTaxOpen && /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "flex flex-col gap-1 pl-5", children: Object.entries(taxCodes).map(([code, total]) => {
124516
+ isTaxOpen && /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "flex flex-col gap-1 pl-5", children: taxes.map(({ type, total }) => {
124540
124517
  return /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(
124541
124518
  "div",
124542
124519
  {
124543
124520
  className: "flex items-center justify-between gap-x-2",
124544
124521
  children: [
124545
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { className: "txt-small text-ui-fg-subtle font-medium", children: code }) }),
124522
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { className: "txt-small text-ui-fg-subtle font-medium", children: t5(`fields.${type}`) }) }),
124546
124523
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "relative flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
124547
124524
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(total, order.currency_code) })
124548
124525
  ]
124549
124526
  },
124550
- code
124527
+ type
124551
124528
  );
124552
124529
  }) })
124530
+ ] }),
124531
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
124532
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: t5("fields.total") }),
124533
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: getStylizedAmount(order.original_total, order.currency_code) })
124553
124534
  ] })
124554
124535
  ] });
124555
124536
  };
124556
- CreditLinesBreakdown = ({
124537
+ DiscountAndTotalBreakdown = ({
124557
124538
  order,
124558
124539
  plugins
124559
124540
  }) => {
124560
124541
  const { t: t5 } = (0, import_react_i18next152.useTranslation)();
124542
+ const [isDiscountOpen, setIsDiscountOpen] = (0, import_react140.useState)(false);
124561
124543
  const [isCreditLinesOpen, setIsCreditLinesOpen] = (0, import_react140.useState)(false);
124562
124544
  const creditLines = order.credit_lines ?? [];
124563
124545
  const loyaltyPlugin = getLoyaltyPlugin(plugins);
124564
- if (creditLines.length === 0) {
124565
- return null;
124566
- }
124567
- return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "text-ui-fg-subtle flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(import_jsx_runtime222.Fragment, { children: [
124568
- /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(
124569
- "div",
124546
+ const discounts = (0, import_react140.useMemo)(() => {
124547
+ const discounts2 = [];
124548
+ if (order.item_discount_total) {
124549
+ discounts2.push({
124550
+ type: "item",
124551
+ total: order.item_discount_total,
124552
+ codes: Array.from(
124553
+ new Set(
124554
+ order.items.flatMap((item) => item.adjustments || []).map((adjustment) => adjustment.code)
124555
+ )
124556
+ ).sort()
124557
+ });
124558
+ }
124559
+ if (order.shipping_discount_total) {
124560
+ discounts2.push({
124561
+ type: "shipping",
124562
+ total: order.shipping_discount_total,
124563
+ codes: Array.from(
124564
+ new Set(
124565
+ order.shipping_methods.flatMap((shippingMethod) => shippingMethod.adjustments || []).map((adjustment) => adjustment.code)
124566
+ )
124567
+ ).sort()
124568
+ });
124569
+ }
124570
+ return discounts2;
124571
+ }, [order]);
124572
+ const hasDiscount = discounts.length > 0;
124573
+ const hasCreditLines = creditLines.length > 0;
124574
+ return /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "text-ui-fg-subtle flex flex-col gap-y-2 px-6 py-4", children: [
124575
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
124576
+ Cost,
124570
124577
  {
124571
- onClick: () => setIsCreditLinesOpen((o) => !o),
124572
- className: "bg-ui-bg-component flex cursor-pointer items-center justify-between border border-dashed px-6 py-4",
124573
- children: [
124574
- /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "flex items-center gap-2", children: [
124575
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
124576
- import_icons75.TriangleDownMini,
124577
- {
124578
- style: {
124579
- transform: `rotate(${isCreditLinesOpen ? 0 : -90}deg)`
124578
+ label: /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(
124579
+ "div",
124580
+ {
124581
+ onClick: () => hasDiscount && setIsDiscountOpen((o) => !o),
124582
+ className: (0, import_ui156.clx)("flex items-center gap-1", {
124583
+ "cursor-pointer": hasDiscount
124584
+ }),
124585
+ children: [
124586
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { children: t5("orders.summary.discountTotal") }),
124587
+ hasDiscount && /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
124588
+ import_icons75.TriangleDownMini,
124589
+ {
124590
+ style: {
124591
+ transform: `rotate(${isDiscountOpen ? 0 : -90}deg)`
124592
+ }
124580
124593
  }
124581
- }
124582
- ),
124583
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { className: "text-ui-fg-muted txt-small select-none", children: loyaltyPlugin ? t5("orders.giftCardsStoreCreditLines") : t5("orders.creditLines.title") })
124584
- ] }),
124585
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { size: "small", leading: "compact", children: getLocaleAmount(order.credit_line_total, order.currency_code) }) })
124586
- ]
124594
+ )
124595
+ ]
124596
+ }
124597
+ ),
124598
+ value: getLocaleAmount(order.discount_total, order.currency_code)
124587
124599
  }
124588
124600
  ),
124589
- isCreditLinesOpen && /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "flex flex-col", children: creditLines.map((creditLine) => {
124590
- const prettyReference = creditLine.reference?.split("_").join(" ").split("-").join(" ");
124591
- const prettyReferenceId = creditLine.reference_id ? /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(display_id_default, { id: creditLine.reference_id }) : null;
124601
+ isDiscountOpen && /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "flex flex-col gap-1 pl-5", children: discounts.map(({ type, total, codes }) => {
124592
124602
  return /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(
124593
124603
  "div",
124594
124604
  {
124595
- className: "text-ui-fg-subtle grid grid-cols-[1fr_1fr_1fr] items-center px-6 py-4 py-4 sm:grid-cols-[1fr_1fr_1fr]",
124605
+ className: "flex items-center justify-between gap-x-2",
124596
124606
  children: [
124597
- /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "w-full min-w-[60px] overflow-hidden", children: [
124598
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
124599
- import_ui156.Text,
124600
- {
124601
- size: "small",
124602
- leading: "compact",
124603
- weight: "plus",
124604
- className: "truncate",
124605
- children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(display_id_default, { id: creditLine.id })
124606
- }
124607
- ),
124608
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { size: "small", leading: "compact", children: (0, import_date_fns6.format)(
124609
- new Date(creditLine.created_at),
124610
- "dd MMM, yyyy, HH:mm:ss"
124611
- ) })
124607
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "flex gap-1", children: [
124608
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { className: "txt-small text-ui-fg-subtle font-medium", children: t5(`fields.${type}`) }),
124609
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("span", { className: "txt-small text-ui-fg-subtle font-medium", children: [
124610
+ "(",
124611
+ codes.join(", "),
124612
+ ")"
124613
+ ] })
124612
124614
  ] }),
124613
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "hidden items-center justify-end gap-x-2 sm:flex", children: /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(import_ui156.Text, { size: "small", leading: "compact", className: "capitalize", children: [
124614
- prettyReference,
124615
- " (",
124616
- prettyReferenceId,
124617
- ")"
124618
- ] }) }),
124619
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { size: "small", leading: "compact", children: getLocaleAmount(
124620
- creditLine.amount,
124621
- order.currency_code
124622
- ) }) })
124615
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "relative flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
124616
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(total, order.currency_code) })
124623
124617
  ]
124624
124618
  },
124625
- creditLine.id
124619
+ type
124626
124620
  );
124627
- }) })
124628
- ] }) });
124621
+ }) }),
124622
+ hasCreditLines && /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(import_jsx_runtime222.Fragment, { children: [
124623
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
124624
+ Cost,
124625
+ {
124626
+ label: /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(
124627
+ "div",
124628
+ {
124629
+ onClick: () => setIsCreditLinesOpen((o) => !o),
124630
+ className: "flex cursor-pointer items-center gap-1",
124631
+ children: [
124632
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { children: loyaltyPlugin ? t5("orders.giftCardsStoreCreditLines") : t5("orders.creditLines.title") }),
124633
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
124634
+ import_icons75.TriangleDownMini,
124635
+ {
124636
+ style: {
124637
+ transform: `rotate(${isCreditLinesOpen ? 0 : -90}deg)`
124638
+ }
124639
+ }
124640
+ )
124641
+ ]
124642
+ }
124643
+ ),
124644
+ value: getLocaleAmount(
124645
+ order.credit_line_total,
124646
+ order.currency_code
124647
+ )
124648
+ }
124649
+ ),
124650
+ isCreditLinesOpen && /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "flex flex-col gap-1 pl-5", children: creditLines.map((creditLine) => {
124651
+ const prettyReference = creditLine.reference?.split("_").join(" ").split("-").join(" ");
124652
+ const prettyReferenceId = creditLine.reference_id ? /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(display_id_default, { id: creditLine.reference_id }) : null;
124653
+ return /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(
124654
+ "div",
124655
+ {
124656
+ className: "flex items-center justify-between gap-x-2",
124657
+ children: [
124658
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "flex items-center", children: [
124659
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
124660
+ import_ui156.Text,
124661
+ {
124662
+ size: "small",
124663
+ leading: "compact",
124664
+ weight: "plus",
124665
+ className: "txt-small text-ui-fg-subtle font-medium",
124666
+ children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(display_id_default, { id: creditLine.id })
124667
+ }
124668
+ ),
124669
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { className: "txt-small text-ui-fg-subtle mx-1", children: "-" }),
124670
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
124671
+ import_ui156.Tooltip,
124672
+ {
124673
+ content: (0, import_date_fns6.format)(
124674
+ new Date(creditLine.created_at),
124675
+ "dd MMM, yyyy, HH:mm:ss"
124676
+ ),
124677
+ children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(
124678
+ import_ui156.Text,
124679
+ {
124680
+ size: "small",
124681
+ leading: "compact",
124682
+ className: "txt-small text-ui-fg-subtle",
124683
+ children: (0, import_date_fns6.format)(
124684
+ new Date(creditLine.created_at),
124685
+ "dd MMM, yyyy"
124686
+ )
124687
+ }
124688
+ )
124689
+ }
124690
+ ),
124691
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { className: "txt-small text-ui-fg-subtle mx-1", children: "-" }),
124692
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)(
124693
+ import_ui156.Text,
124694
+ {
124695
+ size: "small",
124696
+ leading: "compact",
124697
+ className: "txt-small text-ui-fg-subtle capitalize",
124698
+ children: [
124699
+ "(",
124700
+ prettyReference,
124701
+ " ",
124702
+ prettyReferenceId,
124703
+ ")"
124704
+ ]
124705
+ }
124706
+ )
124707
+ ] }),
124708
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "relative flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
124709
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(
124710
+ creditLine.amount,
124711
+ order.currency_code
124712
+ ) })
124713
+ ]
124714
+ },
124715
+ creditLine.id
124716
+ );
124717
+ }) })
124718
+ ] }),
124719
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
124720
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: t5("orders.summary.totalAfterDiscount") }),
124721
+ /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: getStylizedAmount(order.total, order.currency_code) })
124722
+ ] })
124723
+ ] });
124629
124724
  };
124630
124725
  InventoryKitBreakdown = ({ item }) => {
124631
124726
  const { t: t5 } = (0, import_react_i18next152.useTranslation)();
@@ -124834,10 +124929,6 @@ var init_order_summary_section = __esm({
124834
124929
  Total2 = ({ order }) => {
124835
124930
  const { t: t5 } = (0, import_react_i18next152.useTranslation)();
124836
124931
  return /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: " flex flex-col gap-y-2 px-6 py-4", children: [
124837
- /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
124838
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: t5("fields.total") }),
124839
- /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: getStylizedAmount(order.original_total, order.currency_code) })
124840
- ] }),
124841
124932
  /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
124842
124933
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: t5("fields.paidTotal") }),
124843
124934
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: getStylizedAmount(
@@ -124845,7 +124936,7 @@ var init_order_summary_section = __esm({
124845
124936
  order.currency_code
124846
124937
  ) })
124847
124938
  ] }),
124848
- /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
124939
+ getTotalCreditLines(order.credit_lines ?? []) > 0 && /* @__PURE__ */ (0, import_jsx_runtime222.jsxs)("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
124849
124940
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: t5("fields.creditTotal") }),
124850
124941
  /* @__PURE__ */ (0, import_jsx_runtime222.jsx)(import_ui156.Text, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: getStylizedAmount(
124851
124942
  getTotalCreditLines(order.credit_lines ?? []),
package/dist/app.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  DashboardApp
3
- } from "./chunk-SJFXY376.mjs";
3
+ } from "./chunk-MFN6KGYE.mjs";
4
4
  import "./chunk-NQIC7ZFS.mjs";
5
5
  import "./chunk-ONB3JEHR.mjs";
6
6
  import "./chunk-4GQOUCX6.mjs";
@@ -8,7 +8,7 @@ import "./chunk-2VTICXJR.mjs";
8
8
  import "./chunk-RM6NY572.mjs";
9
9
  import "./chunk-D3YQN7HV.mjs";
10
10
  import "./chunk-DG7J63J2.mjs";
11
- import "./chunk-XDYQGXJ3.mjs";
11
+ import "./chunk-OQXWDAEB.mjs";
12
12
  import "./chunk-MNXC6Q4F.mjs";
13
13
  import "./chunk-C5P5PL3E.mjs";
14
14
  import "./chunk-LPEUYMRK.mjs";
@@ -4,8 +4,8 @@ import {
4
4
  import {
5
5
  usePromotionTableColumns,
6
6
  usePromotionTableQuery
7
- } from "./chunk-WLTKZNOI.mjs";
8
- import "./chunk-G4ARHIQV.mjs";
7
+ } from "./chunk-YTDRSPOL.mjs";
8
+ import "./chunk-FLUC3I3N.mjs";
9
9
  import "./chunk-MSDRGCRR.mjs";
10
10
  import "./chunk-ADOCJB6L.mjs";
11
11
  import "./chunk-LQTHYS2Z.mjs";
@@ -31,7 +31,7 @@ import {
31
31
  import "./chunk-C76H5USB.mjs";
32
32
  import "./chunk-PFKKVLZX.mjs";
33
33
  import "./chunk-4GQOUCX6.mjs";
34
- import "./chunk-XDYQGXJ3.mjs";
34
+ import "./chunk-OQXWDAEB.mjs";
35
35
  import {
36
36
  useExtension
37
37
  } from "./chunk-C5P5PL3E.mjs";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-6GU6IDUA.mjs";
11
11
  import {
12
12
  i18n
13
- } from "./chunk-XDYQGXJ3.mjs";
13
+ } from "./chunk-OQXWDAEB.mjs";
14
14
  import {
15
15
  Form
16
16
  } from "./chunk-OBQI23QM.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getLinkedFields
3
- } from "./chunk-SJFXY376.mjs";
3
+ } from "./chunk-MFN6KGYE.mjs";
4
4
 
5
5
  // src/routes/products/product-detail/constants.ts
6
6
  var PRODUCT_DETAIL_FIELDS = getLinkedFields(
@@ -11,14 +11,21 @@ var DEFAULT_PROPERTIES = [
11
11
  // --- TOTALS ---
12
12
  "total",
13
13
  "credit_line_total",
14
+ "item_subtotal",
14
15
  "item_total",
16
+ "item_tax_total",
17
+ "original_item_tax_total",
18
+ "item_discount_total",
15
19
  "shipping_subtotal",
16
20
  "original_total",
21
+ "original_tax_total",
17
22
  "subtotal",
18
23
  "discount_total",
19
24
  "discount_subtotal",
20
25
  "shipping_total",
21
26
  "shipping_tax_total",
27
+ "original_shipping_tax_total",
28
+ "shipping_discount_total",
22
29
  "tax_total",
23
30
  "refundable_total",
24
31
  "order_change"
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  i18n
3
- } from "./chunk-XDYQGXJ3.mjs";
3
+ } from "./chunk-OQXWDAEB.mjs";
4
4
 
5
5
  // src/lib/promotions.ts
6
6
  var promotionStatusMap = {