@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.
- package/dist/{add-campaign-promotions-UQVBTTWK.mjs → add-campaign-promotions-U277KTL4.mjs} +3 -3
- package/dist/app.css +0 -6
- package/dist/app.js +211 -120
- package/dist/app.mjs +2 -2
- package/dist/{campaign-detail-FIO6336E.mjs → campaign-detail-6454LL3C.mjs} +3 -3
- package/dist/{chunk-H3JGGHAQ.mjs → chunk-6OHAQHB4.mjs} +1 -1
- package/dist/{chunk-RQYKGJZ4.mjs → chunk-BZIE4MY6.mjs} +1 -1
- package/dist/{chunk-D4T3GFML.mjs → chunk-F7LJJHQT.mjs} +7 -0
- package/dist/{chunk-G4ARHIQV.mjs → chunk-FLUC3I3N.mjs} +1 -1
- package/dist/{chunk-SJFXY376.mjs → chunk-MFN6KGYE.mjs} +26 -26
- package/dist/{chunk-XDYQGXJ3.mjs → chunk-OQXWDAEB.mjs} +2 -1
- package/dist/{chunk-WLTKZNOI.mjs → chunk-YTDRSPOL.mjs} +1 -1
- package/dist/{order-create-claim-DBL2BU5Q.mjs → order-create-claim-ATLKY2SH.mjs} +1 -1
- package/dist/{order-create-edit-INKNOFBY.mjs → order-create-edit-5LOTLPD6.mjs} +1 -1
- package/dist/{order-create-exchange-6E2VLPU3.mjs → order-create-exchange-TOELYZPA.mjs} +1 -1
- package/dist/{order-create-refund-HJMKDY6S.mjs → order-create-refund-ZZNAUXIA.mjs} +1 -1
- package/dist/{order-create-return-IIEBZOZZ.mjs → order-create-return-2HT4V6UE.mjs} +1 -1
- package/dist/{order-detail-BDX6VUSZ.mjs → order-detail-M27ZGXL3.mjs} +202 -119
- package/dist/{order-edit-billing-address-K2SUQK3S.mjs → order-edit-billing-address-5HQFWKN2.mjs} +1 -1
- package/dist/{order-edit-email-FSHV32T6.mjs → order-edit-email-2W33H5CV.mjs} +1 -1
- package/dist/{order-edit-shipping-address-RV2QZCR5.mjs → order-edit-shipping-address-VE2BJEHO.mjs} +1 -1
- package/dist/{order-request-transfer-NJ24WZ26.mjs → order-request-transfer-U52O2EVC.mjs} +1 -1
- package/dist/{product-attributes-HQ2HQQSE.mjs → product-attributes-FNQQW6CA.mjs} +3 -3
- package/dist/{product-create-Q5ZIYMOR.mjs → product-create-GCG6XFQ4.mjs} +3 -3
- package/dist/{product-detail-YMCONFSY.mjs → product-detail-YQGIWWU4.mjs} +3 -3
- package/dist/{product-edit-SRWVIV2Z.mjs → product-edit-BDWF7CKD.mjs} +3 -3
- package/dist/{product-media-F74IPY26.mjs → product-media-XWTASBCL.mjs} +2 -2
- package/dist/{product-organization-PKNCLB6W.mjs → product-organization-U3LA5VZE.mjs} +3 -3
- package/dist/{product-shipping-profile-266AXOO6.mjs → product-shipping-profile-7V5PNI7H.mjs} +3 -3
- package/dist/{promotion-detail-X5XWYLTC.mjs → promotion-detail-EDLXBH4V.mjs} +2 -2
- package/dist/{promotion-list-R7J2AWA3.mjs → promotion-list-QT6HW6VF.mjs} +3 -3
- package/dist/{reset-password-OIRVPF4I.mjs → reset-password-O3M4BVYH.mjs} +1 -1
- package/dist/{tax-region-create-VO65RBTI.mjs → tax-region-create-MXQGPOV2.mjs} +1 -1
- package/package.json +9 -9
- package/src/i18n/translations/$schema.json +5 -1
- package/src/i18n/translations/en.json +2 -1
- package/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx +238 -177
- 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-
|
5
|
-
import "./chunk-
|
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";
|
@@ -25,7 +25,7 @@ import {
|
|
25
25
|
import "./chunk-C76H5USB.mjs";
|
26
26
|
import "./chunk-PFKKVLZX.mjs";
|
27
27
|
import "./chunk-4GQOUCX6.mjs";
|
28
|
-
import "./chunk-
|
28
|
+
import "./chunk-OQXWDAEB.mjs";
|
29
29
|
import {
|
30
30
|
useExtension
|
31
31
|
} from "./chunk-C5P5PL3E.mjs";
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@medusajs/dashboard",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.11.0-snapshot-20250828185926",
|
4
4
|
"scripts": {
|
5
5
|
"generate:static": "node ./scripts/generate-currencies.js && prettier --write ./src/lib/currencies.ts",
|
6
6
|
"dev": "vite",
|
@@ -45,10 +45,10 @@
|
|
45
45
|
"@dnd-kit/utilities": "^3.2.2",
|
46
46
|
"@hookform/error-message": "^2.0.1",
|
47
47
|
"@hookform/resolvers": "3.4.2",
|
48
|
-
"@medusajs/admin-shared": "2.
|
49
|
-
"@medusajs/icons": "2.
|
50
|
-
"@medusajs/js-sdk": "2.
|
51
|
-
"@medusajs/ui": "4.0.
|
48
|
+
"@medusajs/admin-shared": "2.11.0-snapshot-20250828185926",
|
49
|
+
"@medusajs/icons": "2.11.0-snapshot-20250828185926",
|
50
|
+
"@medusajs/js-sdk": "2.11.0-snapshot-20250828185926",
|
51
|
+
"@medusajs/ui": "4.0.21-snapshot-20250828185926",
|
52
52
|
"@tanstack/react-query": "5.64.2",
|
53
53
|
"@tanstack/react-table": "8.20.5",
|
54
54
|
"@tanstack/react-virtual": "^3.8.3",
|
@@ -76,10 +76,10 @@
|
|
76
76
|
"zod": "3.25.76"
|
77
77
|
},
|
78
78
|
"devDependencies": {
|
79
|
-
"@medusajs/admin-shared": "2.
|
80
|
-
"@medusajs/admin-vite-plugin": "2.
|
81
|
-
"@medusajs/types": "2.
|
82
|
-
"@medusajs/ui-preset": "2.
|
79
|
+
"@medusajs/admin-shared": "2.11.0-snapshot-20250828185926",
|
80
|
+
"@medusajs/admin-vite-plugin": "2.11.0-snapshot-20250828185926",
|
81
|
+
"@medusajs/types": "2.11.0-snapshot-20250828185926",
|
82
|
+
"@medusajs/ui-preset": "2.11.0-snapshot-20250828185926",
|
83
83
|
"@types/node": "^20.11.15",
|
84
84
|
"@types/react": "^18.2.79",
|
85
85
|
"@types/react-dom": "^18.2.25",
|
@@ -3987,6 +3987,9 @@
|
|
3987
3987
|
},
|
3988
3988
|
"taxTotal": {
|
3989
3989
|
"type": "string"
|
3990
|
+
},
|
3991
|
+
"totalAfterDiscount": {
|
3992
|
+
"type": "string"
|
3990
3993
|
}
|
3991
3994
|
},
|
3992
3995
|
"required": [
|
@@ -4002,7 +4005,8 @@
|
|
4002
4005
|
"itemSubtotal",
|
4003
4006
|
"shippingSubtotal",
|
4004
4007
|
"discountSubtotal",
|
4005
|
-
"taxTotal"
|
4008
|
+
"taxTotal",
|
4009
|
+
"totalAfterDiscount"
|
4006
4010
|
],
|
4007
4011
|
"additionalProperties": false
|
4008
4012
|
},
|
@@ -1067,7 +1067,8 @@
|
|
1067
1067
|
"itemSubtotal": "Item Subtotal",
|
1068
1068
|
"shippingSubtotal": "Shipping Subtotal",
|
1069
1069
|
"discountSubtotal": "Discount Subtotal",
|
1070
|
-
"taxTotal": "Tax Total"
|
1070
|
+
"taxTotal": "Tax Total",
|
1071
|
+
"totalAfterDiscount": "Total After Discount"
|
1071
1072
|
},
|
1072
1073
|
"transfer": {
|
1073
1074
|
"title": "Transfer ownership",
|
package/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx
CHANGED
@@ -191,7 +191,7 @@ export const OrderSummarySection = ({
|
|
191
191
|
<Header order={order} orderPreview={orderPreview} />
|
192
192
|
<ItemBreakdown order={order} reservations={reservations!} />
|
193
193
|
<CostBreakdown order={order} />
|
194
|
-
<
|
194
|
+
<DiscountAndTotalBreakdown order={order} plugins={plugins} />
|
195
195
|
<Total order={order} />
|
196
196
|
|
197
197
|
{(showAllocateButton || showReturns || showPayment || showRefund) && (
|
@@ -569,51 +569,30 @@ const CostBreakdown = ({
|
|
569
569
|
const [isTaxOpen, setIsTaxOpen] = useState(false)
|
570
570
|
const [isShippingOpen, setIsShippingOpen] = useState(false)
|
571
571
|
|
572
|
-
const
|
573
|
-
const
|
574
|
-
order.
|
575
|
-
|
576
|
-
|
572
|
+
const taxes = useMemo(() => {
|
573
|
+
const taxes: { type: "item" | "shipping"; total: number }[] = []
|
574
|
+
if (order.original_item_tax_total) {
|
575
|
+
taxes.push({
|
576
|
+
type: "item",
|
577
|
+
total: order.original_item_tax_total,
|
577
578
|
})
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
const taxCodes = useMemo(() => {
|
584
|
-
const taxCodeMap = {}
|
585
|
-
|
586
|
-
order.items.forEach((item) => {
|
587
|
-
item.tax_lines?.forEach((line) => {
|
588
|
-
taxCodeMap[line.code] = (taxCodeMap[line.code] || 0) + line.total
|
589
|
-
})
|
590
|
-
})
|
591
|
-
|
592
|
-
order.shipping_methods.forEach((sm) => {
|
593
|
-
sm.tax_lines?.forEach((line) => {
|
594
|
-
taxCodeMap[line.code] = (taxCodeMap[line.code] || 0) + line.total
|
579
|
+
}
|
580
|
+
if (order.original_shipping_tax_total) {
|
581
|
+
taxes.push({
|
582
|
+
type: "shipping",
|
583
|
+
total: order.original_shipping_tax_total,
|
595
584
|
})
|
596
|
-
}
|
597
|
-
|
598
|
-
return taxCodeMap
|
585
|
+
}
|
586
|
+
return taxes
|
599
587
|
}, [order])
|
600
588
|
|
601
|
-
const
|
602
|
-
const hasTaxLines = !!Object.keys(taxCodes).length
|
603
|
-
|
604
|
-
const discountTotal = automaticTaxesOn
|
605
|
-
? order.discount_total
|
606
|
-
: order.discount_subtotal
|
589
|
+
const hasTaxes = !!Object.keys(taxes).length
|
607
590
|
|
608
591
|
return (
|
609
592
|
<div className="text-ui-fg-subtle flex flex-col gap-y-2 px-6 py-4">
|
610
593
|
<Cost
|
611
|
-
label={t(
|
612
|
-
|
613
|
-
? "orders.summary.itemTotal"
|
614
|
-
: "orders.summary.itemSubtotal"
|
615
|
-
)}
|
616
|
-
value={getLocaleAmount(order.item_total, order.currency_code)}
|
594
|
+
label={t("orders.summary.itemSubtotal")}
|
595
|
+
value={getLocaleAmount(order.item_subtotal, order.currency_code)}
|
617
596
|
/>
|
618
597
|
<Cost
|
619
598
|
label={
|
@@ -621,13 +600,7 @@ const CostBreakdown = ({
|
|
621
600
|
onClick={() => setIsShippingOpen((o) => !o)}
|
622
601
|
className="flex cursor-pointer items-center gap-1"
|
623
602
|
>
|
624
|
-
<span>
|
625
|
-
{t(
|
626
|
-
automaticTaxesOn
|
627
|
-
? "orders.summary.shippingTotal"
|
628
|
-
: "orders.summary.shippingSubtotal"
|
629
|
-
)}
|
630
|
-
</span>
|
603
|
+
<span>{t("orders.summary.shippingSubtotal")}</span>
|
631
604
|
<TriangleDownMini
|
632
605
|
style={{
|
633
606
|
transform: `rotate(${isShippingOpen ? 0 : -90}deg)`,
|
@@ -635,10 +608,7 @@ const CostBreakdown = ({
|
|
635
608
|
/>
|
636
609
|
</div>
|
637
610
|
}
|
638
|
-
value={getLocaleAmount(
|
639
|
-
automaticTaxesOn ? order.shipping_total : order.shipping_subtotal,
|
640
|
-
order.currency_code
|
641
|
-
)}
|
611
|
+
value={getLocaleAmount(order.shipping_subtotal, order.currency_code)}
|
642
612
|
/>
|
643
613
|
|
644
614
|
{isShippingOpen && (
|
@@ -665,10 +635,7 @@ const CostBreakdown = ({
|
|
665
635
|
<div className="bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" />
|
666
636
|
</div>
|
667
637
|
<span className="txt-small text-ui-fg-muted">
|
668
|
-
{getLocaleAmount(
|
669
|
-
automaticTaxesOn ? sm.total : sm.subtotal,
|
670
|
-
order.currency_code
|
671
|
-
)}
|
638
|
+
{getLocaleAmount(sm.subtotal, order.currency_code)}
|
672
639
|
</span>
|
673
640
|
</div>
|
674
641
|
)
|
@@ -676,36 +643,18 @@ const CostBreakdown = ({
|
|
676
643
|
</div>
|
677
644
|
)}
|
678
645
|
|
679
|
-
<Cost
|
680
|
-
label={t(
|
681
|
-
automaticTaxesOn
|
682
|
-
? "orders.summary.discountTotal"
|
683
|
-
: "orders.summary.discountSubtotal"
|
684
|
-
)}
|
685
|
-
secondaryValue={discountCodes.join(", ")}
|
686
|
-
value={
|
687
|
-
discountTotal > 0
|
688
|
-
? `- ${getLocaleAmount(discountTotal, order.currency_code)}`
|
689
|
-
: "-"
|
690
|
-
}
|
691
|
-
/>
|
692
|
-
|
693
646
|
<>
|
694
647
|
<div className="flex justify-between">
|
695
648
|
<div
|
696
|
-
onClick={() =>
|
649
|
+
onClick={() => hasTaxes && setIsTaxOpen((o) => !o)}
|
697
650
|
className={clx("flex items-center gap-1", {
|
698
|
-
"cursor-pointer":
|
651
|
+
"cursor-pointer": hasTaxes,
|
699
652
|
})}
|
700
653
|
>
|
701
654
|
<span className="txt-small select-none">
|
702
|
-
{t(
|
703
|
-
automaticTaxesOn
|
704
|
-
? "orders.summary.taxTotalIncl"
|
705
|
-
: "orders.summary.taxTotal"
|
706
|
-
)}
|
655
|
+
{t("orders.summary.taxTotal")}
|
707
656
|
</span>
|
708
|
-
{
|
657
|
+
{hasTaxes && (
|
709
658
|
<TriangleDownMini
|
710
659
|
style={{
|
711
660
|
transform: `rotate(${isTaxOpen ? 0 : -90}deg)`,
|
@@ -716,21 +665,21 @@ const CostBreakdown = ({
|
|
716
665
|
|
717
666
|
<div className="text-right">
|
718
667
|
<Text size="small" leading="compact">
|
719
|
-
{getLocaleAmount(order.
|
668
|
+
{getLocaleAmount(order.original_tax_total, order.currency_code)}
|
720
669
|
</Text>
|
721
670
|
</div>
|
722
671
|
</div>
|
723
672
|
{isTaxOpen && (
|
724
673
|
<div className="flex flex-col gap-1 pl-5">
|
725
|
-
{
|
674
|
+
{taxes.map(({ type, total }) => {
|
726
675
|
return (
|
727
676
|
<div
|
728
|
-
key={
|
677
|
+
key={type}
|
729
678
|
className="flex items-center justify-between gap-x-2"
|
730
679
|
>
|
731
680
|
<div>
|
732
681
|
<span className="txt-small text-ui-fg-subtle font-medium">
|
733
|
-
{
|
682
|
+
{t(`fields.${type}`)}
|
734
683
|
</span>
|
735
684
|
</div>
|
736
685
|
<div className="relative flex-1">
|
@@ -745,11 +694,19 @@ const CostBreakdown = ({
|
|
745
694
|
</div>
|
746
695
|
)}
|
747
696
|
</>
|
697
|
+
<div className="text-ui-fg-base flex items-center justify-between">
|
698
|
+
<Text className="text-ui-fg-subtle" size="small" leading="compact">
|
699
|
+
{t("fields.total")}
|
700
|
+
</Text>
|
701
|
+
<Text className="text-ui-fg-subtle" size="small" leading="compact">
|
702
|
+
{getStylizedAmount(order.original_total, order.currency_code)}
|
703
|
+
</Text>
|
704
|
+
</div>
|
748
705
|
</div>
|
749
706
|
)
|
750
707
|
}
|
751
708
|
|
752
|
-
const
|
709
|
+
const DiscountAndTotalBreakdown = ({
|
753
710
|
order,
|
754
711
|
plugins,
|
755
712
|
}: {
|
@@ -757,97 +714,208 @@ const CreditLinesBreakdown = ({
|
|
757
714
|
plugins: AdminPlugin[]
|
758
715
|
}) => {
|
759
716
|
const { t } = useTranslation()
|
717
|
+
const [isDiscountOpen, setIsDiscountOpen] = useState(false)
|
760
718
|
const [isCreditLinesOpen, setIsCreditLinesOpen] = useState(false)
|
719
|
+
|
761
720
|
const creditLines = order.credit_lines ?? []
|
762
721
|
const loyaltyPlugin = getLoyaltyPlugin(plugins)
|
763
722
|
|
764
|
-
|
765
|
-
|
766
|
-
|
723
|
+
const discounts = useMemo(() => {
|
724
|
+
const discounts: {
|
725
|
+
type: "item" | "shipping"
|
726
|
+
total: number
|
727
|
+
codes: string[]
|
728
|
+
}[] = []
|
729
|
+
if (order.item_discount_total) {
|
730
|
+
discounts.push({
|
731
|
+
type: "item",
|
732
|
+
total: order.item_discount_total,
|
733
|
+
codes: Array.from(
|
734
|
+
new Set(
|
735
|
+
order.items
|
736
|
+
.flatMap((item) => item.adjustments || [])
|
737
|
+
.map((adjustment) => adjustment.code!)
|
738
|
+
)
|
739
|
+
).sort(),
|
740
|
+
})
|
741
|
+
}
|
742
|
+
if (order.shipping_discount_total) {
|
743
|
+
discounts.push({
|
744
|
+
type: "shipping",
|
745
|
+
total: order.shipping_discount_total,
|
746
|
+
codes: Array.from(
|
747
|
+
new Set(
|
748
|
+
order.shipping_methods
|
749
|
+
.flatMap((shippingMethod) => shippingMethod.adjustments || [])
|
750
|
+
.map((adjustment) => adjustment.code!)
|
751
|
+
)
|
752
|
+
).sort(),
|
753
|
+
})
|
754
|
+
}
|
755
|
+
return discounts
|
756
|
+
}, [order])
|
767
757
|
|
768
|
-
|
769
|
-
|
770
|
-
<>
|
771
|
-
<div
|
772
|
-
onClick={() => setIsCreditLinesOpen((o) => !o)}
|
773
|
-
className="bg-ui-bg-component flex cursor-pointer items-center justify-between border border-dashed px-6 py-4"
|
774
|
-
>
|
775
|
-
<div className="flex items-center gap-2">
|
776
|
-
<TriangleDownMini
|
777
|
-
style={{
|
778
|
-
transform: `rotate(${isCreditLinesOpen ? 0 : -90}deg)`,
|
779
|
-
}}
|
780
|
-
/>
|
781
|
-
<span className="text-ui-fg-muted txt-small select-none">
|
782
|
-
{loyaltyPlugin
|
783
|
-
? t("orders.giftCardsStoreCreditLines")
|
784
|
-
: t("orders.creditLines.title")}
|
785
|
-
</span>
|
786
|
-
</div>
|
758
|
+
const hasDiscount = discounts.length > 0
|
759
|
+
const hasCreditLines = creditLines.length > 0
|
787
760
|
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
761
|
+
return (
|
762
|
+
<div className="text-ui-fg-subtle flex flex-col gap-y-2 px-6 py-4">
|
763
|
+
<Cost
|
764
|
+
label={
|
765
|
+
<div
|
766
|
+
onClick={() => hasDiscount && setIsDiscountOpen((o) => !o)}
|
767
|
+
className={clx("flex items-center gap-1", {
|
768
|
+
"cursor-pointer": hasDiscount,
|
769
|
+
})}
|
770
|
+
>
|
771
|
+
<span>{t("orders.summary.discountTotal")}</span>
|
772
|
+
{hasDiscount && (
|
773
|
+
<TriangleDownMini
|
774
|
+
style={{
|
775
|
+
transform: `rotate(${isDiscountOpen ? 0 : -90}deg)`,
|
776
|
+
}}
|
777
|
+
/>
|
778
|
+
)}
|
792
779
|
</div>
|
780
|
+
}
|
781
|
+
value={getLocaleAmount(order.discount_total, order.currency_code)}
|
782
|
+
/>
|
783
|
+
{isDiscountOpen && (
|
784
|
+
<div className="flex flex-col gap-1 pl-5">
|
785
|
+
{discounts.map(({ type, total, codes }) => {
|
786
|
+
return (
|
787
|
+
<div
|
788
|
+
key={type}
|
789
|
+
className="flex items-center justify-between gap-x-2"
|
790
|
+
>
|
791
|
+
<div className="flex gap-1">
|
792
|
+
<span className="txt-small text-ui-fg-subtle font-medium">
|
793
|
+
{t(`fields.${type}`)}
|
794
|
+
</span>
|
795
|
+
<span className="txt-small text-ui-fg-subtle font-medium">
|
796
|
+
({codes.join(", ")})
|
797
|
+
</span>
|
798
|
+
</div>
|
799
|
+
<div className="relative flex-1">
|
800
|
+
<div className="bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" />
|
801
|
+
</div>
|
802
|
+
<span className="txt-small text-ui-fg-muted">
|
803
|
+
{getLocaleAmount(total, order.currency_code)}
|
804
|
+
</span>
|
805
|
+
</div>
|
806
|
+
)
|
807
|
+
})}
|
793
808
|
</div>
|
809
|
+
)}
|
794
810
|
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
<
|
811
|
+
{hasCreditLines && (
|
812
|
+
<>
|
813
|
+
<Cost
|
814
|
+
label={
|
815
|
+
<div
|
816
|
+
onClick={() => setIsCreditLinesOpen((o) => !o)}
|
817
|
+
className="flex cursor-pointer items-center gap-1"
|
818
|
+
>
|
819
|
+
<span>
|
820
|
+
{loyaltyPlugin
|
821
|
+
? t("orders.giftCardsStoreCreditLines")
|
822
|
+
: t("orders.creditLines.title")}
|
823
|
+
</span>
|
824
|
+
<TriangleDownMini
|
825
|
+
style={{
|
826
|
+
transform: `rotate(${isCreditLinesOpen ? 0 : -90}deg)`,
|
827
|
+
}}
|
828
|
+
/>
|
829
|
+
</div>
|
830
|
+
}
|
831
|
+
value={getLocaleAmount(
|
832
|
+
order.credit_line_total,
|
833
|
+
order.currency_code
|
834
|
+
)}
|
835
|
+
/>
|
836
|
+
{isCreditLinesOpen && (
|
837
|
+
<div className="flex flex-col gap-1 pl-5">
|
838
|
+
{creditLines.map((creditLine) => {
|
839
|
+
const prettyReference = creditLine.reference
|
840
|
+
?.split("_")
|
841
|
+
.join(" ")
|
842
|
+
.split("-")
|
843
|
+
.join(" ")
|
844
|
+
|
845
|
+
const prettyReferenceId = creditLine.reference_id ? (
|
846
|
+
<DisplayId id={creditLine.reference_id} />
|
847
|
+
) : null
|
848
|
+
|
849
|
+
return (
|
850
|
+
<div
|
851
|
+
key={creditLine.id}
|
852
|
+
className="flex items-center justify-between gap-x-2"
|
853
|
+
>
|
854
|
+
<div className="flex items-center">
|
855
|
+
<Text
|
856
|
+
size="small"
|
857
|
+
leading="compact"
|
858
|
+
weight="plus"
|
859
|
+
className="txt-small text-ui-fg-subtle font-medium"
|
860
|
+
>
|
861
|
+
<DisplayId id={creditLine.id} />
|
862
|
+
</Text>
|
863
|
+
<span className="txt-small text-ui-fg-subtle mx-1">
|
864
|
+
-
|
865
|
+
</span>
|
866
|
+
<Tooltip
|
867
|
+
content={format(
|
868
|
+
new Date(creditLine.created_at),
|
869
|
+
"dd MMM, yyyy, HH:mm:ss"
|
870
|
+
)}
|
871
|
+
>
|
872
|
+
<Text
|
873
|
+
size="small"
|
874
|
+
leading="compact"
|
875
|
+
className="txt-small text-ui-fg-subtle"
|
876
|
+
>
|
877
|
+
{format(
|
878
|
+
new Date(creditLine.created_at),
|
879
|
+
"dd MMM, yyyy"
|
880
|
+
)}
|
881
|
+
</Text>
|
882
|
+
</Tooltip>
|
883
|
+
<span className="txt-small text-ui-fg-subtle mx-1">
|
884
|
+
-
|
885
|
+
</span>
|
886
|
+
<Text
|
887
|
+
size="small"
|
888
|
+
leading="compact"
|
889
|
+
className="txt-small text-ui-fg-subtle capitalize"
|
890
|
+
>
|
891
|
+
({prettyReference} {prettyReferenceId})
|
892
|
+
</Text>
|
893
|
+
</div>
|
894
|
+
<div className="relative flex-1">
|
895
|
+
<div className="bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" />
|
896
|
+
</div>
|
897
|
+
<span className="txt-small text-ui-fg-muted">
|
839
898
|
{getLocaleAmount(
|
840
899
|
creditLine.amount as number,
|
841
900
|
order.currency_code
|
842
901
|
)}
|
843
|
-
</
|
902
|
+
</span>
|
844
903
|
</div>
|
845
|
-
|
846
|
-
)
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
904
|
+
)
|
905
|
+
})}
|
906
|
+
</div>
|
907
|
+
)}
|
908
|
+
</>
|
909
|
+
)}
|
910
|
+
|
911
|
+
<div className="text-ui-fg-base flex items-center justify-between">
|
912
|
+
<Text className="text-ui-fg-subtle" size="small" leading="compact">
|
913
|
+
{t("orders.summary.totalAfterDiscount")}
|
914
|
+
</Text>
|
915
|
+
<Text className="text-ui-fg-subtle" size="small" leading="compact">
|
916
|
+
{getStylizedAmount(order.total, order.currency_code)}
|
917
|
+
</Text>
|
918
|
+
</div>
|
851
919
|
</div>
|
852
920
|
)
|
853
921
|
}
|
@@ -1138,15 +1206,6 @@ const Total = ({ order }: { order: AdminOrder }) => {
|
|
1138
1206
|
|
1139
1207
|
return (
|
1140
1208
|
<div className=" flex flex-col gap-y-2 px-6 py-4">
|
1141
|
-
<div className="text-ui-fg-base flex items-center justify-between">
|
1142
|
-
<Text className="text-ui-fg-subtle" size="small" leading="compact">
|
1143
|
-
{t("fields.total")}
|
1144
|
-
</Text>
|
1145
|
-
<Text className="text-ui-fg-subtle" size="small" leading="compact">
|
1146
|
-
{getStylizedAmount(order.original_total, order.currency_code)}
|
1147
|
-
</Text>
|
1148
|
-
</div>
|
1149
|
-
|
1150
1209
|
<div className="text-ui-fg-base flex items-center justify-between">
|
1151
1210
|
<Text className="text-ui-fg-subtle" size="small" leading="compact">
|
1152
1211
|
{t("fields.paidTotal")}
|
@@ -1159,18 +1218,20 @@ const Total = ({ order }: { order: AdminOrder }) => {
|
|
1159
1218
|
</Text>
|
1160
1219
|
</div>
|
1161
1220
|
|
1162
|
-
|
1163
|
-
<
|
1164
|
-
|
1165
|
-
|
1221
|
+
{getTotalCreditLines(order.credit_lines ?? []) > 0 && (
|
1222
|
+
<div className="text-ui-fg-base flex items-center justify-between">
|
1223
|
+
<Text className="text-ui-fg-subtle" size="small" leading="compact">
|
1224
|
+
{t("fields.creditTotal")}
|
1225
|
+
</Text>
|
1166
1226
|
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1227
|
+
<Text className="text-ui-fg-subtle" size="small" leading="compact">
|
1228
|
+
{getStylizedAmount(
|
1229
|
+
getTotalCreditLines(order.credit_lines ?? []),
|
1230
|
+
order.currency_code
|
1231
|
+
)}
|
1232
|
+
</Text>
|
1233
|
+
</div>
|
1234
|
+
)}
|
1174
1235
|
|
1175
1236
|
<div className="text-ui-fg-base flex items-center justify-between">
|
1176
1237
|
<Text
|
@@ -10,14 +10,21 @@ const DEFAULT_PROPERTIES = [
|
|
10
10
|
// --- TOTALS ---
|
11
11
|
"total",
|
12
12
|
"credit_line_total",
|
13
|
+
"item_subtotal",
|
13
14
|
"item_total",
|
15
|
+
"item_tax_total",
|
16
|
+
"original_item_tax_total",
|
17
|
+
"item_discount_total",
|
14
18
|
"shipping_subtotal",
|
15
19
|
"original_total",
|
20
|
+
"original_tax_total",
|
16
21
|
"subtotal",
|
17
22
|
"discount_total",
|
18
23
|
"discount_subtotal",
|
19
24
|
"shipping_total",
|
20
25
|
"shipping_tax_total",
|
26
|
+
"original_shipping_tax_total",
|
27
|
+
"shipping_discount_total",
|
21
28
|
"tax_total",
|
22
29
|
"refundable_total",
|
23
30
|
"order_change",
|