@mercurjs/admin 2.2.0-canary.9 → 2.2.0-rc.0
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-XANY2FIV.js → add-campaign-promotions-QK73ARX4.js} +14 -14
- package/dist/{adjust-inventory-DJRDNU2V.js → adjust-inventory-X45NEQFK.js} +33 -33
- package/dist/{api-key-management-create-UD5V7TOU.js → api-key-management-create-LOD37GOQ.js} +5 -5
- package/dist/{api-key-management-detail-XJVWUU2C.js → api-key-management-detail-HKNZPPR2.js} +36 -37
- package/dist/{api-key-management-edit-4TLKJSAE.js → api-key-management-edit-JP2GUMMJ.js} +5 -5
- package/dist/{api-key-management-list-SZUSD6UI.js → api-key-management-list-5RXBJ24C.js} +9 -9
- package/dist/{api-key-management-sales-channels-TK6XEGF3.js → api-key-management-sales-channels-4GLVMHU6.js} +9 -10
- package/dist/{attribute-create-2COL3PJX.js → attribute-create-VGL7LGIH.js} +56 -66
- package/dist/{attribute-create-possible-value-EXVHC272.js → attribute-create-possible-value-QFXKXZM4.js} +2 -2
- package/dist/{attribute-detail-7SK3MWGQ.js → attribute-detail-EKDAYT4B.js} +56 -44
- package/dist/{attribute-edit-LUY66TG3.js → attribute-edit-OBNLNOJS.js} +7 -7
- package/dist/{attribute-edit-possible-value-IOS3625C.js → attribute-edit-possible-value-QDFVWLA3.js} +5 -5
- package/dist/{attribute-edit-ranking-7AAAYEC7.js → attribute-edit-ranking-YGR3KCSC.js} +3 -3
- package/dist/attribute-list-6A72PBIY.js +61 -0
- package/dist/breadcrumb-GHBR74WM.js +27 -0
- package/dist/breadcrumb-IEEJTH47.js +26 -0
- package/dist/{campaign-budget-edit-WKSYXTBX.js → campaign-budget-edit-NONE5NMV.js} +3 -3
- package/dist/{campaign-configuration-ZTK46EB5.js → campaign-configuration-JYSVIQFE.js} +3 -3
- package/dist/{campaign-create-7BELREFT.js → campaign-create-6U2PONHA.js} +7 -7
- package/dist/{campaign-detail-XL3QCW5Y.js → campaign-detail-RNB3FEJZ.js} +41 -41
- package/dist/{campaign-edit-ZGLDY4X4.js → campaign-edit-MAS3DCFB.js} +3 -3
- package/dist/{campaign-list-NQGNOFVZ.js → campaign-list-CDV4GWWD.js} +7 -7
- package/dist/{categories-metadata-C6HVQRH2.js → categories-metadata-4LXL2PWA.js} +34 -34
- package/dist/{category-create-GMCJABRW.js → category-create-AIS2MG7E.js} +9 -6
- package/dist/{category-detail-R2VZJEAV.js → category-detail-557376TZ.js} +46 -44
- package/dist/{category-edit-GLE4NTFG.js → category-edit-LYR2IOTA.js} +7 -6
- package/dist/category-icon-edit-W2TPCSDC.js +117 -0
- package/dist/{category-list-SNVOQ64L.js → category-list-XKRI24VN.js} +12 -9
- package/dist/category-media-PC4V7YU4.js +655 -0
- package/dist/{category-organize-UY4M4N7S.js → category-organize-H4JYCHDA.js} +3 -3
- package/dist/{category-products-EWBBAXAH.js → category-products-44PCDDNN.js} +48 -47
- package/dist/{chunk-A7JOHU6Q.js → chunk-25U23TXK.js} +2 -2
- package/dist/{chunk-JM7MSBWD.js → chunk-2FPQHWJZ.js} +3 -3
- package/dist/{chunk-WQFFCK3R.js → chunk-2V74T2WI.js} +1 -1
- package/dist/{chunk-37N6S4CU.js → chunk-2Z2M5K5A.js} +4 -4
- package/dist/{chunk-26UTIAAZ.js → chunk-32URSQ4F.js} +1 -1
- package/dist/{chunk-WTK4MLMF.js → chunk-32ZNZDFT.js} +4 -4
- package/dist/{chunk-BSU6VOKG.js → chunk-3BTRS4AA.js} +81 -64
- package/dist/{chunk-VKOE5J66.js → chunk-3XOE4NV5.js} +11 -2
- package/dist/{chunk-57RZ7ZOK.js → chunk-4346EIRG.js} +5 -5
- package/dist/{chunk-SVKQDD7E.js → chunk-4BCUGMOR.js} +2 -2
- package/dist/{chunk-CVFVEDMV.js → chunk-4BPQNCF5.js} +2 -2
- package/dist/chunk-4C7L7TJT.js +87 -0
- package/dist/{chunk-JSMUFZZN.js → chunk-56UFDHNO.js} +1 -1
- package/dist/{chunk-5UPOHLBD.js → chunk-5ACJR6WB.js} +5 -5
- package/dist/{chunk-JQV7CXEC.js → chunk-5BSSIDW6.js} +17 -2
- package/dist/{chunk-CPXK5RSJ.js → chunk-5Y2AIJ2T.js} +1 -1
- package/dist/{chunk-BGQ7H2KL.js → chunk-65YE4SVL.js} +5 -4
- package/dist/chunk-6BAPAIQM.js +8 -0
- package/dist/{chunk-IAWZQKUH.js → chunk-6BWJWA2F.js} +2 -2
- package/dist/{chunk-FB7DDNCA.js → chunk-6DJQITWV.js} +4 -4
- package/dist/{chunk-IQCUYC42.js → chunk-6KWWJE5P.js} +25 -16
- package/dist/{chunk-NQEXDLYH.js → chunk-6ZVV2XHU.js} +28 -9
- package/dist/{chunk-EHGCFAN6.js → chunk-7O7LYBHL.js} +8 -8
- package/dist/chunk-7OKYEA6I.js +283 -0
- package/dist/{chunk-GKGLVDDV.js → chunk-A2F5MDPU.js} +1 -1
- package/dist/{chunk-LOIFUOOA.js → chunk-ABS7HMLY.js} +2 -2
- package/dist/{chunk-X45JKZYW.js → chunk-AMZ2QSSI.js} +6 -6
- package/dist/{chunk-XJ3WC4G7.js → chunk-BF7X4JQT.js} +2 -2
- package/dist/{chunk-3VTAK3S6.js → chunk-BFUHW56P.js} +4 -4
- package/dist/{chunk-LEG67A2R.js → chunk-BILFRATX.js} +1 -10
- package/dist/{chunk-2OF7GB7J.js → chunk-BLR3NTU6.js} +74 -21
- package/dist/{chunk-Z5T5EPLF.js → chunk-BNFTJW4L.js} +2 -2
- package/dist/{chunk-CVFX57MN.js → chunk-BTJR5RSV.js} +11 -11
- package/dist/chunk-BVIIRGSW.js +204 -0
- package/dist/chunk-BW7BDHZV.js +34 -0
- package/dist/{chunk-LYZT5REU.js → chunk-C4XKPQ6T.js} +14 -1
- package/dist/{chunk-N6SI4IIT.js → chunk-CARSKIPW.js} +1 -1
- package/dist/chunk-CGIVQ7D2.js +115 -0
- package/dist/{chunk-HR7TFO2X.js → chunk-CHMIK6PK.js} +7 -7
- package/dist/{chunk-DRJAKRTI.js → chunk-CNODWD3F.js} +5 -5
- package/dist/chunk-CU4UVEHX.js +121 -0
- package/dist/{chunk-TE4IF3MM.js → chunk-CW3HYGS5.js} +1 -1
- package/dist/{chunk-WPVDACTL.js → chunk-DI2M3J5Q.js} +1 -1
- package/dist/{chunk-YYMACYP6.js → chunk-DL7ENIQB.js} +1 -1
- package/dist/{chunk-W2QNDZTH.js → chunk-DPG4AWSG.js} +3 -3
- package/dist/{chunk-UCYSCKZV.js → chunk-DSTHXHJ5.js} +2114 -1699
- package/dist/{chunk-Y6NDT26D.js → chunk-EGHDC6K6.js} +6 -6
- package/dist/{chunk-FXWKGNRV.js → chunk-EJY35WBK.js} +2 -2
- package/dist/{chunk-3JSAS7QP.js → chunk-EOSJHPHN.js} +22 -6
- package/dist/{chunk-46M463BR.js → chunk-EWFOFSF7.js} +1 -1
- package/dist/{chunk-PMWLTPYR.js → chunk-EX4AGESR.js} +81 -77
- package/dist/{chunk-XLE7EDWR.js → chunk-F2SZ4LPF.js} +347 -39
- package/dist/{chunk-533GMKEG.js → chunk-F5NW4XBU.js} +23 -3
- package/dist/{chunk-5AZCIOS4.js → chunk-F6NPDZHW.js} +2 -2
- package/dist/chunk-FICKHCWL.js +279 -0
- package/dist/{chunk-OKDODCIP.js → chunk-FLFE6HXW.js} +1 -1
- package/dist/{chunk-CMHI2RPL.js → chunk-FMJBQE56.js} +21 -0
- package/dist/{chunk-4LXBQTFN.js → chunk-FREUYHMS.js} +1 -1
- package/dist/{chunk-OHOWEMHO.js → chunk-G5KNNOXX.js} +32 -26
- package/dist/{chunk-ZN7LWXVC.js → chunk-GCEOEV6P.js} +1 -1
- package/dist/chunk-GCU4LHGY.js +1238 -0
- package/dist/{chunk-2YE5K2D7.js → chunk-GISFIAGQ.js} +6 -6
- package/dist/{chunk-P5XVG4PY.js → chunk-GLZLBHFC.js} +2 -2
- package/dist/{chunk-PVZBDWLK.js → chunk-GRH7C3QN.js} +1 -1
- package/dist/{chunk-BFT3CN5L.js → chunk-GWSRWILC.js} +3 -3
- package/dist/{chunk-VDKOJ5WD.js → chunk-GYRTURN7.js} +1 -1
- package/dist/{chunk-LYZDVZWA.js → chunk-H7NIKMPE.js} +2 -2
- package/dist/{chunk-7MMLCMV3.js → chunk-HB3KRNZM.js} +1 -1
- package/dist/{chunk-I5THQVYP.js → chunk-HGTPUAHD.js} +1 -1
- package/dist/{chunk-FDD7TANX.js → chunk-HI7NZVSJ.js} +6 -6
- package/dist/{chunk-YFRC6GEN.js → chunk-HLL6GLZO.js} +3 -3
- package/dist/chunk-HQM7D57C.js +474 -0
- package/dist/{chunk-MVNO35S5.js → chunk-HRDVGFS7.js} +2 -2
- package/dist/chunk-HT34QVZR.js +184 -0
- package/dist/{chunk-WJJXUXSO.js → chunk-IC2PLPRP.js} +1 -1
- package/dist/{chunk-6IXCZ3FF.js → chunk-IVBNI2QE.js} +228 -97
- package/dist/chunk-IWBQZK6E.js +166 -0
- package/dist/chunk-IZDTQFCP.js +65 -0
- package/dist/{chunk-HEGPAGJT.js → chunk-J3L2FUIA.js} +6 -5
- package/dist/{chunk-AEMDNTW5.js → chunk-J54BZXZX.js} +2 -2
- package/dist/{chunk-CVBPTNG7.js → chunk-JEDX4KBB.js} +3 -3
- package/dist/{chunk-THZ5Q2UG.js → chunk-JHBNG7OD.js} +16 -0
- package/dist/{chunk-LYD3C73Z.js → chunk-JI7HMGMO.js} +1 -1
- package/dist/{chunk-NUC27ELX.js → chunk-JLCA6PWC.js} +5 -5
- package/dist/chunk-JSVYNNPF.js +101 -0
- package/dist/{chunk-SV5YQGFE.js → chunk-JU2O2H7I.js} +16 -15
- package/dist/{chunk-KT7X72J4.js → chunk-JXSXBSV6.js} +9 -1
- package/dist/{chunk-DN2K5EAH.js → chunk-JZJT26E3.js} +2 -2
- package/dist/{chunk-33BERJSG.js → chunk-K6RZE3F7.js} +1 -1
- package/dist/{chunk-FNKBJCNF.js → chunk-K7H77TA5.js} +4 -4
- package/dist/{chunk-YGRTRAWX.js → chunk-KDE4HKH2.js} +1 -0
- package/dist/{chunk-7MKIOI7P.js → chunk-KFYTUQXT.js} +7 -7
- package/dist/{chunk-VT5E7OMM.js → chunk-KGA2XI6W.js} +4 -4
- package/dist/chunk-KT4DGVRQ.js +381 -0
- package/dist/{chunk-Q2ULPJJ6.js → chunk-KXWN75T2.js} +2 -2
- package/dist/{chunk-LAPEZATU.js → chunk-L7DIEO5B.js} +1 -1
- package/dist/{chunk-CKD5563X.js → chunk-LQSSUC7W.js} +2 -2
- package/dist/{chunk-453BC56K.js → chunk-LSMTJU6Y.js} +3 -3
- package/dist/{chunk-45CPSFTO.js → chunk-LVRCEGL7.js} +176 -48
- package/dist/{chunk-ZBWL72TB.js → chunk-LXZXXOJ3.js} +1 -11
- package/dist/{chunk-KXHYJGAV.js → chunk-ML7UVBKL.js} +1 -1
- package/dist/{chunk-DAXXLQKB.js → chunk-MO7TNIVQ.js} +1 -1
- package/dist/{chunk-GU52ZMNY.js → chunk-MOG7LT73.js} +13 -13
- package/dist/{chunk-6FHQCLHQ.js → chunk-MW47LDBT.js} +2 -2
- package/dist/{chunk-W6V2L2FX.js → chunk-MZOINNCV.js} +3 -3
- package/dist/{chunk-UXGLM3B4.js → chunk-NEGOGYEO.js} +4 -4
- package/dist/{chunk-SFSD57M5.js → chunk-NISAIYSW.js} +7 -7
- package/dist/{chunk-GP4J42UD.js → chunk-NOKCLBAL.js} +1 -1
- package/dist/{chunk-YNHS5G26.js → chunk-NQ2RDSI3.js} +2 -2
- package/dist/{chunk-LDQY7K5W.js → chunk-NWSKT55Z.js} +3 -3
- package/dist/{chunk-6PLDJPQ3.js → chunk-NZVS6B77.js} +598 -775
- package/dist/{chunk-XODBX3LN.js → chunk-OAN4CZKX.js} +12 -19
- package/dist/{chunk-QUPUWR42.js → chunk-OPSGADQI.js} +10 -8
- package/dist/{chunk-C4JUURO5.js → chunk-OT5X3VOQ.js} +1 -1
- package/dist/{chunk-OMBP3YSV.js → chunk-OYZIFLLC.js} +19 -72
- package/dist/{chunk-634XVU3D.js → chunk-PAYQJPGK.js} +8 -1
- package/dist/{chunk-PASEZJC7.js → chunk-PFBJWWUA.js} +9 -9
- package/dist/{chunk-PT5G44WJ.js → chunk-PMVWIBTI.js} +8 -8
- package/dist/{chunk-VYMODH6P.js → chunk-PYF5EER5.js} +1 -1
- package/dist/{chunk-4AU37UL5.js → chunk-PYZ7VL5X.js} +3 -3
- package/dist/{chunk-X7H7TIOT.js → chunk-Q4R2O7XF.js} +9 -9
- package/dist/{chunk-5TRY5IMZ.js → chunk-Q6GUA5VE.js} +2 -2
- package/dist/{chunk-LGL4QSGB.js → chunk-Q6QXFLUY.js} +6 -6
- package/dist/{chunk-X2T3AU67.js → chunk-QCIDV3AP.js} +3 -3
- package/dist/{chunk-SJGIQGEC.js → chunk-QDUZCJ7F.js} +1 -1
- package/dist/{chunk-3B6HI32S.js → chunk-QE4R2KT3.js} +1 -1
- package/dist/chunk-QJCUPZZQ.js +356 -0
- package/dist/chunk-QR3GYYX6.js +0 -0
- package/dist/{chunk-3B6MTW5G.js → chunk-QUHSHIAC.js} +3 -0
- package/dist/{chunk-OH4AABUT.js → chunk-R325CPYC.js} +1 -1
- package/dist/{chunk-JPNPTILP.js → chunk-R4O667NT.js} +1 -1
- package/dist/{chunk-PRBE5CM3.js → chunk-RGS5ZOY7.js} +32 -1
- package/dist/{chunk-D4PQL46N.js → chunk-RIO2IHPE.js} +1 -1
- package/dist/{chunk-2FGRDEAD.js → chunk-RQQ53CQJ.js} +1 -1
- package/dist/{chunk-U2ZFCAPX.js → chunk-SITRHMZZ.js} +11 -8
- package/dist/{chunk-AWCVVFEY.js → chunk-TDJSZ73V.js} +3 -3
- package/dist/{chunk-3VDLE5GA.js → chunk-TH26CWVG.js} +5 -5
- package/dist/{chunk-FFNSWUDC.js → chunk-THPXRTE5.js} +12 -5
- package/dist/{chunk-BPCU5QJE.js → chunk-TZM63FZ4.js} +3 -3
- package/dist/{chunk-X4EKVL5F.js → chunk-UZ452ISX.js} +254 -54
- package/dist/{chunk-K4WU4PVL.js → chunk-VBKFXL2Q.js} +3 -3
- package/dist/{chunk-UCX2T4BQ.js → chunk-VGXJXU7X.js} +8 -8
- package/dist/{chunk-ESPLVOFC.js → chunk-VHCDSNXF.js} +2 -2
- package/dist/{chunk-WM2BRJCJ.js → chunk-VJ4LQXMA.js} +127 -61
- package/dist/chunk-VM56ZITS.js +356 -0
- package/dist/{chunk-KXIA66EJ.js → chunk-VPYI4X6C.js} +9 -5
- package/dist/{chunk-4KX6CBJ4.js → chunk-VSLHL2AZ.js} +2 -0
- package/dist/{chunk-EPHVGD5Z.js → chunk-VXW3BCN2.js} +1 -1
- package/dist/{chunk-N7OVIX55.js → chunk-VY72NX26.js} +8 -8
- package/dist/{chunk-NJ7V6YWI.js → chunk-VYQ6ASFF.js} +70 -125
- package/dist/{chunk-CYGCCNIC.js → chunk-W3P3RP5R.js} +17 -5
- package/dist/{chunk-TLDLOE27.js → chunk-W7CJSBDM.js} +37 -9
- package/dist/{chunk-2WHSCEKX.js → chunk-WF3ZDT5Z.js} +11 -95
- package/dist/{chunk-MR3MLNWV.js → chunk-WKDHY2DJ.js} +1 -1
- package/dist/{chunk-WYA62MUL.js → chunk-X5PMVI7H.js} +3 -3
- package/dist/{chunk-VY7PT4SI.js → chunk-XW2BES72.js} +13 -13
- package/dist/{chunk-IMR3MZDP.js → chunk-YHEH25IE.js} +1 -1
- package/dist/{chunk-5NHDF6SM.js → chunk-YMOP6JKN.js} +7 -7
- package/dist/{chunk-NJP3DEE5.js → chunk-YNN2YNSE.js} +2 -2
- package/dist/{chunk-PAJ335VB.js → chunk-YRINVEI3.js} +2 -2
- package/dist/{chunk-VMEJGGXA.js → chunk-YRUCTB6M.js} +5 -5
- package/dist/{chunk-S4SVK5DE.js → chunk-YVLANFBK.js} +29 -1
- package/dist/{chunk-YDBPAHWU.js → chunk-YXKHBSQJ.js} +14 -188
- package/dist/{chunk-KAZ5BYTQ.js → chunk-ZAOEFQ6K.js} +5 -4
- package/dist/{chunk-H3MAUKL7.js → chunk-ZKHF75MZ.js} +204 -224
- package/dist/{chunk-5FFZQPTT.js → chunk-ZU74CNL4.js} +7 -7
- package/dist/{chunk-COP7NFSJ.js → chunk-ZVPTNPLI.js} +3 -3
- package/dist/{collection-add-products-6JY2OYKB.js → collection-add-products-JFUIZEZI.js} +45 -45
- package/dist/{collection-create-BRMP6SIZ.js → collection-create-5IGFVQKE.js} +87 -16
- package/dist/{collection-detail-PDR53MV5.js → collection-detail-2WOLOVWF.js} +45 -43
- package/dist/{collection-edit-YLWUEU4C.js → collection-edit-UMZN5JZ6.js} +4 -4
- package/dist/collection-icon-edit-WCSKUDXE.js +117 -0
- package/dist/collection-list-B3Y2ALLZ.js +85 -0
- package/dist/collection-media-YIV5BV3Y.js +655 -0
- package/dist/{collection-metadata-PBSEIVJ6.js → collection-metadata-SBK6SL4C.js} +34 -34
- package/dist/commission-rule-commission-edit-V5JVRNZN.js +195 -0
- package/dist/commission-rule-create-EZ2C6AWK.js +464 -0
- package/dist/commission-rule-detail-ZQ3OHFA2.js +45 -0
- package/dist/commission-rule-edit-NQ5EYCGO.js +352 -0
- package/dist/commissions-list-M5WLJD2P.js +36 -0
- package/dist/{constants-Bahlh59D.d.ts → constants-CBhKGpBZ.d.ts} +12 -5
- package/dist/{customer-create-QHA4KM6N.js → customer-create-ZQ4RTXBA.js} +3 -3
- package/dist/{customer-create-address-TYWVWNUE.js → customer-create-address-P2QYUZJ5.js} +3 -3
- package/dist/{customer-detail-PZ4RLCCE.js → customer-detail-ZGDPIWA4.js} +42 -45
- package/dist/{customer-edit-JZ4PQTIN.js → customer-edit-D55FJLIN.js} +3 -3
- package/dist/customer-edit-address-R5RXDUNZ.js +302 -0
- package/dist/{customer-group-add-customers-VJUBEN7M.js → customer-group-add-customers-O6A5ZFPM.js} +13 -13
- package/dist/{customer-group-create-NA2UKCF6.js → customer-group-create-44R3DDOT.js} +3 -3
- package/dist/{customer-group-detail-CQ7GI3CJ.js → customer-group-detail-FXUICFYC.js} +39 -39
- package/dist/{customer-group-edit-3O6HAYYN.js → customer-group-edit-NZ5SUPFQ.js} +3 -3
- package/dist/customer-group-list-R2DP2D42.js +57 -0
- package/dist/{customer-group-metadata-FBZAMX7J.js → customer-group-metadata-JX7ZBXLJ.js} +34 -34
- package/dist/{customer-list-MB6WZFMA.js → customer-list-Z4DUQHCH.js} +9 -9
- package/dist/{customer-metadata-DNCPK22Y.js → customer-metadata-JT5GGCRV.js} +34 -34
- package/dist/{customers-add-customer-group-AJJG2XEW.js → customers-add-customer-group-KX3XNNMU.js} +46 -45
- package/dist/{edit-inventory-item-MXA5NEWW.js → edit-inventory-item-73BY4I5T.js} +33 -33
- package/dist/{edit-inventory-item-attributes-M2NUNSM7.js → edit-inventory-item-attributes-ZMB343AB.js} +33 -33
- package/dist/{edit-reservation-6KA372WV.js → edit-reservation-BC5IOLK6.js} +5 -5
- package/dist/{edit-rules-2GVJU6O7.js → edit-rules-4PPNBI7B.js} +34 -34
- package/dist/global-commission-edit-TRSS5JBH.js +203 -0
- package/dist/index.css +5187 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +351 -307
- package/dist/inventory-create-XQKH3HZQ.js +58 -0
- package/dist/{inventory-detail-47UAVORN.js → inventory-detail-RZJNTJDF.js} +38 -38
- package/dist/{inventory-list-2JGX6BRI.js → inventory-list-SPSBDJXO.js} +8 -8
- package/dist/{inventory-metadata-N2PZACPZ.js → inventory-metadata-W2E4KYG3.js} +34 -34
- package/dist/{inventory-stock-6JUYSL3S.js → inventory-stock-D2BNT2UL.js} +38 -38
- package/dist/{invite-VQ2HR2OM.js → invite-25CGHT4W.js} +3 -3
- package/dist/loader-HRFMJ5TM.js +36 -0
- package/dist/loader-TIPLOZF7.js +32 -0
- package/dist/{location-create-ZMNB7YKR.js → location-create-GKORXOYD.js} +3 -3
- package/dist/{location-detail-OET2D2VX.js → location-detail-CNETNX3M.js} +36 -36
- package/dist/{location-edit-DMBF3CYZ.js → location-edit-T2CWF6N2.js} +3 -3
- package/dist/{location-fulfillment-providers-K6OKN6AY.js → location-fulfillment-providers-XXZ7AIUF.js} +46 -46
- package/dist/location-list-RHUT7IRA.js +54 -0
- package/dist/{location-sales-channels-GKIWX6B2.js → location-sales-channels-ZQBQ3VDH.js} +9 -10
- package/dist/{location-service-zone-create-ZS3UWJAA.js → location-service-zone-create-O6GYRZEE.js} +11 -11
- package/dist/{location-service-zone-edit-MTGU2O4C.js → location-service-zone-edit-7ZTB45TD.js} +5 -5
- package/dist/{location-service-zone-manage-areas-S7QZTIFT.js → location-service-zone-manage-areas-DBP3P27I.js} +11 -11
- package/dist/location-service-zone-shipping-option-create-3PQ2EYD7.js +60 -0
- package/dist/{location-service-zone-shipping-option-edit-3PGSNKYT.js → location-service-zone-shipping-option-edit-SLQM4GSH.js} +7 -7
- package/dist/{location-service-zone-shipping-option-pricing-POBJOF3Z.js → location-service-zone-shipping-option-pricing-UZ577SNK.js} +9 -9
- package/dist/{login-LTCJJFDI.js → login-OKBXMSKY.js} +32 -32
- package/dist/{manage-locations-TKLOHP3D.js → manage-locations-SUJNIWWF.js} +3 -3
- package/dist/{marketplace-add-currencies-6ANNBGZM.js → marketplace-add-currencies-IPE5RJF6.js} +13 -13
- package/dist/marketplace-detail-IHGJXVZS.js +75 -0
- package/dist/{marketplace-edit-6Q3G2OY5.js → marketplace-edit-WG6LMQ2P.js} +5 -5
- package/dist/{marketplace-metadata-KUUCCF4P.js → marketplace-metadata-STYABOTX.js} +34 -34
- package/dist/offer-detail-page-2G5BUOIB.js +585 -0
- package/dist/offer-variant-detail-page-V6TKNYZL.js +143 -0
- package/dist/offers-2QQFKGAX.js +183 -0
- package/dist/{order-create-claim-QWSJZUEM.js → order-create-claim-Y7ESDXLI.js} +281 -256
- package/dist/{order-create-edit-M4YFR6U7.js → order-create-edit-6L5S7KQM.js} +215 -120
- package/dist/{order-create-exchange-RD7VOZSB.js → order-create-exchange-WHO3K2MW.js} +299 -271
- package/dist/{order-create-refund-XHQREMTG.js → order-create-refund-4ZO73NWS.js} +37 -37
- package/dist/{order-create-return-EOKSXD2G.js → order-create-return-R5WJBQ5W.js} +53 -26
- package/dist/{order-detail-QUPHQYYD.js → order-detail-QUGH2GXH.js} +45 -46
- package/dist/{order-edit-billing-address-WAG2HYJP.js → order-edit-billing-address-BEOKFNLZ.js} +35 -35
- package/dist/{order-edit-email-BVINKRKO.js → order-edit-email-GLAQZCIT.js} +34 -34
- package/dist/{order-edit-shipping-address-ZC5HY26W.js → order-edit-shipping-address-PF54SFAG.js} +34 -34
- package/dist/{order-list-2PKEFG4L.js → order-list-GMUOLGZY.js} +19 -18
- package/dist/{order-metadata-NI65ZEFX.js → order-metadata-VQOA3DOL.js} +34 -34
- package/dist/{order-request-transfer-X7D3T6YH.js → order-request-transfer-BLQQ66IF.js} +34 -34
- package/dist/pages/index.d.ts +599 -489
- package/dist/pages/index.js +192 -184
- package/dist/{payout-detail-TWO6HN4E.js → payout-detail-6U2ANWOH.js} +3 -3
- package/dist/{payout-list-7WJZFNW5.js → payout-list-3GQJQSVU.js} +8 -8
- package/dist/{price-list-configuration-Q5H22ZE2.js → price-list-configuration-BLHIGDSV.js} +14 -13
- package/dist/price-list-create-HKN72A6Q.js +77 -0
- package/dist/{price-list-detail-6M2QQ63Q.js → price-list-detail-6JAMNNJW.js} +44 -44
- package/dist/{price-list-edit-YY4SXEI3.js → price-list-edit-RZQMPHXU.js} +5 -5
- package/dist/{price-list-list-OIOY43TF.js → price-list-list-HLWCOORV.js} +11 -11
- package/dist/price-list-prices-add-ST6WNQNH.js +72 -0
- package/dist/{price-list-prices-edit-GS7L2BYX.js → price-list-prices-edit-ZQE3Z3NK.js} +35 -35
- package/dist/{product-add-existing-attributes-3Q2LGRQO.js → product-add-existing-attributes-J6MML6MT.js} +52 -49
- package/dist/{product-attributes-C3KHQF2I.js → product-attributes-4EPKS6MP.js} +4 -4
- package/dist/{product-bulk-edit-J3CMBZN2.js → product-bulk-edit-TRI2KKHW.js} +4 -4
- package/dist/product-create-B4DTC2OM.js +71 -0
- package/dist/{product-create-attribute-XARMC6FJ.js → product-create-attribute-BP6NN4GO.js} +21 -11
- package/dist/{product-create-variant-6VUKYLWE.js → product-create-variant-VDQQNHAK.js} +8 -8
- package/dist/{product-detail-OKHNAVKL.js → product-detail-MFJ3AIU6.js} +41 -37
- package/dist/{product-edit-F4CKOIUO.js → product-edit-26AWYWUU.js} +4 -4
- package/dist/product-edit-attribute-AXPTES26.js +336 -0
- package/dist/product-list-DMQSLXM4.js +87 -0
- package/dist/{product-media-PKIQO5ZS.js → product-media-XRBLOV7D.js} +14 -17
- package/dist/{product-metadata-HMRYPUVS.js → product-metadata-LOF6TSJQ.js} +35 -35
- package/dist/{product-organization-BFWDCHP4.js → product-organization-ISVMEWQG.js} +86 -10
- package/dist/{product-sales-channels-WKQSYOEX.js → product-sales-channels-C6UUHWGB.js} +8 -9
- package/dist/{product-shipping-profile-WDLKA2SN.js → product-shipping-profile-VTYQ22E4.js} +4 -4
- package/dist/{product-tag-create-JPRBCLRG.js → product-tag-create-AHG3Y4GE.js} +33 -33
- package/dist/{product-tag-detail-KAVDX34C.js → product-tag-detail-4FL4CU5S.js} +58 -56
- package/dist/{product-tag-edit-HZSUOL64.js → product-tag-edit-ACHNVZZP.js} +33 -33
- package/dist/{product-tag-list-FECZ4YS2.js → product-tag-list-YPTIDXPX.js} +58 -56
- package/dist/{product-tag-metadata-YP4SOBCH.js → product-tag-metadata-BXC7GMBB.js} +34 -34
- package/dist/{product-type-create-RHG4KEAV.js → product-type-create-PPTAW3DW.js} +3 -3
- package/dist/{product-type-detail-BWAJ2JO5.js → product-type-detail-RAYCHYAF.js} +44 -44
- package/dist/{product-type-edit-CABB7R7Y.js → product-type-edit-55AH3P7G.js} +3 -3
- package/dist/{product-type-list-TM26QMHR.js → product-type-list-JN4SKTFE.js} +8 -8
- package/dist/{product-type-metadata-EJOBRGZ6.js → product-type-metadata-24JU4JNK.js} +34 -34
- package/dist/{product-variant-detail-VXWES7XS.js → product-variant-detail-7CFNAI3A.js} +33 -33
- package/dist/{product-variant-edit-XH4R6M3D.js → product-variant-edit-C4HXFQFW.js} +35 -35
- package/dist/{product-variant-metadata-Y6SO5UJI.js → product-variant-metadata-5PUBLPDN.js} +34 -34
- package/dist/{profile-detail-ZRL5SERS.js → profile-detail-PABUO545.js} +3 -3
- package/dist/{profile-edit-HQTWYWZ7.js → profile-edit-O6Z3XJ4U.js} +3 -3
- package/dist/{promotion-add-campaign-S3JJSFHT.js → promotion-add-campaign-WK36UMSF.js} +7 -7
- package/dist/promotion-create-7VBA6JFM.js +57 -0
- package/dist/{promotion-detail-KTPZUDXT.js → promotion-detail-KXXWEFHW.js} +36 -36
- package/dist/{promotion-edit-details-TKRC5HES.js → promotion-edit-details-YM5JPGEC.js} +5 -10
- package/dist/{promotion-list-SSWK44YZ.js → promotion-list-56ZDROMH.js} +10 -10
- package/dist/{refund-reason-create-XDJFPVZL.js → refund-reason-create-UA3XS6DP.js} +33 -33
- package/dist/{refund-reason-edit-VI5DSC7T.js → refund-reason-edit-3TAGKV3U.js} +33 -33
- package/dist/{refund-reason-list-3PYLHTJZ.js → refund-reason-list-PBLA5HYO.js} +49 -47
- package/dist/{region-add-countries-COXN4LP3.js → region-add-countries-UO5A42HM.js} +12 -12
- package/dist/{region-create-P66Q65XY.js → region-create-7NA6RKWS.js} +13 -13
- package/dist/{region-detail-P2HHBYFV.js → region-detail-636IAPYK.js} +9 -9
- package/dist/{region-edit-XFE54SAO.js → region-edit-Z4VYO3TQ.js} +5 -5
- package/dist/{region-list-2XXKCDDX.js → region-list-GIU6NFI4.js} +9 -9
- package/dist/{region-metadata-6RR2SU5H.js → region-metadata-NRV3L42D.js} +34 -34
- package/dist/{reservation-create-LRSOJH6K.js → reservation-create-ANLVF7EC.js} +5 -5
- package/dist/{reservation-detail-L4B27AVM.js → reservation-detail-MAWHNY2H.js} +33 -33
- package/dist/{reservation-list-YWCTHZUL.js → reservation-list-UWZRPRPH.js} +9 -9
- package/dist/{reservation-metadata-W6IYXGPB.js → reservation-metadata-ZFKKAOWG.js} +34 -34
- package/dist/{reset-password-EBZ65YXV.js → reset-password-UDA5ZMTZ.js} +3 -3
- package/dist/{return-reason-create-KED7446I.js → return-reason-create-DYJCGEOK.js} +3 -3
- package/dist/{return-reason-edit-57EU3XSE.js → return-reason-edit-A7ATUTCD.js} +3 -3
- package/dist/{return-reason-list-74IYCLLS.js → return-reason-list-NPAAMB5H.js} +23 -21
- package/dist/{sales-channel-add-products-6UPTDZPP.js → sales-channel-add-products-2BBIMN6N.js} +46 -46
- package/dist/{sales-channel-create-XBR3QESI.js → sales-channel-create-OC2BB67N.js} +4 -4
- package/dist/{sales-channel-detail-H6XNWIK6.js → sales-channel-detail-D5R7HPC7.js} +43 -43
- package/dist/{sales-channel-edit-ILBZBQP4.js → sales-channel-edit-V62TBRC4.js} +4 -4
- package/dist/sales-channel-list-LVW7XE7K.js +52 -0
- package/dist/{sales-channel-metadata-ILMPQGG3.js → sales-channel-metadata-5W4OZZYI.js} +34 -34
- package/dist/{shipping-option-type-create-6JJFI3KO.js → shipping-option-type-create-GHOCZT64.js} +33 -33
- package/dist/{shipping-option-type-detail-QOQ4EE2K.js → shipping-option-type-detail-W32EHTBS.js} +34 -34
- package/dist/{shipping-option-type-edit-OQWZ7PWX.js → shipping-option-type-edit-KRIP6HTC.js} +33 -33
- package/dist/shipping-option-type-list-4FML2ZX5.js +60 -0
- package/dist/{shipping-profile-create-UJNCCKKK.js → shipping-profile-create-HKYX4FKJ.js} +3 -3
- package/dist/{shipping-profile-detail-YAKZHWZI.js → shipping-profile-detail-UFGQ3CCH.js} +3 -3
- package/dist/{shipping-profile-metadata-TFG6BEVX.js → shipping-profile-metadata-52ZW757T.js} +34 -34
- package/dist/{shipping-profiles-list-JF2SQIQ7.js → shipping-profiles-list-PZQVMKR4.js} +7 -7
- package/dist/{store-address-edit-PKIBRFH4.js → store-address-edit-IJ2UW6WC.js} +4 -4
- package/dist/{store-bulk-edit-BNF3HH5K.js → store-bulk-edit-OIYKZ6AZ.js} +5 -5
- package/dist/{store-closure-edit-OK7MTUHY.js → store-closure-edit-H3EKROXP.js} +3 -3
- package/dist/{store-create-MIMJEBST.js → store-create-Y3BGG5P5.js} +36 -36
- package/dist/{store-details-TGB2GFLX.js → store-details-56IHJJQV.js} +51 -51
- package/dist/{store-edit-XNZRRLYY.js → store-edit-HWOGEOCH.js} +14 -10
- package/dist/store-list-5DRW6QZF.js +82 -0
- package/dist/{store-member-invite-J5XSPWMW.js → store-member-invite-7ORIMT73.js} +6 -6
- package/dist/{store-payment-details-edit-HOGHZMZC.js → store-payment-details-edit-ERRJDLBO.js} +3 -3
- package/dist/{store-professional-details-edit-DPJ4ZFDR.js → store-professional-details-edit-VD2J4VYV.js} +3 -3
- package/dist/{tax-region-create-FN4W4SQK.js → tax-region-create-GGDCD2VU.js} +34 -34
- package/dist/tax-region-detail-L7STT6C7.js +69 -0
- package/dist/{tax-region-edit-RCGY5D3G.js → tax-region-edit-6JOV3POI.js} +33 -33
- package/dist/{tax-region-list-FIBHEFVD.js → tax-region-list-NIAT626R.js} +8 -8
- package/dist/{tax-region-metadata-NKJXZ4SR.js → tax-region-metadata-4P667IOY.js} +34 -34
- package/dist/{tax-region-province-create-OVLIZPNP.js → tax-region-province-create-7YT2LNJG.js} +3 -3
- package/dist/{tax-region-province-detail-L2TWOQ7H.js → tax-region-province-detail-2GRPOSWS.js} +40 -40
- package/dist/{tax-region-tax-override-create-767T73RO.js → tax-region-tax-override-create-R5GKEOK6.js} +61 -61
- package/dist/{tax-region-tax-override-edit-T2BK7ZPA.js → tax-region-tax-override-edit-MLJKNLAR.js} +61 -61
- package/dist/{tax-region-tax-rate-create-KDN6G52Y.js → tax-region-tax-rate-create-3ZLVL3X3.js} +4 -4
- package/dist/{tax-region-tax-rate-edit-D4BFDDJ7.js → tax-region-tax-rate-edit-XVMPIJOF.js} +4 -4
- package/dist/{user-detail-MMVBN3AE.js → user-detail-452E7GII.js} +4 -4
- package/dist/{user-edit-MXS2DV37.js → user-edit-T3MZKULQ.js} +3 -3
- package/dist/{user-invite-HLZJ7FST.js → user-invite-FCWARLW5.js} +11 -11
- package/dist/{user-list-TR7RSGUO.js → user-list-OU6WS25V.js} +7 -7
- package/dist/{user-metadata-IZCJT3N5.js → user-metadata-CHHV7S3A.js} +34 -34
- package/package.json +15 -12
- package/dist/[id]-272FUOXG.js +0 -503
- package/dist/attribute-list-SK3ZYHDB.js +0 -61
- package/dist/chunk-4GFS57XI.js +0 -390
- package/dist/chunk-54RTJBYO.js +0 -153
- package/dist/chunk-7O6WJTBI.js +0 -139
- package/dist/chunk-AKTAFKIU.js +0 -228
- package/dist/chunk-CKNQJPAG.js +0 -135
- package/dist/chunk-FG4NHVBO.js +0 -1755
- package/dist/chunk-GVEF6UDT.js +0 -8
- package/dist/chunk-RXM4B6HR.js +0 -8
- package/dist/chunk-SWL7ZCP3.js +0 -11
- package/dist/chunk-UM7ZR3VU.js +0 -14
- package/dist/collection-list-ZAMXJO4H.js +0 -82
- package/dist/commission-rate-create-O2TZ56RG.js +0 -782
- package/dist/commission-rate-detail-Y5NPDWQN.js +0 -85
- package/dist/commission-rate-edit-X5RJS6XC.js +0 -767
- package/dist/commission-rate-list-Y5XLEO67.js +0 -26
- package/dist/customer-group-list-RGCIS44T.js +0 -57
- package/dist/inventory-create-VIIAVANZ.js +0 -58
- package/dist/loader-O4EABIXE.js +0 -26
- package/dist/location-list-YH3X5HHG.js +0 -54
- package/dist/location-service-zone-shipping-option-create-FK447EYC.js +0 -60
- package/dist/marketplace-detail-VXY6MKJS.js +0 -75
- package/dist/offers-O4BI5PLZ.js +0 -440
- package/dist/order-allocate-items-XSJ65QFV.js +0 -563
- package/dist/order-create-fulfillment-QT3QP5EE.js +0 -643
- package/dist/order-create-shipment-664JCOKN.js +0 -214
- package/dist/order-receive-return-KJPDZB5H.js +0 -562
- package/dist/price-list-create-W2NKRFCV.js +0 -77
- package/dist/price-list-prices-add-KGW5H7JL.js +0 -72
- package/dist/product-create-3WA2FHND.js +0 -71
- package/dist/product-edit-attribute-LG2ZM6HQ.js +0 -175
- package/dist/product-list-OEM73MI2.js +0 -87
- package/dist/promotion-create-7HDNJF2T.js +0 -57
- package/dist/sales-channel-list-VA2OASCG.js +0 -53
- package/dist/shipping-option-type-list-YRDWTDMK.js +0 -60
- package/dist/store-list-BLXUWEG3.js +0 -82
- package/dist/tax-region-detail-XN4P6VR5.js +0 -69
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
By
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OT5X3VOQ.js";
|
|
4
4
|
import {
|
|
5
5
|
getFormattedAddress,
|
|
6
6
|
isSameAddress
|
|
@@ -18,24 +18,26 @@ import {
|
|
|
18
18
|
useCancelClaim,
|
|
19
19
|
useCancelClaimRequest,
|
|
20
20
|
useClaims
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-QCIDV3AP.js";
|
|
22
22
|
import {
|
|
23
23
|
useCancelExchange,
|
|
24
24
|
useCancelExchangeRequest,
|
|
25
25
|
useExchanges
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import {
|
|
28
|
-
getReturnableQuantity
|
|
29
|
-
} from "./chunk-UM7ZR3VU.js";
|
|
26
|
+
} from "./chunk-PYZ7VL5X.js";
|
|
30
27
|
import {
|
|
28
|
+
getReturnableQuantity,
|
|
31
29
|
useCancelReturn,
|
|
32
30
|
useCancelReturnRequest,
|
|
33
31
|
useReturns
|
|
34
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-YXKHBSQJ.js";
|
|
35
33
|
import {
|
|
36
34
|
useCancelOrderEdit,
|
|
37
35
|
useConfirmOrderEdit
|
|
38
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-YMOP6JKN.js";
|
|
37
|
+
import {
|
|
38
|
+
getPaymentsFromOrder,
|
|
39
|
+
getReservationsLimitCount
|
|
40
|
+
} from "./chunk-3KOTDGC2.js";
|
|
39
41
|
import {
|
|
40
42
|
formatProvider
|
|
41
43
|
} from "./chunk-VW56KWO2.js";
|
|
@@ -44,7 +46,7 @@ import {
|
|
|
44
46
|
} from "./chunk-XSX255FK.js";
|
|
45
47
|
import {
|
|
46
48
|
DEFAULT_FIELDS
|
|
47
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-JHBNG7OD.js";
|
|
48
50
|
import {
|
|
49
51
|
FulfillmentStatusCell,
|
|
50
52
|
FulfillmentStatusHeader,
|
|
@@ -63,53 +65,48 @@ import {
|
|
|
63
65
|
getStylizedAmount,
|
|
64
66
|
isAmountLessThenRoundingError
|
|
65
67
|
} from "./chunk-PXYDR7WQ.js";
|
|
66
|
-
import {
|
|
67
|
-
getPaymentsFromOrder,
|
|
68
|
-
getReservationsLimitCount
|
|
69
|
-
} from "./chunk-3KOTDGC2.js";
|
|
70
68
|
import {
|
|
71
69
|
TextCell,
|
|
72
70
|
TextHeader
|
|
73
71
|
} from "./chunk-JHIMVLB2.js";
|
|
74
|
-
import {
|
|
75
|
-
_DataTable,
|
|
76
|
-
useDataTable
|
|
77
|
-
} from "./chunk-NQEXDLYH.js";
|
|
78
72
|
import {
|
|
79
73
|
TwoColumnPage
|
|
80
74
|
} from "./chunk-E74OUNA3.js";
|
|
81
75
|
import {
|
|
82
76
|
Thumbnail
|
|
83
77
|
} from "./chunk-WIYFXWRI.js";
|
|
78
|
+
import {
|
|
79
|
+
_DataTable,
|
|
80
|
+
useDataTable
|
|
81
|
+
} from "./chunk-6ZVV2XHU.js";
|
|
84
82
|
import {
|
|
85
83
|
useDate
|
|
86
84
|
} from "./chunk-UZWFZMOX.js";
|
|
87
85
|
import {
|
|
88
86
|
useCapturePayment,
|
|
89
87
|
useMarkPaymentCollectionAsPaid
|
|
90
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-ABS7HMLY.js";
|
|
91
89
|
import {
|
|
92
90
|
useStockLocation
|
|
93
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-VXW3BCN2.js";
|
|
92
|
+
import {
|
|
93
|
+
useReservationItems
|
|
94
|
+
} from "./chunk-GLZLBHFC.js";
|
|
94
95
|
import {
|
|
95
96
|
useCancelOrder,
|
|
96
|
-
useCancelOrderFulfillment,
|
|
97
97
|
useCancelOrderTransfer,
|
|
98
|
-
useMarkOrderFulfillmentAsDelivered,
|
|
99
98
|
useOrder,
|
|
100
99
|
useOrderChanges,
|
|
100
|
+
useOrderCommissionLines,
|
|
101
101
|
useOrderLineItems,
|
|
102
102
|
useOrderPreview
|
|
103
|
-
} from "./chunk-
|
|
104
|
-
import {
|
|
105
|
-
useReservationItems
|
|
106
|
-
} from "./chunk-P5XVG4PY.js";
|
|
103
|
+
} from "./chunk-WF3ZDT5Z.js";
|
|
107
104
|
import {
|
|
108
105
|
useOrderGroupByOrderId
|
|
109
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-PYF5EER5.js";
|
|
110
107
|
import {
|
|
111
108
|
useCustomer
|
|
112
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-RGS5ZOY7.js";
|
|
113
110
|
import {
|
|
114
111
|
ActionMenu
|
|
115
112
|
} from "./chunk-BDGZ4EQO.js";
|
|
@@ -1386,33 +1383,80 @@ var OrderActivitySection = ({ order }) => {
|
|
|
1386
1383
|
] });
|
|
1387
1384
|
};
|
|
1388
1385
|
|
|
1386
|
+
// src/pages/orders/order-detail/components/order-commission-section/order-commission-section.tsx
|
|
1387
|
+
import { Container as Container6, Heading as Heading6, Text as Text7 } from "@medusajs/ui";
|
|
1388
|
+
import { useMemo as useMemo3 } from "react";
|
|
1389
|
+
import { useTranslation as useTranslation9 } from "react-i18next";
|
|
1390
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1391
|
+
var OrderCommissionSection = ({
|
|
1392
|
+
order
|
|
1393
|
+
}) => {
|
|
1394
|
+
const { t } = useTranslation9();
|
|
1395
|
+
const { commission_lines, isLoading } = useOrderCommissionLines(order.id);
|
|
1396
|
+
const itemTitleById = useMemo3(() => {
|
|
1397
|
+
const map = /* @__PURE__ */ new Map();
|
|
1398
|
+
order.items?.forEach((item) => {
|
|
1399
|
+
map.set(item.id, item.product_title ?? item.title);
|
|
1400
|
+
});
|
|
1401
|
+
return map;
|
|
1402
|
+
}, [order.items]);
|
|
1403
|
+
if (isLoading || !commission_lines.length) {
|
|
1404
|
+
return null;
|
|
1405
|
+
}
|
|
1406
|
+
const total = commission_lines.reduce(
|
|
1407
|
+
(acc, line) => acc + (line.amount ?? 0),
|
|
1408
|
+
0
|
|
1409
|
+
);
|
|
1410
|
+
return /* @__PURE__ */ jsxs9(Container6, { className: "divide-y p-0", "data-testid": "order-commission-section", children: [
|
|
1411
|
+
/* @__PURE__ */ jsx9("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx9(Heading6, { level: "h2", children: t("fields.commission") }) }),
|
|
1412
|
+
/* @__PURE__ */ jsx9("div", { className: "divide-y", children: commission_lines.map((line) => {
|
|
1413
|
+
const label = line.shipping_method_id ? t("fields.shipping") : itemTitleById.get(line.item_id ?? "") ?? line.code;
|
|
1414
|
+
return /* @__PURE__ */ jsxs9(
|
|
1415
|
+
"div",
|
|
1416
|
+
{
|
|
1417
|
+
className: "text-ui-fg-subtle grid grid-cols-2 items-center gap-4 px-6 py-4",
|
|
1418
|
+
children: [
|
|
1419
|
+
/* @__PURE__ */ jsx9(Text7, { size: "small", leading: "compact", children: label }),
|
|
1420
|
+
/* @__PURE__ */ jsx9(Text7, { size: "small", leading: "compact", className: "text-right", children: getLocaleAmount(line.amount, order.currency_code) })
|
|
1421
|
+
]
|
|
1422
|
+
},
|
|
1423
|
+
line.id
|
|
1424
|
+
);
|
|
1425
|
+
}) }),
|
|
1426
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1427
|
+
/* @__PURE__ */ jsx9(Text7, { size: "small", weight: "plus", leading: "compact", children: t("orders.commission.total") }),
|
|
1428
|
+
/* @__PURE__ */ jsx9(Text7, { size: "small", weight: "plus", leading: "compact", children: getLocaleAmount(total, order.currency_code) })
|
|
1429
|
+
] })
|
|
1430
|
+
] });
|
|
1431
|
+
};
|
|
1432
|
+
|
|
1389
1433
|
// src/pages/orders/order-detail/components/order-customer-section/order-customer-section.tsx
|
|
1390
1434
|
import { ArrowPath as ArrowPath2, CurrencyDollar, Envelope, FlyingBox } from "@medusajs/icons";
|
|
1391
|
-
import { Container as
|
|
1392
|
-
import { useTranslation as
|
|
1435
|
+
import { Container as Container7, Heading as Heading7 } from "@medusajs/ui";
|
|
1436
|
+
import { useTranslation as useTranslation11 } from "react-i18next";
|
|
1393
1437
|
|
|
1394
1438
|
// src/components/common/customer-info/customer-info.tsx
|
|
1395
|
-
import { Avatar, Copy as Copy2, Text as
|
|
1396
|
-
import { useTranslation as
|
|
1439
|
+
import { Avatar, Copy as Copy2, Text as Text8 } from "@medusajs/ui";
|
|
1440
|
+
import { useTranslation as useTranslation10 } from "react-i18next";
|
|
1397
1441
|
import { Link } from "react-router-dom";
|
|
1398
|
-
import { jsx as
|
|
1442
|
+
import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1399
1443
|
var ID = ({ data }) => {
|
|
1400
|
-
const { t } =
|
|
1444
|
+
const { t } = useTranslation10();
|
|
1401
1445
|
const id = data.customer_id;
|
|
1402
1446
|
const name = getOrderCustomer(data);
|
|
1403
1447
|
const email = data.email;
|
|
1404
1448
|
const fallback = (name || email || "").charAt(0).toUpperCase();
|
|
1405
|
-
return /* @__PURE__ */
|
|
1406
|
-
/* @__PURE__ */
|
|
1407
|
-
/* @__PURE__ */
|
|
1449
|
+
return /* @__PURE__ */ jsxs10("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1450
|
+
/* @__PURE__ */ jsx10(Text8, { size: "small", leading: "compact", weight: "plus", children: t("fields.id") }),
|
|
1451
|
+
/* @__PURE__ */ jsx10(
|
|
1408
1452
|
Link,
|
|
1409
1453
|
{
|
|
1410
1454
|
to: `/customers/${id}`,
|
|
1411
1455
|
className: "focus:shadow-borders-focus rounded-[4px] outline-none transition-shadow",
|
|
1412
|
-
children: /* @__PURE__ */
|
|
1413
|
-
/* @__PURE__ */
|
|
1414
|
-
/* @__PURE__ */
|
|
1415
|
-
|
|
1456
|
+
children: /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-x-2 overflow-hidden", children: [
|
|
1457
|
+
/* @__PURE__ */ jsx10(Avatar, { size: "2xsmall", fallback }),
|
|
1458
|
+
/* @__PURE__ */ jsx10(
|
|
1459
|
+
Text8,
|
|
1416
1460
|
{
|
|
1417
1461
|
size: "small",
|
|
1418
1462
|
leading: "compact",
|
|
@@ -1426,26 +1470,26 @@ var ID = ({ data }) => {
|
|
|
1426
1470
|
] });
|
|
1427
1471
|
};
|
|
1428
1472
|
var Company = ({ data }) => {
|
|
1429
|
-
const { t } =
|
|
1473
|
+
const { t } = useTranslation10();
|
|
1430
1474
|
const company = data.shipping_address?.company || data.billing_address?.company;
|
|
1431
1475
|
if (!company) {
|
|
1432
1476
|
return null;
|
|
1433
1477
|
}
|
|
1434
|
-
return /* @__PURE__ */
|
|
1435
|
-
/* @__PURE__ */
|
|
1436
|
-
/* @__PURE__ */
|
|
1478
|
+
return /* @__PURE__ */ jsxs10("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1479
|
+
/* @__PURE__ */ jsx10(Text8, { size: "small", leading: "compact", weight: "plus", children: t("fields.company") }),
|
|
1480
|
+
/* @__PURE__ */ jsx10(Text8, { size: "small", leading: "compact", className: "truncate", children: company })
|
|
1437
1481
|
] });
|
|
1438
1482
|
};
|
|
1439
1483
|
var Contact = ({ data }) => {
|
|
1440
|
-
const { t } =
|
|
1484
|
+
const { t } = useTranslation10();
|
|
1441
1485
|
const phone = data.shipping_address?.phone || data.billing_address?.phone;
|
|
1442
1486
|
const email = data.email || "";
|
|
1443
|
-
return /* @__PURE__ */
|
|
1444
|
-
/* @__PURE__ */
|
|
1445
|
-
/* @__PURE__ */
|
|
1446
|
-
/* @__PURE__ */
|
|
1447
|
-
/* @__PURE__ */
|
|
1448
|
-
|
|
1487
|
+
return /* @__PURE__ */ jsxs10("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1488
|
+
/* @__PURE__ */ jsx10(Text8, { size: "small", leading: "compact", weight: "plus", children: t("orders.customer.contactLabel") }),
|
|
1489
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-y-2", children: [
|
|
1490
|
+
/* @__PURE__ */ jsxs10("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
1491
|
+
/* @__PURE__ */ jsx10(
|
|
1492
|
+
Text8,
|
|
1449
1493
|
{
|
|
1450
1494
|
size: "small",
|
|
1451
1495
|
leading: "compact",
|
|
@@ -1453,11 +1497,11 @@ var Contact = ({ data }) => {
|
|
|
1453
1497
|
children: email
|
|
1454
1498
|
}
|
|
1455
1499
|
),
|
|
1456
|
-
/* @__PURE__ */
|
|
1500
|
+
/* @__PURE__ */ jsx10("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx10(Copy2, { content: email, className: "text-ui-fg-muted" }) })
|
|
1457
1501
|
] }),
|
|
1458
|
-
phone && /* @__PURE__ */
|
|
1459
|
-
/* @__PURE__ */
|
|
1460
|
-
|
|
1502
|
+
phone && /* @__PURE__ */ jsxs10("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
1503
|
+
/* @__PURE__ */ jsx10(
|
|
1504
|
+
Text8,
|
|
1461
1505
|
{
|
|
1462
1506
|
size: "small",
|
|
1463
1507
|
leading: "compact",
|
|
@@ -1465,7 +1509,7 @@ var Contact = ({ data }) => {
|
|
|
1465
1509
|
children: phone
|
|
1466
1510
|
}
|
|
1467
1511
|
),
|
|
1468
|
-
/* @__PURE__ */
|
|
1512
|
+
/* @__PURE__ */ jsx10("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx10(Copy2, { content: phone, className: "text-ui-fg-muted" }) })
|
|
1469
1513
|
] })
|
|
1470
1514
|
] })
|
|
1471
1515
|
] });
|
|
@@ -1474,33 +1518,33 @@ var AddressPrint = ({
|
|
|
1474
1518
|
address,
|
|
1475
1519
|
type
|
|
1476
1520
|
}) => {
|
|
1477
|
-
const { t } =
|
|
1478
|
-
return /* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
address ? /* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1482
|
-
return /* @__PURE__ */
|
|
1521
|
+
const { t } = useTranslation10();
|
|
1522
|
+
return /* @__PURE__ */ jsxs10("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1523
|
+
/* @__PURE__ */ jsx10(Text8, { size: "small", leading: "compact", weight: "plus", children: type === "shipping" ? t("addresses.shippingAddress.label") : t("addresses.billingAddress.label") }),
|
|
1524
|
+
address ? /* @__PURE__ */ jsxs10("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
1525
|
+
/* @__PURE__ */ jsx10(Text8, { size: "small", leading: "compact", children: getFormattedAddress({ address }).map((line, i) => {
|
|
1526
|
+
return /* @__PURE__ */ jsxs10("span", { className: "break-words", children: [
|
|
1483
1527
|
line,
|
|
1484
|
-
/* @__PURE__ */
|
|
1528
|
+
/* @__PURE__ */ jsx10("br", {})
|
|
1485
1529
|
] }, i);
|
|
1486
1530
|
}) }),
|
|
1487
|
-
/* @__PURE__ */
|
|
1531
|
+
/* @__PURE__ */ jsx10("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx10(
|
|
1488
1532
|
Copy2,
|
|
1489
1533
|
{
|
|
1490
1534
|
content: getFormattedAddress({ address }).join("\n"),
|
|
1491
1535
|
className: "text-ui-fg-muted"
|
|
1492
1536
|
}
|
|
1493
1537
|
) })
|
|
1494
|
-
] }) : /* @__PURE__ */
|
|
1538
|
+
] }) : /* @__PURE__ */ jsx10(Text8, { size: "small", leading: "compact", children: "-" })
|
|
1495
1539
|
] });
|
|
1496
1540
|
};
|
|
1497
1541
|
var Addresses = ({ data }) => {
|
|
1498
|
-
const { t } =
|
|
1499
|
-
return /* @__PURE__ */
|
|
1500
|
-
/* @__PURE__ */
|
|
1501
|
-
!isSameAddress(data.shipping_address, data.billing_address) ? /* @__PURE__ */
|
|
1502
|
-
/* @__PURE__ */
|
|
1503
|
-
|
|
1542
|
+
const { t } = useTranslation10();
|
|
1543
|
+
return /* @__PURE__ */ jsxs10("div", { className: "divide-y", children: [
|
|
1544
|
+
/* @__PURE__ */ jsx10(AddressPrint, { address: data.shipping_address, type: "shipping" }),
|
|
1545
|
+
!isSameAddress(data.shipping_address, data.billing_address) ? /* @__PURE__ */ jsx10(AddressPrint, { address: data.billing_address, type: "billing" }) : /* @__PURE__ */ jsxs10("div", { className: "grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1546
|
+
/* @__PURE__ */ jsx10(
|
|
1547
|
+
Text8,
|
|
1504
1548
|
{
|
|
1505
1549
|
size: "small",
|
|
1506
1550
|
leading: "compact",
|
|
@@ -1509,7 +1553,7 @@ var Addresses = ({ data }) => {
|
|
|
1509
1553
|
children: t("addresses.billingAddress.label")
|
|
1510
1554
|
}
|
|
1511
1555
|
),
|
|
1512
|
-
/* @__PURE__ */
|
|
1556
|
+
/* @__PURE__ */ jsx10(Text8, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: t("addresses.billingAddress.sameAsShipping") })
|
|
1513
1557
|
] })
|
|
1514
1558
|
] });
|
|
1515
1559
|
};
|
|
@@ -1534,40 +1578,40 @@ var getOrderCustomer = (obj) => {
|
|
|
1534
1578
|
};
|
|
1535
1579
|
|
|
1536
1580
|
// src/pages/orders/order-detail/components/order-customer-section/order-customer-section.tsx
|
|
1537
|
-
import { jsx as
|
|
1581
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1538
1582
|
var OrderCustomerSection = ({ order }) => {
|
|
1539
|
-
return /* @__PURE__ */
|
|
1540
|
-
|
|
1583
|
+
return /* @__PURE__ */ jsxs11(
|
|
1584
|
+
Container7,
|
|
1541
1585
|
{
|
|
1542
1586
|
className: "divide-y p-0",
|
|
1543
1587
|
"data-testid": "order-customer-section",
|
|
1544
1588
|
children: [
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
/* @__PURE__ */
|
|
1547
|
-
/* @__PURE__ */
|
|
1548
|
-
/* @__PURE__ */
|
|
1549
|
-
/* @__PURE__ */
|
|
1589
|
+
/* @__PURE__ */ jsx11(Header, { order }),
|
|
1590
|
+
/* @__PURE__ */ jsx11(CustomerInfo.ID, { data: order }),
|
|
1591
|
+
/* @__PURE__ */ jsx11(CustomerInfo.Contact, { data: order }),
|
|
1592
|
+
/* @__PURE__ */ jsx11(CustomerInfo.Company, { data: order }),
|
|
1593
|
+
/* @__PURE__ */ jsx11(CustomerInfo.Addresses, { data: order })
|
|
1550
1594
|
]
|
|
1551
1595
|
}
|
|
1552
1596
|
);
|
|
1553
1597
|
};
|
|
1554
1598
|
var Header = ({ order }) => {
|
|
1555
|
-
const { t } =
|
|
1556
|
-
return /* @__PURE__ */
|
|
1599
|
+
const { t } = useTranslation11();
|
|
1600
|
+
return /* @__PURE__ */ jsxs11(
|
|
1557
1601
|
"div",
|
|
1558
1602
|
{
|
|
1559
1603
|
className: "flex items-center justify-between px-6 py-4",
|
|
1560
1604
|
"data-testid": "order-customer-header",
|
|
1561
1605
|
children: [
|
|
1562
|
-
/* @__PURE__ */
|
|
1563
|
-
|
|
1606
|
+
/* @__PURE__ */ jsx11(
|
|
1607
|
+
Heading7,
|
|
1564
1608
|
{
|
|
1565
1609
|
level: "h2",
|
|
1566
1610
|
"data-testid": "order-customer-heading",
|
|
1567
1611
|
children: t("fields.customer")
|
|
1568
1612
|
}
|
|
1569
1613
|
),
|
|
1570
|
-
/* @__PURE__ */
|
|
1614
|
+
/* @__PURE__ */ jsx11(
|
|
1571
1615
|
ActionMenu,
|
|
1572
1616
|
{
|
|
1573
1617
|
groups: [
|
|
@@ -1576,7 +1620,7 @@ var Header = ({ order }) => {
|
|
|
1576
1620
|
{
|
|
1577
1621
|
label: t("transferOwnership.label"),
|
|
1578
1622
|
to: `transfer`,
|
|
1579
|
-
icon: /* @__PURE__ */
|
|
1623
|
+
icon: /* @__PURE__ */ jsx11(ArrowPath2, {})
|
|
1580
1624
|
}
|
|
1581
1625
|
]
|
|
1582
1626
|
},
|
|
@@ -1585,12 +1629,12 @@ var Header = ({ order }) => {
|
|
|
1585
1629
|
{
|
|
1586
1630
|
label: t("addresses.shippingAddress.editLabel"),
|
|
1587
1631
|
to: "shipping-address",
|
|
1588
|
-
icon: /* @__PURE__ */
|
|
1632
|
+
icon: /* @__PURE__ */ jsx11(FlyingBox, {})
|
|
1589
1633
|
},
|
|
1590
1634
|
{
|
|
1591
1635
|
label: t("addresses.billingAddress.editLabel"),
|
|
1592
1636
|
to: "billing-address",
|
|
1593
|
-
icon: /* @__PURE__ */
|
|
1637
|
+
icon: /* @__PURE__ */ jsx11(CurrencyDollar, {})
|
|
1594
1638
|
}
|
|
1595
1639
|
]
|
|
1596
1640
|
},
|
|
@@ -1599,7 +1643,7 @@ var Header = ({ order }) => {
|
|
|
1599
1643
|
{
|
|
1600
1644
|
label: t("email.editLabel"),
|
|
1601
1645
|
to: `email`,
|
|
1602
|
-
icon: /* @__PURE__ */
|
|
1646
|
+
icon: /* @__PURE__ */ jsx11(Envelope, {}),
|
|
1603
1647
|
disabled: order.status === "canceled"
|
|
1604
1648
|
}
|
|
1605
1649
|
]
|
|
@@ -1614,45 +1658,41 @@ var Header = ({ order }) => {
|
|
|
1614
1658
|
};
|
|
1615
1659
|
|
|
1616
1660
|
// src/pages/orders/order-detail/components/order-fulfillment-section/order-fulfillment-section.tsx
|
|
1617
|
-
import { Buildings, XCircle } from "@medusajs/icons";
|
|
1618
1661
|
import {
|
|
1619
|
-
|
|
1620
|
-
Container as Container7,
|
|
1662
|
+
Container as Container8,
|
|
1621
1663
|
Copy as Copy3,
|
|
1622
|
-
Heading as
|
|
1664
|
+
Heading as Heading8,
|
|
1623
1665
|
StatusBadge,
|
|
1624
|
-
Text as
|
|
1625
|
-
Tooltip as Tooltip2
|
|
1626
|
-
toast as toast6,
|
|
1627
|
-
usePrompt as usePrompt2
|
|
1666
|
+
Text as Text9,
|
|
1667
|
+
Tooltip as Tooltip2
|
|
1628
1668
|
} from "@medusajs/ui";
|
|
1629
1669
|
import { format } from "date-fns";
|
|
1630
|
-
import { useTranslation as
|
|
1631
|
-
import { Link as Link2
|
|
1632
|
-
import { Fragment as Fragment2, jsx as
|
|
1670
|
+
import { useTranslation as useTranslation12 } from "react-i18next";
|
|
1671
|
+
import { Link as Link2 } from "react-router-dom";
|
|
1672
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1633
1673
|
var OrderFulfillmentSection = ({
|
|
1634
1674
|
order
|
|
1635
1675
|
}) => {
|
|
1636
1676
|
const fulfillments = order.fulfillments || [];
|
|
1637
|
-
return /* @__PURE__ */
|
|
1638
|
-
/* @__PURE__ */
|
|
1639
|
-
fulfillments.map((f, index) => /* @__PURE__ */
|
|
1677
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-y-3", "data-testid": "order-fulfillment-section", children: [
|
|
1678
|
+
/* @__PURE__ */ jsx12(UnfulfilledItemBreakdown, { order }),
|
|
1679
|
+
fulfillments.map((f, index) => /* @__PURE__ */ jsx12(Fulfillment, { index, fulfillment: f, order }, f.id))
|
|
1640
1680
|
] });
|
|
1641
1681
|
};
|
|
1642
1682
|
var UnfulfilledItem = ({
|
|
1643
1683
|
item,
|
|
1644
1684
|
currencyCode
|
|
1645
1685
|
}) => {
|
|
1646
|
-
return /* @__PURE__ */
|
|
1686
|
+
return /* @__PURE__ */ jsxs12(
|
|
1647
1687
|
"div",
|
|
1648
1688
|
{
|
|
1649
1689
|
className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4",
|
|
1650
1690
|
children: [
|
|
1651
|
-
/* @__PURE__ */
|
|
1652
|
-
/* @__PURE__ */
|
|
1653
|
-
/* @__PURE__ */
|
|
1654
|
-
/* @__PURE__ */
|
|
1655
|
-
|
|
1691
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-start gap-x-4", children: [
|
|
1692
|
+
/* @__PURE__ */ jsx12(Thumbnail, { src: item.thumbnail }),
|
|
1693
|
+
/* @__PURE__ */ jsxs12("div", { children: [
|
|
1694
|
+
/* @__PURE__ */ jsx12(
|
|
1695
|
+
Text9,
|
|
1656
1696
|
{
|
|
1657
1697
|
size: "small",
|
|
1658
1698
|
leading: "compact",
|
|
@@ -1661,20 +1701,20 @@ var UnfulfilledItem = ({
|
|
|
1661
1701
|
children: item.title
|
|
1662
1702
|
}
|
|
1663
1703
|
),
|
|
1664
|
-
item.variant_sku && /* @__PURE__ */
|
|
1665
|
-
/* @__PURE__ */
|
|
1666
|
-
/* @__PURE__ */
|
|
1704
|
+
item.variant_sku && /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-x-1", children: [
|
|
1705
|
+
/* @__PURE__ */ jsx12(Text9, { size: "small", children: item.variant_sku }),
|
|
1706
|
+
/* @__PURE__ */ jsx12(Copy3, { content: item.variant_sku, className: "text-ui-fg-muted" })
|
|
1667
1707
|
] }),
|
|
1668
|
-
/* @__PURE__ */
|
|
1708
|
+
/* @__PURE__ */ jsx12(Text9, { size: "small", children: item.variant?.options?.map((o) => o.value).join(" \xB7 ") })
|
|
1669
1709
|
] })
|
|
1670
1710
|
] }),
|
|
1671
|
-
/* @__PURE__ */
|
|
1672
|
-
/* @__PURE__ */
|
|
1673
|
-
/* @__PURE__ */
|
|
1674
|
-
/* @__PURE__ */
|
|
1711
|
+
/* @__PURE__ */ jsxs12("div", { className: "grid grid-cols-3 items-center gap-x-4", children: [
|
|
1712
|
+
/* @__PURE__ */ jsx12("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx12(Text9, { size: "small", children: getLocaleAmount(item.unit_price, currencyCode) }) }),
|
|
1713
|
+
/* @__PURE__ */ jsx12("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsxs12(Text9, { children: [
|
|
1714
|
+
/* @__PURE__ */ jsx12("span", { className: "tabular-nums", children: item.quantity - item.detail.fulfilled_quantity }),
|
|
1675
1715
|
"x"
|
|
1676
1716
|
] }) }),
|
|
1677
|
-
/* @__PURE__ */
|
|
1717
|
+
/* @__PURE__ */ jsx12("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx12(Text9, { size: "small", children: getLocaleAmount(item.subtotal || 0, currencyCode) }) })
|
|
1678
1718
|
] })
|
|
1679
1719
|
]
|
|
1680
1720
|
},
|
|
@@ -1688,8 +1728,8 @@ var UnfulfilledItemBreakdown = ({ order }) => {
|
|
|
1688
1728
|
const unfulfilledItemsWithoutShipping = order.items.filter(
|
|
1689
1729
|
(i) => !i.requires_shipping && i.detail.fulfilled_quantity < i.quantity
|
|
1690
1730
|
);
|
|
1691
|
-
return /* @__PURE__ */
|
|
1692
|
-
!!unfulfilledItemsWithShipping.length && /* @__PURE__ */
|
|
1731
|
+
return /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
1732
|
+
!!unfulfilledItemsWithShipping.length && /* @__PURE__ */ jsx12(
|
|
1693
1733
|
UnfulfilledItemDisplay,
|
|
1694
1734
|
{
|
|
1695
1735
|
order,
|
|
@@ -1697,7 +1737,7 @@ var UnfulfilledItemBreakdown = ({ order }) => {
|
|
|
1697
1737
|
requiresShipping: true
|
|
1698
1738
|
}
|
|
1699
1739
|
),
|
|
1700
|
-
!!unfulfilledItemsWithoutShipping.length && /* @__PURE__ */
|
|
1740
|
+
!!unfulfilledItemsWithoutShipping.length && /* @__PURE__ */ jsx12(
|
|
1701
1741
|
UnfulfilledItemDisplay,
|
|
1702
1742
|
{
|
|
1703
1743
|
order,
|
|
@@ -1712,36 +1752,19 @@ var UnfulfilledItemDisplay = ({
|
|
|
1712
1752
|
unfulfilledItems,
|
|
1713
1753
|
requiresShipping = false
|
|
1714
1754
|
}) => {
|
|
1715
|
-
const { t } =
|
|
1755
|
+
const { t } = useTranslation12();
|
|
1716
1756
|
if (order.status === "canceled") {
|
|
1717
1757
|
return;
|
|
1718
1758
|
}
|
|
1719
|
-
return /* @__PURE__ */
|
|
1720
|
-
/* @__PURE__ */
|
|
1721
|
-
/* @__PURE__ */
|
|
1722
|
-
/* @__PURE__ */
|
|
1723
|
-
requiresShipping && /* @__PURE__ */
|
|
1724
|
-
/* @__PURE__ */
|
|
1725
|
-
/* @__PURE__ */ jsx11(
|
|
1726
|
-
ActionMenu,
|
|
1727
|
-
{
|
|
1728
|
-
groups: [
|
|
1729
|
-
{
|
|
1730
|
-
actions: [
|
|
1731
|
-
{
|
|
1732
|
-
label: t("orders.fulfillment.fulfillItems"),
|
|
1733
|
-
icon: /* @__PURE__ */ jsx11(Buildings, {}),
|
|
1734
|
-
to: `/orders/${order.id}/fulfillment?requires_shipping=${requiresShipping}`
|
|
1735
|
-
}
|
|
1736
|
-
]
|
|
1737
|
-
}
|
|
1738
|
-
],
|
|
1739
|
-
"data-testid": "order-fulfillment-unfulfilled-action-menu"
|
|
1740
|
-
}
|
|
1741
|
-
)
|
|
1759
|
+
return /* @__PURE__ */ jsxs12(Container8, { className: "divide-y p-0", "data-testid": "order-fulfillment-unfulfilled", children: [
|
|
1760
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between px-6 py-4", "data-testid": "order-fulfillment-unfulfilled-header", children: [
|
|
1761
|
+
/* @__PURE__ */ jsx12(Heading8, { level: "h2", "data-testid": "order-fulfillment-unfulfilled-heading", children: t("orders.fulfillment.unfulfilledItems") }),
|
|
1762
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-x-4", "data-testid": "order-fulfillment-unfulfilled-badges", children: [
|
|
1763
|
+
requiresShipping && /* @__PURE__ */ jsx12(StatusBadge, { color: "red", className: "text-nowrap", "data-testid": "order-fulfillment-unfulfilled-requires-shipping-badge", children: t("orders.fulfillment.requiresShipping") }),
|
|
1764
|
+
/* @__PURE__ */ jsx12(StatusBadge, { color: "red", className: "text-nowrap", "data-testid": "order-fulfillment-unfulfilled-awaiting-badge", children: t("orders.fulfillment.awaitingFulfillmentBadge") })
|
|
1742
1765
|
] })
|
|
1743
1766
|
] }),
|
|
1744
|
-
/* @__PURE__ */
|
|
1767
|
+
/* @__PURE__ */ jsx12("div", { "data-testid": "order-fulfillment-unfulfilled-items", children: unfulfilledItems.map((item) => /* @__PURE__ */ jsx12(
|
|
1745
1768
|
UnfulfilledItem,
|
|
1746
1769
|
{
|
|
1747
1770
|
item,
|
|
@@ -1753,12 +1776,9 @@ var UnfulfilledItemDisplay = ({
|
|
|
1753
1776
|
};
|
|
1754
1777
|
var Fulfillment = ({
|
|
1755
1778
|
fulfillment,
|
|
1756
|
-
order,
|
|
1757
1779
|
index
|
|
1758
1780
|
}) => {
|
|
1759
|
-
const { t } =
|
|
1760
|
-
const prompt = usePrompt2();
|
|
1761
|
-
const navigate = useNavigate5();
|
|
1781
|
+
const { t } = useTranslation12();
|
|
1762
1782
|
const showLocation = !!fulfillment.location_id;
|
|
1763
1783
|
const isPickUpFulfillment = fulfillment.shipping_option?.service_zone.fulfillment_set.type === "pickup" /* Pickup */;
|
|
1764
1784
|
const { stock_location, isError, error } = useStockLocation(
|
|
@@ -1784,195 +1804,109 @@ var Fulfillment = ({
|
|
|
1784
1804
|
statusColor = "green";
|
|
1785
1805
|
statusTimestamp = fulfillment.shipped_at;
|
|
1786
1806
|
}
|
|
1787
|
-
const { mutateAsync } = useCancelOrderFulfillment(order.id, fulfillment.id);
|
|
1788
|
-
const { mutateAsync: markAsDelivered } = useMarkOrderFulfillmentAsDelivered(
|
|
1789
|
-
order.id,
|
|
1790
|
-
fulfillment.id
|
|
1791
|
-
);
|
|
1792
|
-
const showShippingButton = !fulfillment.canceled_at && !fulfillment.shipped_at && !fulfillment.delivered_at && fulfillment.requires_shipping && !isPickUpFulfillment;
|
|
1793
|
-
const showDeliveryButton = !fulfillment.canceled_at && !fulfillment.delivered_at;
|
|
1794
|
-
const handleMarkAsDelivered = async () => {
|
|
1795
|
-
const res = await prompt({
|
|
1796
|
-
title: t("general.areYouSure"),
|
|
1797
|
-
description: t("orders.fulfillment.markAsDeliveredWarning"),
|
|
1798
|
-
confirmText: t("actions.continue"),
|
|
1799
|
-
cancelText: t("actions.cancel"),
|
|
1800
|
-
variant: "confirmation"
|
|
1801
|
-
});
|
|
1802
|
-
if (res) {
|
|
1803
|
-
await markAsDelivered(void 0, {
|
|
1804
|
-
onSuccess: () => {
|
|
1805
|
-
toast6.success(
|
|
1806
|
-
t(
|
|
1807
|
-
isPickUpFulfillment ? "orders.fulfillment.toast.fulfillmentPickedUp" : "orders.fulfillment.toast.fulfillmentDelivered"
|
|
1808
|
-
)
|
|
1809
|
-
);
|
|
1810
|
-
},
|
|
1811
|
-
onError: (e) => {
|
|
1812
|
-
toast6.error(e.message);
|
|
1813
|
-
}
|
|
1814
|
-
});
|
|
1815
|
-
}
|
|
1816
|
-
};
|
|
1817
|
-
const handleCancel = async () => {
|
|
1818
|
-
if (fulfillment.shipped_at) {
|
|
1819
|
-
toast6.warning(t("orders.fulfillment.toast.fulfillmentShipped"));
|
|
1820
|
-
return;
|
|
1821
|
-
}
|
|
1822
|
-
const res = await prompt({
|
|
1823
|
-
title: t("general.areYouSure"),
|
|
1824
|
-
description: t("orders.fulfillment.cancelWarning"),
|
|
1825
|
-
confirmText: t("actions.continue"),
|
|
1826
|
-
cancelText: t("actions.cancel")
|
|
1827
|
-
});
|
|
1828
|
-
if (res) {
|
|
1829
|
-
await mutateAsync(void 0, {
|
|
1830
|
-
onSuccess: () => {
|
|
1831
|
-
toast6.success(t("orders.fulfillment.toast.canceled"));
|
|
1832
|
-
},
|
|
1833
|
-
onError: (e) => {
|
|
1834
|
-
toast6.error(e.message);
|
|
1835
|
-
}
|
|
1836
|
-
});
|
|
1837
|
-
}
|
|
1838
|
-
};
|
|
1839
1807
|
if (isError) {
|
|
1840
1808
|
throw error;
|
|
1841
1809
|
}
|
|
1842
1810
|
const isValidUrl = (url) => url && url.length > 0 && url !== "#";
|
|
1843
|
-
return /* @__PURE__ */
|
|
1844
|
-
/* @__PURE__ */
|
|
1845
|
-
/* @__PURE__ */
|
|
1811
|
+
return /* @__PURE__ */ jsxs12(Container8, { className: "divide-y p-0", "data-testid": `order-fulfillment-${fulfillment.id}`, children: [
|
|
1812
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between px-6 py-4", "data-testid": `order-fulfillment-${fulfillment.id}-header`, children: [
|
|
1813
|
+
/* @__PURE__ */ jsx12(Heading8, { level: "h2", "data-testid": `order-fulfillment-${fulfillment.id}-heading`, children: t("orders.fulfillment.number", {
|
|
1846
1814
|
number: index + 1
|
|
1847
1815
|
}) }),
|
|
1848
|
-
/* @__PURE__ */
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
),
|
|
1859
|
-
/* @__PURE__ */ jsx11(
|
|
1860
|
-
ActionMenu,
|
|
1861
|
-
{
|
|
1862
|
-
groups: [
|
|
1863
|
-
{
|
|
1864
|
-
actions: [
|
|
1865
|
-
{
|
|
1866
|
-
label: t("actions.cancel"),
|
|
1867
|
-
icon: /* @__PURE__ */ jsx11(XCircle, {}),
|
|
1868
|
-
onClick: handleCancel,
|
|
1869
|
-
disabled: !!fulfillment.canceled_at || !!fulfillment.shipped_at || !!fulfillment.delivered_at
|
|
1870
|
-
}
|
|
1871
|
-
]
|
|
1872
|
-
}
|
|
1873
|
-
],
|
|
1874
|
-
"data-testid": `order-fulfillment-${fulfillment.id}-action-menu`
|
|
1875
|
-
}
|
|
1876
|
-
)
|
|
1877
|
-
] })
|
|
1816
|
+
/* @__PURE__ */ jsx12("div", { className: "flex items-center gap-x-4", "data-testid": `order-fulfillment-${fulfillment.id}-status-container`, children: /* @__PURE__ */ jsx12(
|
|
1817
|
+
Tooltip2,
|
|
1818
|
+
{
|
|
1819
|
+
content: format(
|
|
1820
|
+
new Date(statusTimestamp),
|
|
1821
|
+
"dd MMM, yyyy, HH:mm:ss"
|
|
1822
|
+
),
|
|
1823
|
+
children: /* @__PURE__ */ jsx12(StatusBadge, { color: statusColor, className: "text-nowrap", "data-testid": `order-fulfillment-${fulfillment.id}-status-badge`, children: statusText })
|
|
1824
|
+
}
|
|
1825
|
+
) })
|
|
1878
1826
|
] }),
|
|
1879
|
-
/* @__PURE__ */
|
|
1880
|
-
/* @__PURE__ */
|
|
1881
|
-
/* @__PURE__ */
|
|
1827
|
+
/* @__PURE__ */ jsxs12("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1828
|
+
/* @__PURE__ */ jsx12(Text9, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.itemsLabel") }),
|
|
1829
|
+
/* @__PURE__ */ jsx12("ul", { children: fulfillment.items.map((f_item) => /* @__PURE__ */ jsx12("li", { children: /* @__PURE__ */ jsxs12(Text9, { size: "small", leading: "compact", children: [
|
|
1882
1830
|
f_item.quantity,
|
|
1883
1831
|
"x ",
|
|
1884
1832
|
f_item.title
|
|
1885
1833
|
] }) }, f_item.line_item_id)) })
|
|
1886
1834
|
] }),
|
|
1887
|
-
showLocation && /* @__PURE__ */
|
|
1888
|
-
/* @__PURE__ */
|
|
1889
|
-
stock_location ? /* @__PURE__ */
|
|
1835
|
+
showLocation && /* @__PURE__ */ jsxs12("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1836
|
+
/* @__PURE__ */ jsx12(Text9, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.shippingFromLabel") }),
|
|
1837
|
+
stock_location ? /* @__PURE__ */ jsx12(
|
|
1890
1838
|
Link2,
|
|
1891
1839
|
{
|
|
1892
1840
|
to: `/settings/locations/${stock_location.id}`,
|
|
1893
1841
|
className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover transition-fg",
|
|
1894
|
-
children: /* @__PURE__ */
|
|
1842
|
+
children: /* @__PURE__ */ jsx12(Text9, { size: "small", leading: "compact", children: stock_location.name })
|
|
1895
1843
|
}
|
|
1896
|
-
) : /* @__PURE__ */
|
|
1844
|
+
) : /* @__PURE__ */ jsx12(Skeleton, { className: "w-16" })
|
|
1897
1845
|
] }),
|
|
1898
|
-
/* @__PURE__ */
|
|
1899
|
-
/* @__PURE__ */
|
|
1900
|
-
/* @__PURE__ */
|
|
1846
|
+
/* @__PURE__ */ jsxs12("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1847
|
+
/* @__PURE__ */ jsx12(Text9, { size: "small", leading: "compact", weight: "plus", children: t("fields.provider") }),
|
|
1848
|
+
/* @__PURE__ */ jsx12(Text9, { size: "small", leading: "compact", children: formatProvider(fulfillment.provider_id) })
|
|
1901
1849
|
] }),
|
|
1902
|
-
/* @__PURE__ */
|
|
1903
|
-
/* @__PURE__ */
|
|
1904
|
-
/* @__PURE__ */
|
|
1850
|
+
/* @__PURE__ */ jsxs12("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1851
|
+
/* @__PURE__ */ jsx12(Text9, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.trackingLabel") }),
|
|
1852
|
+
/* @__PURE__ */ jsx12("div", { children: fulfillment.labels && fulfillment.labels.length > 0 ? /* @__PURE__ */ jsx12("ul", { children: fulfillment.labels.map((tlink) => {
|
|
1905
1853
|
const hasTrackingUrl = isValidUrl(tlink.tracking_url);
|
|
1906
1854
|
const hasLabelUrl = isValidUrl(tlink.label_url);
|
|
1907
1855
|
if (hasTrackingUrl || hasLabelUrl) {
|
|
1908
|
-
return /* @__PURE__ */
|
|
1909
|
-
hasTrackingUrl && /* @__PURE__ */
|
|
1856
|
+
return /* @__PURE__ */ jsxs12("li", { children: [
|
|
1857
|
+
hasTrackingUrl && /* @__PURE__ */ jsx12(
|
|
1910
1858
|
"a",
|
|
1911
1859
|
{
|
|
1912
1860
|
href: tlink.tracking_url,
|
|
1913
1861
|
target: "_blank",
|
|
1914
1862
|
rel: "noopener noreferrer",
|
|
1915
1863
|
className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover transition-fg",
|
|
1916
|
-
children: /* @__PURE__ */
|
|
1864
|
+
children: /* @__PURE__ */ jsx12(Text9, { size: "small", leading: "compact", as: "span", children: tlink.tracking_number })
|
|
1917
1865
|
}
|
|
1918
1866
|
),
|
|
1919
1867
|
hasTrackingUrl && hasLabelUrl && " - ",
|
|
1920
|
-
hasLabelUrl && /* @__PURE__ */
|
|
1868
|
+
hasLabelUrl && /* @__PURE__ */ jsx12(
|
|
1921
1869
|
"a",
|
|
1922
1870
|
{
|
|
1923
1871
|
href: tlink.label_url,
|
|
1924
1872
|
target: "_blank",
|
|
1925
1873
|
rel: "noopener noreferrer",
|
|
1926
1874
|
className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover transition-fg",
|
|
1927
|
-
children: /* @__PURE__ */
|
|
1875
|
+
children: /* @__PURE__ */ jsx12(Text9, { size: "small", leading: "compact", as: "span", children: t("orders.fulfillment.labelLink") })
|
|
1928
1876
|
}
|
|
1929
1877
|
)
|
|
1930
1878
|
] }, tlink.tracking_number);
|
|
1931
1879
|
}
|
|
1932
|
-
return /* @__PURE__ */
|
|
1933
|
-
}) }) : /* @__PURE__ */
|
|
1934
|
-
] }),
|
|
1935
|
-
(showShippingButton || showDeliveryButton) && /* @__PURE__ */ jsxs11("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", "data-testid": `order-fulfillment-${fulfillment.id}-actions`, children: [
|
|
1936
|
-
showDeliveryButton && /* @__PURE__ */ jsx11(Button6, { onClick: handleMarkAsDelivered, variant: "secondary", "data-testid": `order-fulfillment-${fulfillment.id}-mark-delivered-button`, children: t(
|
|
1937
|
-
isPickUpFulfillment ? "orders.fulfillment.markAsPickedUp" : "orders.fulfillment.markAsDelivered"
|
|
1938
|
-
) }),
|
|
1939
|
-
showShippingButton && /* @__PURE__ */ jsx11(
|
|
1940
|
-
Button6,
|
|
1941
|
-
{
|
|
1942
|
-
onClick: () => navigate(`./${fulfillment.id}/create-shipment`),
|
|
1943
|
-
variant: "secondary",
|
|
1944
|
-
"data-testid": `order-fulfillment-${fulfillment.id}-mark-shipped-button`,
|
|
1945
|
-
children: t("orders.fulfillment.markAsShipped")
|
|
1946
|
-
}
|
|
1947
|
-
)
|
|
1880
|
+
return /* @__PURE__ */ jsx12("li", { children: /* @__PURE__ */ jsx12(Text9, { size: "small", leading: "compact", children: tlink.tracking_number }) }, tlink.tracking_number);
|
|
1881
|
+
}) }) : /* @__PURE__ */ jsx12(Text9, { size: "small", leading: "compact", children: "-" }) })
|
|
1948
1882
|
] })
|
|
1949
1883
|
] });
|
|
1950
1884
|
};
|
|
1951
1885
|
|
|
1952
1886
|
// src/pages/orders/order-detail/components/order-general-section/order-general-section.tsx
|
|
1887
|
+
import { XCircle } from "@medusajs/icons";
|
|
1953
1888
|
import {
|
|
1954
|
-
|
|
1955
|
-
ArrowUturnLeft as ArrowUturnLeft2,
|
|
1956
|
-
ExclamationCircle as ExclamationCircle2,
|
|
1957
|
-
PencilSquare,
|
|
1958
|
-
XCircle as XCircle2
|
|
1959
|
-
} from "@medusajs/icons";
|
|
1960
|
-
import {
|
|
1961
|
-
Container as Container8,
|
|
1889
|
+
Container as Container9,
|
|
1962
1890
|
Copy as Copy4,
|
|
1963
|
-
Heading as
|
|
1891
|
+
Heading as Heading9,
|
|
1964
1892
|
StatusBadge as StatusBadge2,
|
|
1965
|
-
Text as
|
|
1966
|
-
toast as
|
|
1967
|
-
usePrompt as
|
|
1893
|
+
Text as Text10,
|
|
1894
|
+
toast as toast6,
|
|
1895
|
+
usePrompt as usePrompt2
|
|
1968
1896
|
} from "@medusajs/ui";
|
|
1969
|
-
import { useTranslation as
|
|
1970
|
-
import { jsx as
|
|
1897
|
+
import { useTranslation as useTranslation13 } from "react-i18next";
|
|
1898
|
+
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1971
1899
|
var OrderGeneralSection = ({ order }) => {
|
|
1972
|
-
const { t } =
|
|
1973
|
-
const prompt =
|
|
1900
|
+
const { t } = useTranslation13();
|
|
1901
|
+
const prompt = usePrompt2();
|
|
1974
1902
|
const { getFullDate } = useDate();
|
|
1975
1903
|
const { mutateAsync: cancelOrder } = useCancelOrder(order.id);
|
|
1904
|
+
const hasAnyFulfilledItem = order.items?.some(
|
|
1905
|
+
// @ts-ignore — detail.fulfilled_quantity is exposed via Mercur query-config
|
|
1906
|
+
(i) => (i.detail?.fulfilled_quantity ?? 0) > 0
|
|
1907
|
+
);
|
|
1908
|
+
const cancelDisabled = !!order.canceled_at || !!hasAnyFulfilledItem;
|
|
1909
|
+
const cancelDisabledTooltip = order.canceled_at ? void 0 : hasAnyFulfilledItem ? t("orders.actions.cancelDisabledFulfilled") : void 0;
|
|
1976
1910
|
const handleCancel = async () => {
|
|
1977
1911
|
const res = await prompt({
|
|
1978
1912
|
title: t("general.areYouSure"),
|
|
@@ -1987,72 +1921,45 @@ var OrderGeneralSection = ({ order }) => {
|
|
|
1987
1921
|
}
|
|
1988
1922
|
await cancelOrder(void 0, {
|
|
1989
1923
|
onSuccess: () => {
|
|
1990
|
-
|
|
1924
|
+
toast6.success(t("orders.orderCanceled"));
|
|
1991
1925
|
},
|
|
1992
1926
|
onError: (e) => {
|
|
1993
|
-
|
|
1927
|
+
toast6.error(e.message);
|
|
1994
1928
|
}
|
|
1995
1929
|
});
|
|
1996
1930
|
};
|
|
1997
|
-
return /* @__PURE__ */
|
|
1998
|
-
/* @__PURE__ */
|
|
1999
|
-
/* @__PURE__ */
|
|
2000
|
-
/* @__PURE__ */
|
|
1931
|
+
return /* @__PURE__ */ jsxs13(Container9, { className: "flex items-center justify-between px-6 py-4", "data-testid": "order-general-section", children: [
|
|
1932
|
+
/* @__PURE__ */ jsxs13("div", { children: [
|
|
1933
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-x-1", "data-testid": "order-general-section-id-container", children: [
|
|
1934
|
+
/* @__PURE__ */ jsxs13(Heading9, { "data-testid": "order-general-section-id-heading", children: [
|
|
2001
1935
|
"#",
|
|
2002
1936
|
order.display_id
|
|
2003
1937
|
] }),
|
|
2004
|
-
/* @__PURE__ */
|
|
1938
|
+
/* @__PURE__ */ jsx13(Copy4, { content: `#${order.display_id}`, className: "text-ui-fg-muted", "data-testid": "order-general-section-id-copy" })
|
|
2005
1939
|
] }),
|
|
2006
|
-
/* @__PURE__ */
|
|
1940
|
+
/* @__PURE__ */ jsx13(Text10, { size: "small", className: "text-ui-fg-subtle", "data-testid": "order-general-section-date", children: t("orders.onDateFromSalesChannel", {
|
|
2007
1941
|
date: getFullDate({ date: order.created_at, includeTime: true }),
|
|
2008
1942
|
salesChannel: order.sales_channel?.name
|
|
2009
1943
|
}) })
|
|
2010
1944
|
] }),
|
|
2011
|
-
/* @__PURE__ */
|
|
2012
|
-
/* @__PURE__ */
|
|
2013
|
-
/* @__PURE__ */
|
|
2014
|
-
/* @__PURE__ */
|
|
2015
|
-
/* @__PURE__ */
|
|
1945
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-x-4", "data-testid": "order-general-section-badges-container", children: [
|
|
1946
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-x-1.5", "data-testid": "order-general-section-badges", children: [
|
|
1947
|
+
/* @__PURE__ */ jsx13(OrderBadge, { order }),
|
|
1948
|
+
/* @__PURE__ */ jsx13(PaymentBadge, { order }),
|
|
1949
|
+
/* @__PURE__ */ jsx13(FulfillmentBadge, { order })
|
|
2016
1950
|
] }),
|
|
2017
|
-
/* @__PURE__ */
|
|
1951
|
+
/* @__PURE__ */ jsx13(
|
|
2018
1952
|
ActionMenu,
|
|
2019
1953
|
{
|
|
2020
1954
|
groups: [
|
|
2021
|
-
{
|
|
2022
|
-
actions: [
|
|
2023
|
-
{
|
|
2024
|
-
label: t("orders.edits.create"),
|
|
2025
|
-
to: "edits",
|
|
2026
|
-
disabled: order.status === "canceled",
|
|
2027
|
-
icon: /* @__PURE__ */ jsx12(PencilSquare, {})
|
|
2028
|
-
},
|
|
2029
|
-
{
|
|
2030
|
-
label: t("orders.returns.create"),
|
|
2031
|
-
to: "returns",
|
|
2032
|
-
disabled: order.status === "canceled",
|
|
2033
|
-
icon: /* @__PURE__ */ jsx12(ArrowUturnLeft2, {})
|
|
2034
|
-
},
|
|
2035
|
-
{
|
|
2036
|
-
label: t("orders.exchanges.create"),
|
|
2037
|
-
to: "exchanges",
|
|
2038
|
-
disabled: order.status === "canceled",
|
|
2039
|
-
icon: /* @__PURE__ */ jsx12(ArrowPath3, {})
|
|
2040
|
-
},
|
|
2041
|
-
{
|
|
2042
|
-
label: t("orders.claims.create"),
|
|
2043
|
-
to: "claims",
|
|
2044
|
-
disabled: order.status === "canceled",
|
|
2045
|
-
icon: /* @__PURE__ */ jsx12(ExclamationCircle2, {})
|
|
2046
|
-
}
|
|
2047
|
-
]
|
|
2048
|
-
},
|
|
2049
1955
|
{
|
|
2050
1956
|
actions: [
|
|
2051
1957
|
{
|
|
2052
1958
|
label: t("actions.cancel"),
|
|
2053
1959
|
onClick: handleCancel,
|
|
2054
|
-
disabled:
|
|
2055
|
-
|
|
1960
|
+
disabled: cancelDisabled,
|
|
1961
|
+
disabledTooltip: cancelDisabledTooltip,
|
|
1962
|
+
icon: /* @__PURE__ */ jsx13(XCircle, {})
|
|
2056
1963
|
}
|
|
2057
1964
|
]
|
|
2058
1965
|
}
|
|
@@ -2064,41 +1971,41 @@ var OrderGeneralSection = ({ order }) => {
|
|
|
2064
1971
|
] });
|
|
2065
1972
|
};
|
|
2066
1973
|
var FulfillmentBadge = ({ order }) => {
|
|
2067
|
-
const { t } =
|
|
1974
|
+
const { t } = useTranslation13();
|
|
2068
1975
|
const { label, color } = getOrderFulfillmentStatus(
|
|
2069
1976
|
t,
|
|
2070
1977
|
order.fulfillment_status
|
|
2071
1978
|
);
|
|
2072
|
-
return /* @__PURE__ */
|
|
1979
|
+
return /* @__PURE__ */ jsx13(StatusBadge2, { color, className: "text-nowrap", "data-testid": "order-general-section-fulfillment-badge", children: label });
|
|
2073
1980
|
};
|
|
2074
1981
|
var PaymentBadge = ({ order }) => {
|
|
2075
|
-
const { t } =
|
|
1982
|
+
const { t } = useTranslation13();
|
|
2076
1983
|
const { label, color } = getOrderPaymentStatus(t, order.payment_status);
|
|
2077
|
-
return /* @__PURE__ */
|
|
1984
|
+
return /* @__PURE__ */ jsx13(StatusBadge2, { color, className: "text-nowrap", "data-testid": "order-general-section-payment-badge", children: label });
|
|
2078
1985
|
};
|
|
2079
1986
|
var OrderBadge = ({ order }) => {
|
|
2080
|
-
const { t } =
|
|
1987
|
+
const { t } = useTranslation13();
|
|
2081
1988
|
const orderStatus = getCanceledOrderStatus(t, order.status);
|
|
2082
1989
|
if (!orderStatus) {
|
|
2083
1990
|
return null;
|
|
2084
1991
|
}
|
|
2085
|
-
return /* @__PURE__ */
|
|
1992
|
+
return /* @__PURE__ */ jsx13(StatusBadge2, { color: orderStatus.color, className: "text-nowrap", "data-testid": "order-general-section-order-badge", children: orderStatus.label });
|
|
2086
1993
|
};
|
|
2087
1994
|
|
|
2088
1995
|
// src/components/common/display-id/display-id.tsx
|
|
2089
|
-
import { useTranslation as
|
|
1996
|
+
import { useTranslation as useTranslation14 } from "react-i18next";
|
|
2090
1997
|
import { useState as useState4 } from "react";
|
|
2091
1998
|
import copy from "copy-to-clipboard";
|
|
2092
|
-
import { clx as clx2, toast as
|
|
2093
|
-
import { jsx as
|
|
1999
|
+
import { clx as clx2, toast as toast7, Tooltip as Tooltip3 } from "@medusajs/ui";
|
|
2000
|
+
import { jsx as jsx14, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2094
2001
|
function DisplayId({ id, className }) {
|
|
2095
|
-
const { t } =
|
|
2002
|
+
const { t } = useTranslation14();
|
|
2096
2003
|
const [open, setOpen] = useState4(false);
|
|
2097
2004
|
const onClick = () => {
|
|
2098
2005
|
copy(id);
|
|
2099
|
-
|
|
2006
|
+
toast7.success(t("actions.idCopiedToClipboard"));
|
|
2100
2007
|
};
|
|
2101
|
-
return /* @__PURE__ */
|
|
2008
|
+
return /* @__PURE__ */ jsx14(Tooltip3, { maxWidth: 260, content: id, open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs14("span", { onClick, className: clx2("cursor-pointer", className), children: [
|
|
2102
2009
|
"#",
|
|
2103
2010
|
id.slice(-7)
|
|
2104
2011
|
] }) });
|
|
@@ -2116,32 +2023,32 @@ var getTotalPending = (paymentCollections) => paymentCollections.filter((pc) =>
|
|
|
2116
2023
|
}, 0);
|
|
2117
2024
|
|
|
2118
2025
|
// src/pages/orders/order-detail/components/order-payment-section/order-payment-section.tsx
|
|
2119
|
-
import { ArrowDownRightMini, DocumentText, XCircle as
|
|
2026
|
+
import { ArrowDownRightMini, DocumentText, XCircle as XCircle2 } from "@medusajs/icons";
|
|
2120
2027
|
import {
|
|
2121
2028
|
Badge,
|
|
2122
|
-
Button as
|
|
2123
|
-
Container as
|
|
2124
|
-
Heading as
|
|
2029
|
+
Button as Button6,
|
|
2030
|
+
Container as Container10,
|
|
2031
|
+
Heading as Heading10,
|
|
2125
2032
|
StatusBadge as StatusBadge3,
|
|
2126
|
-
Text as
|
|
2127
|
-
toast as
|
|
2033
|
+
Text as Text11,
|
|
2034
|
+
toast as toast8,
|
|
2128
2035
|
Tooltip as Tooltip4,
|
|
2129
|
-
usePrompt as
|
|
2036
|
+
usePrompt as usePrompt3
|
|
2130
2037
|
} from "@medusajs/ui";
|
|
2131
2038
|
import { format as format2 } from "date-fns";
|
|
2132
|
-
import { Trans, useTranslation as
|
|
2133
|
-
import { jsx as
|
|
2039
|
+
import { Trans, useTranslation as useTranslation15 } from "react-i18next";
|
|
2040
|
+
import { jsx as jsx15, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2134
2041
|
var OrderPaymentSection = ({ order }) => {
|
|
2135
2042
|
const payments = getPaymentsFromOrder(order);
|
|
2136
2043
|
const refunds = payments.map((payment) => payment?.refunds).flat(1).filter(Boolean);
|
|
2137
|
-
return /* @__PURE__ */
|
|
2138
|
-
|
|
2044
|
+
return /* @__PURE__ */ jsxs15(
|
|
2045
|
+
Container10,
|
|
2139
2046
|
{
|
|
2140
2047
|
className: "divide-y p-0",
|
|
2141
2048
|
"data-testid": "order-payment-section",
|
|
2142
2049
|
children: [
|
|
2143
|
-
/* @__PURE__ */
|
|
2144
|
-
/* @__PURE__ */
|
|
2050
|
+
/* @__PURE__ */ jsx15(Header2, { order }),
|
|
2051
|
+
/* @__PURE__ */ jsx15(
|
|
2145
2052
|
PaymentBreakdown,
|
|
2146
2053
|
{
|
|
2147
2054
|
order,
|
|
@@ -2150,22 +2057,22 @@ var OrderPaymentSection = ({ order }) => {
|
|
|
2150
2057
|
currencyCode: order.currency_code
|
|
2151
2058
|
}
|
|
2152
2059
|
),
|
|
2153
|
-
/* @__PURE__ */
|
|
2060
|
+
/* @__PURE__ */ jsx15(Total, { order })
|
|
2154
2061
|
]
|
|
2155
2062
|
}
|
|
2156
2063
|
);
|
|
2157
2064
|
};
|
|
2158
2065
|
var Header2 = ({ order }) => {
|
|
2159
|
-
const { t } =
|
|
2066
|
+
const { t } = useTranslation15();
|
|
2160
2067
|
const { label, color } = getOrderPaymentStatus(t, order.payment_status);
|
|
2161
|
-
return /* @__PURE__ */
|
|
2068
|
+
return /* @__PURE__ */ jsxs15(
|
|
2162
2069
|
"div",
|
|
2163
2070
|
{
|
|
2164
2071
|
className: "flex items-center justify-between px-6 py-4",
|
|
2165
2072
|
"data-testid": "order-payment-header",
|
|
2166
2073
|
children: [
|
|
2167
|
-
/* @__PURE__ */
|
|
2168
|
-
/* @__PURE__ */
|
|
2074
|
+
/* @__PURE__ */ jsx15(Heading10, { level: "h2", "data-testid": "order-payment-heading", children: t("orders.payment.title") }),
|
|
2075
|
+
/* @__PURE__ */ jsx15(
|
|
2169
2076
|
StatusBadge3,
|
|
2170
2077
|
{
|
|
2171
2078
|
color,
|
|
@@ -2182,8 +2089,8 @@ var Refund = ({
|
|
|
2182
2089
|
refund,
|
|
2183
2090
|
currencyCode
|
|
2184
2091
|
}) => {
|
|
2185
|
-
const { t } =
|
|
2186
|
-
const RefundReasonBadge = refund?.refund_reason && /* @__PURE__ */
|
|
2092
|
+
const { t } = useTranslation15();
|
|
2093
|
+
const RefundReasonBadge = refund?.refund_reason && /* @__PURE__ */ jsx15(
|
|
2187
2094
|
Badge,
|
|
2188
2095
|
{
|
|
2189
2096
|
size: "2xsmall",
|
|
@@ -2193,27 +2100,27 @@ var Refund = ({
|
|
|
2193
2100
|
children: refund.refund_reason.label
|
|
2194
2101
|
}
|
|
2195
2102
|
);
|
|
2196
|
-
const RefundNoteIndicator = refund.note && /* @__PURE__ */
|
|
2197
|
-
return /* @__PURE__ */
|
|
2198
|
-
/* @__PURE__ */
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
/* @__PURE__ */
|
|
2201
|
-
/* @__PURE__ */
|
|
2202
|
-
/* @__PURE__ */
|
|
2203
|
-
/* @__PURE__ */
|
|
2103
|
+
const RefundNoteIndicator = refund.note && /* @__PURE__ */ jsx15(Tooltip4, { content: refund.note, children: /* @__PURE__ */ jsx15(DocumentText, { className: "ml-1 inline text-ui-tag-neutral-icon" }) });
|
|
2104
|
+
return /* @__PURE__ */ jsxs15("div", { className: "flex items-start gap-x-4 bg-ui-bg-subtle px-6 py-4 text-ui-fg-subtle sm:items-center", children: [
|
|
2105
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-1 flex-col gap-3 sm:flex-row sm:items-center", children: [
|
|
2106
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex shrink-0 flex-row items-center gap-x-3", children: [
|
|
2107
|
+
/* @__PURE__ */ jsx15(ArrowDownRightMini, { className: "text-ui-fg-muted" }),
|
|
2108
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
2109
|
+
/* @__PURE__ */ jsx15(Text11, { size: "small", leading: "compact", weight: "plus", children: t("orders.payment.refund") }),
|
|
2110
|
+
/* @__PURE__ */ jsx15(Text11, { size: "small", leading: "compact", children: format2(new Date(refund.created_at), "dd MMM, yyyy, HH:mm:ss") })
|
|
2204
2111
|
] })
|
|
2205
2112
|
] }),
|
|
2206
|
-
/* @__PURE__ */
|
|
2207
|
-
/* @__PURE__ */
|
|
2113
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-x-3", children: [
|
|
2114
|
+
/* @__PURE__ */ jsx15("div", { className: "shrink-0", children: RefundNoteIndicator }),
|
|
2208
2115
|
RefundReasonBadge
|
|
2209
2116
|
] })
|
|
2210
2117
|
] }),
|
|
2211
|
-
/* @__PURE__ */
|
|
2212
|
-
/* @__PURE__ */
|
|
2118
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex shrink-0 items-center justify-end gap-4", children: [
|
|
2119
|
+
/* @__PURE__ */ jsxs15(Text11, { size: "small", leading: "compact", children: [
|
|
2213
2120
|
"- ",
|
|
2214
2121
|
getLocaleAmount(refund.amount, currencyCode)
|
|
2215
2122
|
] }),
|
|
2216
|
-
/* @__PURE__ */
|
|
2123
|
+
/* @__PURE__ */ jsx15("div", { className: "h-7 w-5" })
|
|
2217
2124
|
] })
|
|
2218
2125
|
] });
|
|
2219
2126
|
};
|
|
@@ -2223,8 +2130,8 @@ var Payment = ({
|
|
|
2223
2130
|
refunds,
|
|
2224
2131
|
currencyCode
|
|
2225
2132
|
}) => {
|
|
2226
|
-
const { t } =
|
|
2227
|
-
const prompt =
|
|
2133
|
+
const { t } = useTranslation15();
|
|
2134
|
+
const prompt = usePrompt3();
|
|
2228
2135
|
const { mutateAsync } = useCapturePayment(order.id, payment.id);
|
|
2229
2136
|
const handleCapture = async () => {
|
|
2230
2137
|
const res = await prompt({
|
|
@@ -2243,14 +2150,14 @@ var Payment = ({
|
|
|
2243
2150
|
{ amount: payment.amount },
|
|
2244
2151
|
{
|
|
2245
2152
|
onSuccess: () => {
|
|
2246
|
-
|
|
2153
|
+
toast8.success(
|
|
2247
2154
|
t("orders.payment.capturePaymentSuccess", {
|
|
2248
2155
|
amount: formatCurrency(payment.amount, currencyCode)
|
|
2249
2156
|
})
|
|
2250
2157
|
);
|
|
2251
2158
|
},
|
|
2252
2159
|
onError: (error) => {
|
|
2253
|
-
|
|
2160
|
+
toast8.error(error.message);
|
|
2254
2161
|
}
|
|
2255
2162
|
}
|
|
2256
2163
|
);
|
|
@@ -2267,32 +2174,32 @@ var Payment = ({
|
|
|
2267
2174
|
const [status, color] = getPaymentStatusAttributes(payment);
|
|
2268
2175
|
const showCapture = payment.captured_at === null && payment.canceled_at === null;
|
|
2269
2176
|
const totalRefunded = payment.refunds?.reduce((acc, next) => next.amount + acc, 0) ?? 0;
|
|
2270
|
-
return /* @__PURE__ */
|
|
2177
|
+
return /* @__PURE__ */ jsxs15(
|
|
2271
2178
|
"div",
|
|
2272
2179
|
{
|
|
2273
2180
|
className: "divide-y",
|
|
2274
2181
|
"data-testid": `order-payment-${payment.id}`,
|
|
2275
2182
|
children: [
|
|
2276
|
-
/* @__PURE__ */
|
|
2183
|
+
/* @__PURE__ */ jsxs15(
|
|
2277
2184
|
"div",
|
|
2278
2185
|
{
|
|
2279
2186
|
className: "grid grid-cols-[1fr_1fr_1fr_20px] items-center gap-x-4 px-6 py-4 text-ui-fg-subtle sm:grid-cols-[1fr_1fr_1fr_1fr_20px]",
|
|
2280
2187
|
"data-testid": `order-payment-${payment.id}-row`,
|
|
2281
2188
|
children: [
|
|
2282
|
-
/* @__PURE__ */
|
|
2283
|
-
/* @__PURE__ */
|
|
2284
|
-
|
|
2189
|
+
/* @__PURE__ */ jsxs15("div", { className: "w-full min-w-[60px] overflow-hidden", children: [
|
|
2190
|
+
/* @__PURE__ */ jsx15(
|
|
2191
|
+
Text11,
|
|
2285
2192
|
{
|
|
2286
2193
|
size: "small",
|
|
2287
2194
|
leading: "compact",
|
|
2288
2195
|
weight: "plus",
|
|
2289
2196
|
className: "truncate",
|
|
2290
2197
|
"data-testid": `order-payment-${payment.id}-id`,
|
|
2291
|
-
children: /* @__PURE__ */
|
|
2198
|
+
children: /* @__PURE__ */ jsx15(display_id_default, { id: payment.id })
|
|
2292
2199
|
}
|
|
2293
2200
|
),
|
|
2294
|
-
/* @__PURE__ */
|
|
2295
|
-
|
|
2201
|
+
/* @__PURE__ */ jsx15(
|
|
2202
|
+
Text11,
|
|
2296
2203
|
{
|
|
2297
2204
|
size: "small",
|
|
2298
2205
|
leading: "compact",
|
|
@@ -2301,8 +2208,8 @@ var Payment = ({
|
|
|
2301
2208
|
}
|
|
2302
2209
|
)
|
|
2303
2210
|
] }),
|
|
2304
|
-
/* @__PURE__ */
|
|
2305
|
-
|
|
2211
|
+
/* @__PURE__ */ jsx15("div", { className: "hidden items-center justify-end sm:flex", children: /* @__PURE__ */ jsx15(
|
|
2212
|
+
Text11,
|
|
2306
2213
|
{
|
|
2307
2214
|
size: "small",
|
|
2308
2215
|
leading: "compact",
|
|
@@ -2311,7 +2218,7 @@ var Payment = ({
|
|
|
2311
2218
|
children: payment.provider_id
|
|
2312
2219
|
}
|
|
2313
2220
|
) }),
|
|
2314
|
-
/* @__PURE__ */
|
|
2221
|
+
/* @__PURE__ */ jsx15("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx15(
|
|
2315
2222
|
StatusBadge3,
|
|
2316
2223
|
{
|
|
2317
2224
|
color,
|
|
@@ -2320,8 +2227,8 @@ var Payment = ({
|
|
|
2320
2227
|
children: status
|
|
2321
2228
|
}
|
|
2322
2229
|
) }),
|
|
2323
|
-
/* @__PURE__ */
|
|
2324
|
-
|
|
2230
|
+
/* @__PURE__ */ jsx15("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx15(
|
|
2231
|
+
Text11,
|
|
2325
2232
|
{
|
|
2326
2233
|
size: "small",
|
|
2327
2234
|
leading: "compact",
|
|
@@ -2329,7 +2236,7 @@ var Payment = ({
|
|
|
2329
2236
|
children: getLocaleAmount(payment.amount, payment.currency_code)
|
|
2330
2237
|
}
|
|
2331
2238
|
) }),
|
|
2332
|
-
/* @__PURE__ */
|
|
2239
|
+
/* @__PURE__ */ jsx15(
|
|
2333
2240
|
ActionMenu,
|
|
2334
2241
|
{
|
|
2335
2242
|
groups: [
|
|
@@ -2337,7 +2244,7 @@ var Payment = ({
|
|
|
2337
2244
|
actions: [
|
|
2338
2245
|
{
|
|
2339
2246
|
label: t("orders.payment.createRefund"),
|
|
2340
|
-
icon: /* @__PURE__ */
|
|
2247
|
+
icon: /* @__PURE__ */ jsx15(XCircle2, {}),
|
|
2341
2248
|
to: `/orders/${order.id}/refund?paymentId=${payment.id}`,
|
|
2342
2249
|
disabled: !payment.captured_at || !!payment.canceled_at || totalRefunded >= payment.amount
|
|
2343
2250
|
}
|
|
@@ -2350,24 +2257,24 @@ var Payment = ({
|
|
|
2350
2257
|
]
|
|
2351
2258
|
}
|
|
2352
2259
|
),
|
|
2353
|
-
showCapture && /* @__PURE__ */
|
|
2260
|
+
showCapture && /* @__PURE__ */ jsxs15(
|
|
2354
2261
|
"div",
|
|
2355
2262
|
{
|
|
2356
2263
|
className: "flex items-center justify-between bg-ui-bg-subtle px-6 py-4",
|
|
2357
2264
|
"data-testid": `order-payment-${payment.id}-capture-section`,
|
|
2358
2265
|
children: [
|
|
2359
|
-
/* @__PURE__ */
|
|
2360
|
-
/* @__PURE__ */
|
|
2361
|
-
/* @__PURE__ */
|
|
2266
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-x-2", children: [
|
|
2267
|
+
/* @__PURE__ */ jsx15(ArrowDownRightMini, { className: "shrink-0 text-ui-fg-muted" }),
|
|
2268
|
+
/* @__PURE__ */ jsx15(Text11, { size: "small", leading: "compact", children: /* @__PURE__ */ jsx15(
|
|
2362
2269
|
Trans,
|
|
2363
2270
|
{
|
|
2364
2271
|
i18nKey: "orders.payment.isReadyToBeCaptured",
|
|
2365
|
-
components: [/* @__PURE__ */
|
|
2272
|
+
components: [/* @__PURE__ */ jsx15(display_id_default, { id: payment.id }, payment.id)]
|
|
2366
2273
|
}
|
|
2367
2274
|
) })
|
|
2368
2275
|
] }),
|
|
2369
|
-
/* @__PURE__ */
|
|
2370
|
-
|
|
2276
|
+
/* @__PURE__ */ jsxs15(
|
|
2277
|
+
Button6,
|
|
2371
2278
|
{
|
|
2372
2279
|
className: "shrink-0",
|
|
2373
2280
|
size: "small",
|
|
@@ -2375,15 +2282,15 @@ var Payment = ({
|
|
|
2375
2282
|
onClick: handleCapture,
|
|
2376
2283
|
"data-testid": `order-payment-${payment.id}-capture-button`,
|
|
2377
2284
|
children: [
|
|
2378
|
-
/* @__PURE__ */
|
|
2379
|
-
/* @__PURE__ */
|
|
2285
|
+
/* @__PURE__ */ jsx15("span", { className: "hidden sm:block", children: t("orders.payment.capture") }),
|
|
2286
|
+
/* @__PURE__ */ jsx15("span", { className: "sm:hidden", children: t("orders.payment.capture_short") })
|
|
2380
2287
|
]
|
|
2381
2288
|
}
|
|
2382
2289
|
)
|
|
2383
2290
|
]
|
|
2384
2291
|
}
|
|
2385
2292
|
),
|
|
2386
|
-
refunds.map((refund) => /* @__PURE__ */
|
|
2293
|
+
refunds.map((refund) => /* @__PURE__ */ jsx15(Refund, { refund, currencyCode }, refund.id))
|
|
2387
2294
|
]
|
|
2388
2295
|
}
|
|
2389
2296
|
);
|
|
@@ -2396,31 +2303,31 @@ var CreditLine = ({
|
|
|
2396
2303
|
return null;
|
|
2397
2304
|
}
|
|
2398
2305
|
const prettyReference = creditLine.reference?.split("_").join(" ").split("-").join(" ");
|
|
2399
|
-
const prettyReferenceId = creditLine.reference_id ? /* @__PURE__ */
|
|
2400
|
-
return /* @__PURE__ */
|
|
2401
|
-
/* @__PURE__ */
|
|
2402
|
-
/* @__PURE__ */
|
|
2403
|
-
|
|
2306
|
+
const prettyReferenceId = creditLine.reference_id ? /* @__PURE__ */ jsx15(display_id_default, { id: creditLine.reference_id }) : null;
|
|
2307
|
+
return /* @__PURE__ */ jsx15("div", { className: "divide-y", children: /* @__PURE__ */ jsxs15("div", { className: "grid grid-cols-[1fr_1fr_20px] items-center gap-x-4 px-6 py-4 text-ui-fg-subtle sm:grid-cols-[1fr_1fr_1fr_20px]", children: [
|
|
2308
|
+
/* @__PURE__ */ jsxs15("div", { className: "w-full min-w-[60px] overflow-hidden", children: [
|
|
2309
|
+
/* @__PURE__ */ jsx15(
|
|
2310
|
+
Text11,
|
|
2404
2311
|
{
|
|
2405
2312
|
size: "small",
|
|
2406
2313
|
leading: "compact",
|
|
2407
2314
|
weight: "plus",
|
|
2408
2315
|
className: "truncate",
|
|
2409
|
-
children: /* @__PURE__ */
|
|
2316
|
+
children: /* @__PURE__ */ jsx15(display_id_default, { id: creditLine.id })
|
|
2410
2317
|
}
|
|
2411
2318
|
),
|
|
2412
|
-
/* @__PURE__ */
|
|
2319
|
+
/* @__PURE__ */ jsx15(Text11, { size: "small", leading: "compact", children: creditLine.created_at ? format2(
|
|
2413
2320
|
new Date(creditLine.created_at),
|
|
2414
2321
|
"dd MMM, yyyy, HH:mm:ss"
|
|
2415
2322
|
) : "-" })
|
|
2416
2323
|
] }),
|
|
2417
|
-
/* @__PURE__ */
|
|
2324
|
+
/* @__PURE__ */ jsx15("div", { className: "hidden items-center justify-end sm:flex", children: /* @__PURE__ */ jsxs15(Text11, { size: "small", leading: "compact", className: "capitalize", children: [
|
|
2418
2325
|
prettyReference,
|
|
2419
2326
|
" (",
|
|
2420
2327
|
prettyReferenceId,
|
|
2421
2328
|
")"
|
|
2422
2329
|
] }) }),
|
|
2423
|
-
/* @__PURE__ */
|
|
2330
|
+
/* @__PURE__ */ jsx15("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx15(Text11, { size: "small", leading: "compact", children: getLocaleAmount(creditLine.amount, currencyCode) }) })
|
|
2424
2331
|
] }) });
|
|
2425
2332
|
};
|
|
2426
2333
|
var PaymentBreakdown = ({
|
|
@@ -2443,7 +2350,7 @@ var PaymentBreakdown = ({
|
|
|
2443
2350
|
}
|
|
2444
2351
|
return { event: entry, type };
|
|
2445
2352
|
});
|
|
2446
|
-
return /* @__PURE__ */
|
|
2353
|
+
return /* @__PURE__ */ jsx15(
|
|
2447
2354
|
"div",
|
|
2448
2355
|
{
|
|
2449
2356
|
className: "flex flex-col divide-y",
|
|
@@ -2451,7 +2358,7 @@ var PaymentBreakdown = ({
|
|
|
2451
2358
|
children: entries.map(({ type, event }) => {
|
|
2452
2359
|
switch (type) {
|
|
2453
2360
|
case "payment":
|
|
2454
|
-
return /* @__PURE__ */
|
|
2361
|
+
return /* @__PURE__ */ jsx15(
|
|
2455
2362
|
Payment,
|
|
2456
2363
|
{
|
|
2457
2364
|
order,
|
|
@@ -2464,7 +2371,7 @@ var PaymentBreakdown = ({
|
|
|
2464
2371
|
event.id
|
|
2465
2372
|
);
|
|
2466
2373
|
case "refund":
|
|
2467
|
-
return /* @__PURE__ */
|
|
2374
|
+
return /* @__PURE__ */ jsx15(
|
|
2468
2375
|
Refund,
|
|
2469
2376
|
{
|
|
2470
2377
|
refund: event,
|
|
@@ -2473,7 +2380,7 @@ var PaymentBreakdown = ({
|
|
|
2473
2380
|
event.id
|
|
2474
2381
|
);
|
|
2475
2382
|
case "credit_line_refund":
|
|
2476
|
-
return /* @__PURE__ */
|
|
2383
|
+
return /* @__PURE__ */ jsx15(
|
|
2477
2384
|
CreditLine,
|
|
2478
2385
|
{
|
|
2479
2386
|
creditLine: event,
|
|
@@ -2487,36 +2394,36 @@ var PaymentBreakdown = ({
|
|
|
2487
2394
|
);
|
|
2488
2395
|
};
|
|
2489
2396
|
var Total = ({ order }) => {
|
|
2490
|
-
const { t } =
|
|
2397
|
+
const { t } = useTranslation15();
|
|
2491
2398
|
const totalPending = getTotalPending(order.payment_collections);
|
|
2492
|
-
return /* @__PURE__ */
|
|
2399
|
+
return /* @__PURE__ */ jsxs15(
|
|
2493
2400
|
"div",
|
|
2494
2401
|
{
|
|
2495
2402
|
className: "flex flex-col gap-y-4 px-6 py-4",
|
|
2496
2403
|
"data-testid": "order-payment-total",
|
|
2497
2404
|
children: [
|
|
2498
|
-
/* @__PURE__ */
|
|
2405
|
+
/* @__PURE__ */ jsxs15(
|
|
2499
2406
|
"div",
|
|
2500
2407
|
{
|
|
2501
2408
|
className: "flex items-center justify-between",
|
|
2502
2409
|
"data-testid": "order-payment-total-paid",
|
|
2503
2410
|
children: [
|
|
2504
|
-
/* @__PURE__ */
|
|
2505
|
-
/* @__PURE__ */
|
|
2411
|
+
/* @__PURE__ */ jsx15(Text11, { size: "small", weight: "plus", leading: "compact", children: t("orders.payment.totalPaidByCustomer") }),
|
|
2412
|
+
/* @__PURE__ */ jsx15(Text11, { size: "small", weight: "plus", leading: "compact", children: getStylizedAmount(
|
|
2506
2413
|
getTotalCaptured(order.payment_collections),
|
|
2507
2414
|
order.currency_code
|
|
2508
2415
|
) })
|
|
2509
2416
|
]
|
|
2510
2417
|
}
|
|
2511
2418
|
),
|
|
2512
|
-
order.status !== "canceled" && totalPending > 0 && /* @__PURE__ */
|
|
2419
|
+
order.status !== "canceled" && totalPending > 0 && /* @__PURE__ */ jsxs15(
|
|
2513
2420
|
"div",
|
|
2514
2421
|
{
|
|
2515
2422
|
className: "flex items-center justify-between",
|
|
2516
2423
|
"data-testid": "order-payment-total-pending",
|
|
2517
2424
|
children: [
|
|
2518
|
-
/* @__PURE__ */
|
|
2519
|
-
/* @__PURE__ */
|
|
2425
|
+
/* @__PURE__ */ jsx15(Text11, { size: "small", weight: "plus", leading: "compact", children: t("orders.payment.totalPending") }),
|
|
2426
|
+
/* @__PURE__ */ jsx15(Text11, { size: "small", weight: "plus", leading: "compact", children: getStylizedAmount(totalPending, order.currency_code) })
|
|
2520
2427
|
]
|
|
2521
2428
|
}
|
|
2522
2429
|
)
|
|
@@ -2526,31 +2433,30 @@ var Total = ({ order }) => {
|
|
|
2526
2433
|
};
|
|
2527
2434
|
|
|
2528
2435
|
// src/pages/orders/order-detail/components/order-summary-section/order-summary-section.tsx
|
|
2529
|
-
import { useMemo as
|
|
2530
|
-
import { useTranslation as
|
|
2436
|
+
import { useMemo as useMemo4, useState as useState6 } from "react";
|
|
2437
|
+
import { useTranslation as useTranslation18 } from "react-i18next";
|
|
2531
2438
|
import { Link as Link3 } from "react-router-dom";
|
|
2532
2439
|
import {
|
|
2533
2440
|
ArrowDownRightMini as ArrowDownRightMini2,
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
ArrowUturnLeft as ArrowUturnLeft3,
|
|
2441
|
+
ArrowPath as ArrowPath3,
|
|
2442
|
+
ArrowUturnLeft as ArrowUturnLeft2,
|
|
2537
2443
|
DocumentText as DocumentText2,
|
|
2538
|
-
ExclamationCircle as
|
|
2539
|
-
PencilSquare
|
|
2444
|
+
ExclamationCircle as ExclamationCircle2,
|
|
2445
|
+
PencilSquare,
|
|
2540
2446
|
TriangleDownMini
|
|
2541
2447
|
} from "@medusajs/icons";
|
|
2542
2448
|
import {
|
|
2543
2449
|
Badge as Badge4,
|
|
2544
|
-
Button as
|
|
2450
|
+
Button as Button7,
|
|
2545
2451
|
clx as clx3,
|
|
2546
|
-
Container as
|
|
2452
|
+
Container as Container11,
|
|
2547
2453
|
Copy as Copy5,
|
|
2548
|
-
Heading as
|
|
2454
|
+
Heading as Heading11,
|
|
2549
2455
|
StatusBadge as StatusBadge4,
|
|
2550
|
-
Text as
|
|
2551
|
-
toast as
|
|
2456
|
+
Text as Text13,
|
|
2457
|
+
toast as toast9,
|
|
2552
2458
|
Tooltip as Tooltip6,
|
|
2553
|
-
usePrompt as
|
|
2459
|
+
usePrompt as usePrompt4
|
|
2554
2460
|
} from "@medusajs/ui";
|
|
2555
2461
|
import { format as format3 } from "date-fns";
|
|
2556
2462
|
|
|
@@ -2562,12 +2468,12 @@ var getTotalCreditLines = (creditLines) => creditLines.reduce((acc, creditLine)
|
|
|
2562
2468
|
|
|
2563
2469
|
// src/pages/orders/order-detail/components/order-summary-section/return-info-popover.tsx
|
|
2564
2470
|
import { InformationCircleSolid } from "@medusajs/icons";
|
|
2565
|
-
import { Badge as Badge2, Popover as Popover3, Text as
|
|
2471
|
+
import { Badge as Badge2, Popover as Popover3, Text as Text12 } from "@medusajs/ui";
|
|
2566
2472
|
import { useState as useState5 } from "react";
|
|
2567
|
-
import { useTranslation as
|
|
2568
|
-
import { jsx as
|
|
2473
|
+
import { useTranslation as useTranslation16 } from "react-i18next";
|
|
2474
|
+
import { jsx as jsx16, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2569
2475
|
function ReturnInfoPopover({ orderReturn }) {
|
|
2570
|
-
const { t } =
|
|
2476
|
+
const { t } = useTranslation16();
|
|
2571
2477
|
const [open, setOpen] = useState5(false);
|
|
2572
2478
|
const { getFullDate } = useDate();
|
|
2573
2479
|
const handleMouseEnter = () => {
|
|
@@ -2589,36 +2495,36 @@ function ReturnInfoPopover({ orderReturn }) {
|
|
|
2589
2495
|
if (typeof orderReturn !== "object") {
|
|
2590
2496
|
return;
|
|
2591
2497
|
}
|
|
2592
|
-
return /* @__PURE__ */
|
|
2593
|
-
/* @__PURE__ */
|
|
2498
|
+
return /* @__PURE__ */ jsxs16(Popover3, { open, children: [
|
|
2499
|
+
/* @__PURE__ */ jsx16(
|
|
2594
2500
|
Popover3.Trigger,
|
|
2595
2501
|
{
|
|
2596
2502
|
onMouseEnter: handleMouseEnter,
|
|
2597
2503
|
onMouseLeave: handleMouseLeave,
|
|
2598
2504
|
autoFocus: false,
|
|
2599
2505
|
className: "align-sub focus-visible:outline-none",
|
|
2600
|
-
children: /* @__PURE__ */
|
|
2506
|
+
children: /* @__PURE__ */ jsx16(InformationCircleSolid, {})
|
|
2601
2507
|
}
|
|
2602
2508
|
),
|
|
2603
|
-
/* @__PURE__ */
|
|
2509
|
+
/* @__PURE__ */ jsx16(
|
|
2604
2510
|
Popover3.Content,
|
|
2605
2511
|
{
|
|
2606
2512
|
align: "center",
|
|
2607
2513
|
side: "top",
|
|
2608
2514
|
className: "bg-ui-bg-component p-2 focus-visible:outline-none",
|
|
2609
|
-
children: /* @__PURE__ */
|
|
2610
|
-
/* @__PURE__ */
|
|
2515
|
+
children: /* @__PURE__ */ jsxs16("div", { className: "", children: [
|
|
2516
|
+
/* @__PURE__ */ jsxs16(Badge2, { size: "2xsmall", className: "mb-2", rounded: "full", children: [
|
|
2611
2517
|
returnType,
|
|
2612
2518
|
": #",
|
|
2613
2519
|
returnTypeId.slice(-7)
|
|
2614
2520
|
] }),
|
|
2615
|
-
/* @__PURE__ */
|
|
2616
|
-
/* @__PURE__ */
|
|
2521
|
+
/* @__PURE__ */ jsxs16(Text12, { size: "xsmall", children: [
|
|
2522
|
+
/* @__PURE__ */ jsx16("span", { className: "text-ui-fg-subtle", children: t(`orders.returns.returnRequested`) }),
|
|
2617
2523
|
" \xB7 ",
|
|
2618
2524
|
getFullDate({ date: orderReturn.requested_at, includeTime: true })
|
|
2619
2525
|
] }),
|
|
2620
|
-
/* @__PURE__ */
|
|
2621
|
-
/* @__PURE__ */
|
|
2526
|
+
/* @__PURE__ */ jsxs16(Text12, { size: "xsmall", children: [
|
|
2527
|
+
/* @__PURE__ */ jsx16("span", { className: "text-ui-fg-subtle", children: t(`orders.returns.itemReceived`) }),
|
|
2622
2528
|
" \xB7 ",
|
|
2623
2529
|
orderReturn.received_at ? getFullDate({
|
|
2624
2530
|
date: orderReturn.received_at,
|
|
@@ -2635,10 +2541,10 @@ var return_info_popover_default = ReturnInfoPopover;
|
|
|
2635
2541
|
// src/pages/orders/order-detail/components/order-summary-section/shipping-info-popover.tsx
|
|
2636
2542
|
import { InformationCircleSolid as InformationCircleSolid2 } from "@medusajs/icons";
|
|
2637
2543
|
import { Badge as Badge3, Tooltip as Tooltip5 } from "@medusajs/ui";
|
|
2638
|
-
import { useTranslation as
|
|
2639
|
-
import { jsx as
|
|
2544
|
+
import { useTranslation as useTranslation17 } from "react-i18next";
|
|
2545
|
+
import { jsx as jsx17, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2640
2546
|
function ShippingInfoPopover({ shippingMethod }) {
|
|
2641
|
-
const { t } =
|
|
2547
|
+
const { t } = useTranslation17();
|
|
2642
2548
|
const shippingDetail = shippingMethod?.detail;
|
|
2643
2549
|
if (!shippingDetail) {
|
|
2644
2550
|
return;
|
|
@@ -2656,25 +2562,25 @@ function ShippingInfoPopover({ shippingMethod }) {
|
|
|
2656
2562
|
if (!rmaId) {
|
|
2657
2563
|
return;
|
|
2658
2564
|
}
|
|
2659
|
-
return /* @__PURE__ */
|
|
2565
|
+
return /* @__PURE__ */ jsx17(
|
|
2660
2566
|
Tooltip5,
|
|
2661
2567
|
{
|
|
2662
|
-
content: /* @__PURE__ */
|
|
2568
|
+
content: /* @__PURE__ */ jsxs17(Badge3, { size: "2xsmall", rounded: "full", children: [
|
|
2663
2569
|
rmaType,
|
|
2664
2570
|
": #",
|
|
2665
2571
|
rmaId.slice(-7)
|
|
2666
2572
|
] }),
|
|
2667
|
-
children: /* @__PURE__ */
|
|
2573
|
+
children: /* @__PURE__ */ jsx17(InformationCircleSolid2, { className: "inline-block text-ui-fg-muted ml-1" })
|
|
2668
2574
|
}
|
|
2669
2575
|
);
|
|
2670
2576
|
}
|
|
2671
2577
|
var shipping_info_popover_default = ShippingInfoPopover;
|
|
2672
2578
|
|
|
2673
2579
|
// src/pages/orders/order-detail/components/order-summary-section/order-summary-section.tsx
|
|
2674
|
-
import { Fragment as Fragment3, jsx as
|
|
2580
|
+
import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2675
2581
|
var OrderSummarySection = ({ order }) => {
|
|
2676
|
-
const { t } =
|
|
2677
|
-
const prompt =
|
|
2582
|
+
const { t } = useTranslation18();
|
|
2583
|
+
const prompt = usePrompt4();
|
|
2678
2584
|
const { reservations } = useReservationItems(
|
|
2679
2585
|
{
|
|
2680
2586
|
line_item_id: order?.items?.map((i) => i.id),
|
|
@@ -2683,34 +2589,6 @@ var OrderSummarySection = ({ order }) => {
|
|
|
2683
2589
|
{ enabled: Array.isArray(order?.items) }
|
|
2684
2590
|
);
|
|
2685
2591
|
const { order: orderPreview } = useOrderPreview(order.id);
|
|
2686
|
-
const { returns = [] } = useReturns({
|
|
2687
|
-
status: "requested",
|
|
2688
|
-
order_id: order.id,
|
|
2689
|
-
fields: "+received_at"
|
|
2690
|
-
});
|
|
2691
|
-
const receivableReturns = useMemo3(
|
|
2692
|
-
() => returns.filter((r) => !r.canceled_at),
|
|
2693
|
-
[returns]
|
|
2694
|
-
);
|
|
2695
|
-
const showReturns = !!receivableReturns.length;
|
|
2696
|
-
const showAllocateButton = useMemo3(() => {
|
|
2697
|
-
if (!reservations) {
|
|
2698
|
-
return false;
|
|
2699
|
-
}
|
|
2700
|
-
const reservationsMap = new Map(
|
|
2701
|
-
reservations.map((r) => [r.line_item_id, r.id])
|
|
2702
|
-
);
|
|
2703
|
-
for (const item of order.items) {
|
|
2704
|
-
if (item.variant?.manage_inventory) {
|
|
2705
|
-
if (item.quantity - item.detail.fulfilled_quantity > 0) {
|
|
2706
|
-
if (!reservationsMap.has(item.id)) {
|
|
2707
|
-
return true;
|
|
2708
|
-
}
|
|
2709
|
-
}
|
|
2710
|
-
}
|
|
2711
|
-
}
|
|
2712
|
-
return false;
|
|
2713
|
-
}, [order.items, reservations]);
|
|
2714
2592
|
const unpaidPaymentCollection = order.payment_collections.find(
|
|
2715
2593
|
(pc) => pc.status === "not_paid"
|
|
2716
2594
|
);
|
|
@@ -2745,7 +2623,7 @@ var OrderSummarySection = ({ order }) => {
|
|
|
2745
2623
|
{ order_id: order.id },
|
|
2746
2624
|
{
|
|
2747
2625
|
onSuccess: () => {
|
|
2748
|
-
|
|
2626
|
+
toast9.success(
|
|
2749
2627
|
t("orders.payment.markAsPaidPaymentSuccess", {
|
|
2750
2628
|
amount: formatCurrency(
|
|
2751
2629
|
paymentCollection.amount,
|
|
@@ -2755,86 +2633,30 @@ var OrderSummarySection = ({ order }) => {
|
|
|
2755
2633
|
);
|
|
2756
2634
|
},
|
|
2757
2635
|
onError: (error) => {
|
|
2758
|
-
|
|
2636
|
+
toast9.error(error.message);
|
|
2759
2637
|
}
|
|
2760
2638
|
}
|
|
2761
2639
|
);
|
|
2762
2640
|
};
|
|
2763
|
-
return /* @__PURE__ */
|
|
2764
|
-
|
|
2641
|
+
return /* @__PURE__ */ jsxs18(
|
|
2642
|
+
Container11,
|
|
2765
2643
|
{
|
|
2766
2644
|
className: "divide-y p-0",
|
|
2767
2645
|
"data-testid": "order-summary-section",
|
|
2768
2646
|
children: [
|
|
2769
|
-
/* @__PURE__ */
|
|
2770
|
-
/* @__PURE__ */
|
|
2771
|
-
/* @__PURE__ */
|
|
2772
|
-
/* @__PURE__ */
|
|
2773
|
-
/* @__PURE__ */
|
|
2774
|
-
(
|
|
2647
|
+
/* @__PURE__ */ jsx18(Header3, { order, orderPreview }),
|
|
2648
|
+
/* @__PURE__ */ jsx18(ItemBreakdown, { order, reservations }),
|
|
2649
|
+
/* @__PURE__ */ jsx18(CostBreakdown, { order }),
|
|
2650
|
+
/* @__PURE__ */ jsx18(DiscountAndTotalBreakdown, { order }),
|
|
2651
|
+
/* @__PURE__ */ jsx18(Total2, { order }),
|
|
2652
|
+
(showPayment || showRefund) && /* @__PURE__ */ jsxs18(
|
|
2775
2653
|
"div",
|
|
2776
2654
|
{
|
|
2777
2655
|
className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4",
|
|
2778
2656
|
"data-testid": "order-summary-actions",
|
|
2779
2657
|
children: [
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
{
|
|
2783
|
-
asChild: true,
|
|
2784
|
-
variant: "secondary",
|
|
2785
|
-
size: "small",
|
|
2786
|
-
"data-testid": "order-summary-receive-return-button",
|
|
2787
|
-
children: /* @__PURE__ */ jsx17(
|
|
2788
|
-
Link3,
|
|
2789
|
-
{
|
|
2790
|
-
to: `/orders/${order.id}/returns/${receivableReturns[0].id}/receive`,
|
|
2791
|
-
children: t("orders.returns.receive.action")
|
|
2792
|
-
}
|
|
2793
|
-
)
|
|
2794
|
-
}
|
|
2795
|
-
) : /* @__PURE__ */ jsx17(
|
|
2796
|
-
ActionMenu,
|
|
2797
|
-
{
|
|
2798
|
-
groups: [
|
|
2799
|
-
{
|
|
2800
|
-
actions: receivableReturns.map((r) => {
|
|
2801
|
-
let id = r.id;
|
|
2802
|
-
let returnType = "Return";
|
|
2803
|
-
if (r.exchange_id) {
|
|
2804
|
-
id = r.exchange_id;
|
|
2805
|
-
returnType = "Exchange";
|
|
2806
|
-
}
|
|
2807
|
-
if (r.claim_id) {
|
|
2808
|
-
id = r.claim_id;
|
|
2809
|
-
returnType = "Claim";
|
|
2810
|
-
}
|
|
2811
|
-
return {
|
|
2812
|
-
label: t("orders.returns.receive.receiveItems", {
|
|
2813
|
-
id: `#${id.slice(-7)}`,
|
|
2814
|
-
returnType
|
|
2815
|
-
}),
|
|
2816
|
-
icon: /* @__PURE__ */ jsx17(ArrowLongRight, {}),
|
|
2817
|
-
to: `/orders/${order.id}/returns/${r.id}/receive`
|
|
2818
|
-
};
|
|
2819
|
-
})
|
|
2820
|
-
}
|
|
2821
|
-
],
|
|
2822
|
-
"data-testid": "order-summary-receive-returns-menu",
|
|
2823
|
-
children: /* @__PURE__ */ jsx17(Button8, { variant: "secondary", size: "small", children: t("orders.returns.receive.action") })
|
|
2824
|
-
}
|
|
2825
|
-
)),
|
|
2826
|
-
showAllocateButton && /* @__PURE__ */ jsx17(
|
|
2827
|
-
Button8,
|
|
2828
|
-
{
|
|
2829
|
-
asChild: true,
|
|
2830
|
-
variant: "secondary",
|
|
2831
|
-
size: "small",
|
|
2832
|
-
"data-testid": "order-summary-allocate-items-button",
|
|
2833
|
-
children: /* @__PURE__ */ jsx17(Link3, { to: "allocate-items", children: t("orders.allocateItems.action") })
|
|
2834
|
-
}
|
|
2835
|
-
),
|
|
2836
|
-
showPayment && /* @__PURE__ */ jsx17(
|
|
2837
|
-
Button8,
|
|
2658
|
+
showPayment && /* @__PURE__ */ jsx18(
|
|
2659
|
+
Button7,
|
|
2838
2660
|
{
|
|
2839
2661
|
size: "small",
|
|
2840
2662
|
variant: "secondary",
|
|
@@ -2843,14 +2665,14 @@ var OrderSummarySection = ({ order }) => {
|
|
|
2843
2665
|
children: t("orders.payment.markAsPaid")
|
|
2844
2666
|
}
|
|
2845
2667
|
),
|
|
2846
|
-
showRefund && /* @__PURE__ */
|
|
2847
|
-
|
|
2668
|
+
showRefund && /* @__PURE__ */ jsx18(
|
|
2669
|
+
Button7,
|
|
2848
2670
|
{
|
|
2849
2671
|
size: "small",
|
|
2850
2672
|
variant: "secondary",
|
|
2851
2673
|
asChild: true,
|
|
2852
2674
|
"data-testid": "order-summary-refund-button",
|
|
2853
|
-
children: /* @__PURE__ */
|
|
2675
|
+
children: /* @__PURE__ */ jsx18(Link3, { to: `/orders/${order.id}/refund`, children: t("orders.payment.refundAmount", {
|
|
2854
2676
|
amount: getStylizedAmount(
|
|
2855
2677
|
pendingDifference * -1,
|
|
2856
2678
|
order?.currency_code
|
|
@@ -2869,20 +2691,20 @@ var Header3 = ({
|
|
|
2869
2691
|
order,
|
|
2870
2692
|
orderPreview
|
|
2871
2693
|
}) => {
|
|
2872
|
-
const { t } =
|
|
2694
|
+
const { t } = useTranslation18();
|
|
2873
2695
|
const shouldDisableReturn = order.items.every(
|
|
2874
2696
|
(i) => !(getReturnableQuantity(i) > 0)
|
|
2875
2697
|
);
|
|
2876
2698
|
const isOrderEditActive = orderPreview?.order_change?.change_type === "edit";
|
|
2877
2699
|
const isOrderEditPending = orderPreview?.order_change?.change_type === "edit" && orderPreview?.order_change?.status === "pending";
|
|
2878
|
-
return /* @__PURE__ */
|
|
2700
|
+
return /* @__PURE__ */ jsxs18(
|
|
2879
2701
|
"div",
|
|
2880
2702
|
{
|
|
2881
2703
|
className: "flex items-center justify-between px-6 py-4",
|
|
2882
2704
|
"data-testid": "order-summary-header",
|
|
2883
2705
|
children: [
|
|
2884
|
-
/* @__PURE__ */
|
|
2885
|
-
/* @__PURE__ */
|
|
2706
|
+
/* @__PURE__ */ jsx18(Heading11, { level: "h2", "data-testid": "order-summary-heading", children: t("fields.summary") }),
|
|
2707
|
+
/* @__PURE__ */ jsx18(
|
|
2886
2708
|
ActionMenu,
|
|
2887
2709
|
{
|
|
2888
2710
|
groups: [
|
|
@@ -2893,7 +2715,7 @@ var Header3 = ({
|
|
|
2893
2715
|
isOrderEditPending ? "orders.summary.editOrderContinue" : "orders.summary.editOrder"
|
|
2894
2716
|
),
|
|
2895
2717
|
to: `/orders/${order.id}/edits`,
|
|
2896
|
-
icon: /* @__PURE__ */
|
|
2718
|
+
icon: /* @__PURE__ */ jsx18(PencilSquare, {}),
|
|
2897
2719
|
disabled: order.status === "canceled" || orderPreview?.order_change && orderPreview?.order_change?.change_type !== "edit" || orderPreview?.order_change?.change_type === "edit" && orderPreview?.order_change?.status === "requested"
|
|
2898
2720
|
}
|
|
2899
2721
|
]
|
|
@@ -2903,19 +2725,19 @@ var Header3 = ({
|
|
|
2903
2725
|
{
|
|
2904
2726
|
label: t("orders.returns.create"),
|
|
2905
2727
|
to: `/orders/${order.id}/returns`,
|
|
2906
|
-
icon: /* @__PURE__ */
|
|
2728
|
+
icon: /* @__PURE__ */ jsx18(ArrowUturnLeft2, {}),
|
|
2907
2729
|
disabled: shouldDisableReturn || isOrderEditActive || !!orderPreview?.order_change?.exchange_id || !!orderPreview?.order_change?.claim_id
|
|
2908
2730
|
},
|
|
2909
2731
|
{
|
|
2910
2732
|
label: orderPreview?.order_change?.id && orderPreview?.order_change?.exchange_id ? t("orders.exchanges.manage") : t("orders.exchanges.create"),
|
|
2911
2733
|
to: `/orders/${order.id}/exchanges`,
|
|
2912
|
-
icon: /* @__PURE__ */
|
|
2734
|
+
icon: /* @__PURE__ */ jsx18(ArrowPath3, {}),
|
|
2913
2735
|
disabled: shouldDisableReturn || isOrderEditActive || !!orderPreview?.order_change?.return_id && !orderPreview?.order_change?.exchange_id || !!orderPreview?.order_change?.claim_id
|
|
2914
2736
|
},
|
|
2915
2737
|
{
|
|
2916
2738
|
label: orderPreview?.order_change?.id && orderPreview?.order_change?.claim_id ? t("orders.claims.manage") : t("orders.claims.create"),
|
|
2917
2739
|
to: `/orders/${order.id}/claims`,
|
|
2918
|
-
icon: /* @__PURE__ */
|
|
2740
|
+
icon: /* @__PURE__ */ jsx18(ExclamationCircle2, {}),
|
|
2919
2741
|
disabled: shouldDisableReturn || isOrderEditActive || !!orderPreview?.order_change?.return_id && !orderPreview?.order_change?.claim_id || !!orderPreview?.order_change?.exchange_id
|
|
2920
2742
|
}
|
|
2921
2743
|
]
|
|
@@ -2936,27 +2758,30 @@ var Item = ({
|
|
|
2936
2758
|
claims,
|
|
2937
2759
|
exchanges
|
|
2938
2760
|
}) => {
|
|
2939
|
-
const { t } =
|
|
2940
|
-
const
|
|
2941
|
-
const
|
|
2761
|
+
const { t } = useTranslation18();
|
|
2762
|
+
const offerInventoryLinks = item.offer?.inventory_item_link ?? [];
|
|
2763
|
+
const isInventoryManaged = !!offerInventoryLinks.length;
|
|
2764
|
+
const hasInventoryKit = (item.variant?.inventory_items?.length || 0) > 1 || item.variant?.inventory_items?.some((i) => i.required_quantity > 1);
|
|
2942
2765
|
const hasUnfulfilledItems = item.quantity - item.detail.fulfilled_quantity > 0;
|
|
2943
|
-
|
|
2944
|
-
|
|
2766
|
+
const offerSku = item.offer?.sku ?? null;
|
|
2767
|
+
const captionSku = offerSku ?? item.variant_sku ?? null;
|
|
2768
|
+
return /* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
2769
|
+
/* @__PURE__ */ jsxs18(
|
|
2945
2770
|
"div",
|
|
2946
2771
|
{
|
|
2947
2772
|
className: "text-ui-fg-subtle grid grid-cols-2 items-center gap-x-4 px-6 py-4",
|
|
2948
2773
|
"data-testid": `order-summary-item-${item.id}`,
|
|
2949
2774
|
children: [
|
|
2950
|
-
/* @__PURE__ */
|
|
2775
|
+
/* @__PURE__ */ jsxs18(
|
|
2951
2776
|
"div",
|
|
2952
2777
|
{
|
|
2953
2778
|
className: "flex items-start gap-x-4",
|
|
2954
2779
|
"data-testid": `order-summary-item-${item.id}-info`,
|
|
2955
2780
|
children: [
|
|
2956
|
-
/* @__PURE__ */
|
|
2957
|
-
/* @__PURE__ */
|
|
2958
|
-
/* @__PURE__ */
|
|
2959
|
-
|
|
2781
|
+
/* @__PURE__ */ jsx18(Thumbnail, { src: item.thumbnail }),
|
|
2782
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
2783
|
+
/* @__PURE__ */ jsx18(
|
|
2784
|
+
Text13,
|
|
2960
2785
|
{
|
|
2961
2786
|
size: "small",
|
|
2962
2787
|
leading: "compact",
|
|
@@ -2965,19 +2790,19 @@ var Item = ({
|
|
|
2965
2790
|
children: item.title
|
|
2966
2791
|
}
|
|
2967
2792
|
),
|
|
2968
|
-
|
|
2793
|
+
captionSku && /* @__PURE__ */ jsxs18(
|
|
2969
2794
|
"div",
|
|
2970
2795
|
{
|
|
2971
2796
|
className: "flex items-center gap-x-1",
|
|
2972
2797
|
"data-testid": `order-summary-item-${item.id}-sku`,
|
|
2973
2798
|
children: [
|
|
2974
|
-
/* @__PURE__ */
|
|
2975
|
-
/* @__PURE__ */
|
|
2799
|
+
/* @__PURE__ */ jsx18(Text13, { size: "small", children: captionSku }),
|
|
2800
|
+
/* @__PURE__ */ jsx18(Copy5, { content: captionSku, className: "text-ui-fg-muted" })
|
|
2976
2801
|
]
|
|
2977
2802
|
}
|
|
2978
2803
|
),
|
|
2979
|
-
/* @__PURE__ */
|
|
2980
|
-
|
|
2804
|
+
/* @__PURE__ */ jsx18(
|
|
2805
|
+
Text13,
|
|
2981
2806
|
{
|
|
2982
2807
|
size: "small",
|
|
2983
2808
|
"data-testid": `order-summary-item-${item.id}-options`,
|
|
@@ -2988,31 +2813,31 @@ var Item = ({
|
|
|
2988
2813
|
]
|
|
2989
2814
|
}
|
|
2990
2815
|
),
|
|
2991
|
-
/* @__PURE__ */
|
|
2816
|
+
/* @__PURE__ */ jsxs18(
|
|
2992
2817
|
"div",
|
|
2993
2818
|
{
|
|
2994
2819
|
className: "grid grid-cols-3 items-center gap-x-4",
|
|
2995
2820
|
"data-testid": `order-summary-item-${item.id}-pricing`,
|
|
2996
2821
|
children: [
|
|
2997
|
-
/* @__PURE__ */
|
|
2998
|
-
|
|
2822
|
+
/* @__PURE__ */ jsx18("div", { className: "flex items-center justify-end gap-x-4", children: /* @__PURE__ */ jsx18(
|
|
2823
|
+
Text13,
|
|
2999
2824
|
{
|
|
3000
2825
|
size: "small",
|
|
3001
2826
|
"data-testid": `order-summary-item-${item.id}-unit-price`,
|
|
3002
2827
|
children: getLocaleAmount(item.unit_price, currencyCode)
|
|
3003
2828
|
}
|
|
3004
2829
|
) }),
|
|
3005
|
-
/* @__PURE__ */
|
|
2830
|
+
/* @__PURE__ */ jsxs18(
|
|
3006
2831
|
"div",
|
|
3007
2832
|
{
|
|
3008
2833
|
className: "flex items-center gap-x-2",
|
|
3009
2834
|
"data-testid": `order-summary-item-${item.id}-quantity`,
|
|
3010
2835
|
children: [
|
|
3011
|
-
/* @__PURE__ */
|
|
3012
|
-
/* @__PURE__ */
|
|
2836
|
+
/* @__PURE__ */ jsx18("div", { className: "w-fit min-w-[27px]", children: /* @__PURE__ */ jsxs18(Text13, { size: "small", children: [
|
|
2837
|
+
/* @__PURE__ */ jsx18("span", { className: "tabular-nums", children: item.quantity }),
|
|
3013
2838
|
"x"
|
|
3014
2839
|
] }) }),
|
|
3015
|
-
/* @__PURE__ */
|
|
2840
|
+
/* @__PURE__ */ jsx18("div", { className: "overflow-visible", children: isInventoryManaged && hasUnfulfilledItems && /* @__PURE__ */ jsx18(
|
|
3016
2841
|
StatusBadge4,
|
|
3017
2842
|
{
|
|
3018
2843
|
color: reservation ? "green" : "orange",
|
|
@@ -3024,8 +2849,8 @@ var Item = ({
|
|
|
3024
2849
|
]
|
|
3025
2850
|
}
|
|
3026
2851
|
),
|
|
3027
|
-
/* @__PURE__ */
|
|
3028
|
-
|
|
2852
|
+
/* @__PURE__ */ jsx18("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx18(
|
|
2853
|
+
Text13,
|
|
3029
2854
|
{
|
|
3030
2855
|
size: "small",
|
|
3031
2856
|
className: "pt-[1px]",
|
|
@@ -3040,10 +2865,10 @@ var Item = ({
|
|
|
3040
2865
|
},
|
|
3041
2866
|
item.id
|
|
3042
2867
|
),
|
|
3043
|
-
hasInventoryKit && /* @__PURE__ */
|
|
3044
|
-
returns.map((r) => /* @__PURE__ */
|
|
3045
|
-
claims.map((claim) => /* @__PURE__ */
|
|
3046
|
-
exchanges.map((exchange) => /* @__PURE__ */
|
|
2868
|
+
hasInventoryKit && /* @__PURE__ */ jsx18(InventoryKitBreakdown, { item }),
|
|
2869
|
+
returns.map((r) => /* @__PURE__ */ jsx18(ReturnBreakdown, { orderReturn: r, itemId: item.id }, r.id)),
|
|
2870
|
+
claims.map((claim) => /* @__PURE__ */ jsx18(ClaimBreakdown, { claim, itemId: item.id }, claim.id)),
|
|
2871
|
+
exchanges.map((exchange) => /* @__PURE__ */ jsx18(
|
|
3047
2872
|
ExchangeBreakdown,
|
|
3048
2873
|
{
|
|
3049
2874
|
exchange,
|
|
@@ -3069,13 +2894,13 @@ var ItemBreakdown = ({
|
|
|
3069
2894
|
order_id: order.id,
|
|
3070
2895
|
fields: "*items,*items.reason"
|
|
3071
2896
|
});
|
|
3072
|
-
const reservationsMap =
|
|
2897
|
+
const reservationsMap = useMemo4(
|
|
3073
2898
|
() => new Map((reservations || []).map((r) => [r.line_item_id, r])),
|
|
3074
2899
|
[reservations]
|
|
3075
2900
|
);
|
|
3076
|
-
return /* @__PURE__ */
|
|
2901
|
+
return /* @__PURE__ */ jsx18("div", { "data-testid": "order-summary-items-breakdown", children: order.items?.map((item) => {
|
|
3077
2902
|
const reservation = reservationsMap.get(item.id);
|
|
3078
|
-
return /* @__PURE__ */
|
|
2903
|
+
return /* @__PURE__ */ jsx18(
|
|
3079
2904
|
Item,
|
|
3080
2905
|
{
|
|
3081
2906
|
item,
|
|
@@ -3094,22 +2919,22 @@ var Cost = ({
|
|
|
3094
2919
|
value,
|
|
3095
2920
|
secondaryValue,
|
|
3096
2921
|
tooltip
|
|
3097
|
-
}) => /* @__PURE__ */
|
|
3098
|
-
/* @__PURE__ */
|
|
2922
|
+
}) => /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-3 items-center", children: [
|
|
2923
|
+
/* @__PURE__ */ jsxs18(Text13, { size: "small", leading: "compact", children: [
|
|
3099
2924
|
label,
|
|
3100
2925
|
" ",
|
|
3101
2926
|
tooltip
|
|
3102
2927
|
] }),
|
|
3103
|
-
/* @__PURE__ */
|
|
3104
|
-
/* @__PURE__ */
|
|
2928
|
+
/* @__PURE__ */ jsx18("div", { className: "text-right", children: /* @__PURE__ */ jsx18(Text13, { size: "small", leading: "compact", children: secondaryValue }) }),
|
|
2929
|
+
/* @__PURE__ */ jsx18("div", { className: "text-right", children: /* @__PURE__ */ jsx18(Text13, { size: "small", leading: "compact", children: value }) })
|
|
3105
2930
|
] });
|
|
3106
2931
|
var CostBreakdown = ({
|
|
3107
2932
|
order
|
|
3108
2933
|
}) => {
|
|
3109
|
-
const { t } =
|
|
2934
|
+
const { t } = useTranslation18();
|
|
3110
2935
|
const [isTaxOpen, setIsTaxOpen] = useState6(false);
|
|
3111
2936
|
const [isShippingOpen, setIsShippingOpen] = useState6(false);
|
|
3112
|
-
const taxCodes =
|
|
2937
|
+
const taxCodes = useMemo4(() => {
|
|
3113
2938
|
const taxCodeMap = {};
|
|
3114
2939
|
order.items.forEach((item) => {
|
|
3115
2940
|
item.tax_lines?.forEach((line) => {
|
|
@@ -3134,32 +2959,32 @@ var CostBreakdown = ({
|
|
|
3134
2959
|
return taxCodeMap;
|
|
3135
2960
|
}, [order]);
|
|
3136
2961
|
const hasTaxes = !!Object.keys(taxCodes).length;
|
|
3137
|
-
return /* @__PURE__ */
|
|
2962
|
+
return /* @__PURE__ */ jsxs18(
|
|
3138
2963
|
"div",
|
|
3139
2964
|
{
|
|
3140
2965
|
className: "text-ui-fg-subtle flex flex-col gap-y-2 px-6 py-4",
|
|
3141
2966
|
"data-testid": "order-summary-cost-breakdown",
|
|
3142
2967
|
children: [
|
|
3143
|
-
/* @__PURE__ */
|
|
2968
|
+
/* @__PURE__ */ jsx18(
|
|
3144
2969
|
Cost,
|
|
3145
2970
|
{
|
|
3146
2971
|
label: t("orders.summary.itemSubtotal"),
|
|
3147
2972
|
value: getLocaleAmount(order.item_subtotal, order.currency_code)
|
|
3148
2973
|
}
|
|
3149
2974
|
),
|
|
3150
|
-
/* @__PURE__ */
|
|
2975
|
+
/* @__PURE__ */ jsx18(
|
|
3151
2976
|
Cost,
|
|
3152
2977
|
{
|
|
3153
2978
|
label: (
|
|
3154
2979
|
// oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
3155
|
-
/* @__PURE__ */
|
|
2980
|
+
/* @__PURE__ */ jsxs18(
|
|
3156
2981
|
"span",
|
|
3157
2982
|
{
|
|
3158
2983
|
onClick: () => setIsShippingOpen((o) => !o),
|
|
3159
2984
|
className: "flex cursor-pointer items-center gap-1",
|
|
3160
2985
|
children: [
|
|
3161
|
-
/* @__PURE__ */
|
|
3162
|
-
/* @__PURE__ */
|
|
2986
|
+
/* @__PURE__ */ jsx18("span", { children: t("orders.summary.shippingSubtotal") }),
|
|
2987
|
+
/* @__PURE__ */ jsx18(
|
|
3163
2988
|
TriangleDownMini,
|
|
3164
2989
|
{
|
|
3165
2990
|
style: {
|
|
@@ -3174,30 +2999,30 @@ var CostBreakdown = ({
|
|
|
3174
2999
|
value: getLocaleAmount(order.shipping_subtotal, order.currency_code)
|
|
3175
3000
|
}
|
|
3176
3001
|
),
|
|
3177
|
-
isShippingOpen && /* @__PURE__ */
|
|
3002
|
+
isShippingOpen && /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-1 pl-5", children: (order.shipping_methods || []).sort(
|
|
3178
3003
|
(m1, m2) => m1.created_at.localeCompare(m2.created_at)
|
|
3179
3004
|
).map((sm, i) => {
|
|
3180
|
-
return /* @__PURE__ */
|
|
3005
|
+
return /* @__PURE__ */ jsxs18(
|
|
3181
3006
|
"div",
|
|
3182
3007
|
{
|
|
3183
3008
|
className: "flex items-center justify-between gap-x-2",
|
|
3184
3009
|
children: [
|
|
3185
|
-
/* @__PURE__ */
|
|
3010
|
+
/* @__PURE__ */ jsx18("div", { children: /* @__PURE__ */ jsxs18("span", { className: "txt-small", children: [
|
|
3186
3011
|
sm.name,
|
|
3187
3012
|
sm.detail.return_id && ` (${t("fields.returnShipping")})`,
|
|
3188
3013
|
" ",
|
|
3189
|
-
/* @__PURE__ */
|
|
3014
|
+
/* @__PURE__ */ jsx18(shipping_info_popover_default, { shippingMethod: sm }, i)
|
|
3190
3015
|
] }) }),
|
|
3191
|
-
/* @__PURE__ */
|
|
3192
|
-
/* @__PURE__ */
|
|
3016
|
+
/* @__PURE__ */ jsx18("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx18("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
3017
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(sm.subtotal, order.currency_code) })
|
|
3193
3018
|
]
|
|
3194
3019
|
},
|
|
3195
3020
|
sm.id
|
|
3196
3021
|
);
|
|
3197
3022
|
}) }),
|
|
3198
|
-
/* @__PURE__ */
|
|
3199
|
-
/* @__PURE__ */
|
|
3200
|
-
/* @__PURE__ */
|
|
3023
|
+
/* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
3024
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex justify-between", children: [
|
|
3025
|
+
/* @__PURE__ */ jsxs18(
|
|
3201
3026
|
"div",
|
|
3202
3027
|
{
|
|
3203
3028
|
onClick: () => hasTaxes && setIsTaxOpen((o) => !o),
|
|
@@ -3205,8 +3030,8 @@ var CostBreakdown = ({
|
|
|
3205
3030
|
"cursor-pointer": hasTaxes
|
|
3206
3031
|
}),
|
|
3207
3032
|
children: [
|
|
3208
|
-
/* @__PURE__ */
|
|
3209
|
-
hasTaxes && /* @__PURE__ */
|
|
3033
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small select-none", children: t("orders.summary.taxTotal") }),
|
|
3034
|
+
hasTaxes && /* @__PURE__ */ jsx18(
|
|
3210
3035
|
TriangleDownMini,
|
|
3211
3036
|
{
|
|
3212
3037
|
style: {
|
|
@@ -3217,34 +3042,34 @@ var CostBreakdown = ({
|
|
|
3217
3042
|
]
|
|
3218
3043
|
}
|
|
3219
3044
|
),
|
|
3220
|
-
/* @__PURE__ */
|
|
3045
|
+
/* @__PURE__ */ jsx18("div", { className: "text-right", children: /* @__PURE__ */ jsx18(Text13, { size: "small", leading: "compact", children: getLocaleAmount(order.original_tax_total, order.currency_code) }) })
|
|
3221
3046
|
] }),
|
|
3222
|
-
isTaxOpen && /* @__PURE__ */
|
|
3223
|
-
return /* @__PURE__ */
|
|
3047
|
+
isTaxOpen && /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-1 pl-5", children: Object.entries(taxCodes).map(([code, { total, rate }]) => {
|
|
3048
|
+
return /* @__PURE__ */ jsxs18(
|
|
3224
3049
|
"div",
|
|
3225
3050
|
{
|
|
3226
3051
|
className: "flex items-center justify-between gap-x-2",
|
|
3227
3052
|
children: [
|
|
3228
|
-
/* @__PURE__ */
|
|
3229
|
-
/* @__PURE__ */
|
|
3230
|
-
/* @__PURE__ */
|
|
3053
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex gap-1", children: [
|
|
3054
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small", children: code }),
|
|
3055
|
+
/* @__PURE__ */ jsxs18("span", { className: "txt-small", children: [
|
|
3231
3056
|
"(",
|
|
3232
3057
|
formatPercentage(rate),
|
|
3233
3058
|
")"
|
|
3234
3059
|
] })
|
|
3235
3060
|
] }),
|
|
3236
|
-
/* @__PURE__ */
|
|
3237
|
-
/* @__PURE__ */
|
|
3061
|
+
/* @__PURE__ */ jsx18("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx18("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
3062
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(total, order.currency_code) })
|
|
3238
3063
|
]
|
|
3239
3064
|
},
|
|
3240
3065
|
code
|
|
3241
3066
|
);
|
|
3242
3067
|
}) })
|
|
3243
3068
|
] }),
|
|
3244
|
-
/* @__PURE__ */
|
|
3245
|
-
/* @__PURE__ */
|
|
3246
|
-
/* @__PURE__ */
|
|
3247
|
-
|
|
3069
|
+
/* @__PURE__ */ jsxs18("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
3070
|
+
/* @__PURE__ */ jsx18(Text13, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: t("fields.total") }),
|
|
3071
|
+
/* @__PURE__ */ jsx18(
|
|
3072
|
+
Text13,
|
|
3248
3073
|
{
|
|
3249
3074
|
className: "text-ui-fg-subtle text-bold",
|
|
3250
3075
|
size: "small",
|
|
@@ -3260,11 +3085,11 @@ var CostBreakdown = ({
|
|
|
3260
3085
|
var DiscountAndTotalBreakdown = ({
|
|
3261
3086
|
order
|
|
3262
3087
|
}) => {
|
|
3263
|
-
const { t } =
|
|
3088
|
+
const { t } = useTranslation18();
|
|
3264
3089
|
const [isDiscountOpen, setIsDiscountOpen] = useState6(false);
|
|
3265
3090
|
const [isCreditLinesOpen, setIsCreditLinesOpen] = useState6(false);
|
|
3266
3091
|
const creditLines = order.credit_lines ?? [];
|
|
3267
|
-
const discounts =
|
|
3092
|
+
const discounts = useMemo4(() => {
|
|
3268
3093
|
const discounts2 = [];
|
|
3269
3094
|
if (order.item_discount_total) {
|
|
3270
3095
|
discounts2.push({
|
|
@@ -3292,18 +3117,18 @@ var DiscountAndTotalBreakdown = ({
|
|
|
3292
3117
|
}, [order]);
|
|
3293
3118
|
const hasDiscount = discounts.length > 0;
|
|
3294
3119
|
const hasCreditLines = creditLines.length > 0;
|
|
3295
|
-
return /* @__PURE__ */
|
|
3120
|
+
return /* @__PURE__ */ jsxs18(
|
|
3296
3121
|
"div",
|
|
3297
3122
|
{
|
|
3298
3123
|
className: "text-ui-fg-subtle flex flex-col gap-y-2 px-6 py-4",
|
|
3299
3124
|
"data-testid": "order-summary-discount-breakdown",
|
|
3300
3125
|
children: [
|
|
3301
|
-
/* @__PURE__ */
|
|
3126
|
+
/* @__PURE__ */ jsx18(
|
|
3302
3127
|
Cost,
|
|
3303
3128
|
{
|
|
3304
3129
|
label: (
|
|
3305
3130
|
// oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
3306
|
-
/* @__PURE__ */
|
|
3131
|
+
/* @__PURE__ */ jsxs18(
|
|
3307
3132
|
"span",
|
|
3308
3133
|
{
|
|
3309
3134
|
onClick: () => hasDiscount && setIsDiscountOpen((o) => !o),
|
|
@@ -3312,8 +3137,8 @@ var DiscountAndTotalBreakdown = ({
|
|
|
3312
3137
|
}),
|
|
3313
3138
|
"data-testid": "order-summary-discount-toggle",
|
|
3314
3139
|
children: [
|
|
3315
|
-
/* @__PURE__ */
|
|
3316
|
-
hasDiscount && /* @__PURE__ */
|
|
3140
|
+
/* @__PURE__ */ jsx18("span", { children: t("orders.summary.discountTotal") }),
|
|
3141
|
+
hasDiscount && /* @__PURE__ */ jsx18(
|
|
3317
3142
|
TriangleDownMini,
|
|
3318
3143
|
{
|
|
3319
3144
|
style: {
|
|
@@ -3328,41 +3153,41 @@ var DiscountAndTotalBreakdown = ({
|
|
|
3328
3153
|
value: getLocaleAmount(order.discount_total, order.currency_code)
|
|
3329
3154
|
}
|
|
3330
3155
|
),
|
|
3331
|
-
isDiscountOpen && /* @__PURE__ */
|
|
3332
|
-
return /* @__PURE__ */
|
|
3156
|
+
isDiscountOpen && /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-1 pl-5", children: discounts.map(({ type, total, codes }) => {
|
|
3157
|
+
return /* @__PURE__ */ jsxs18(
|
|
3333
3158
|
"div",
|
|
3334
3159
|
{
|
|
3335
3160
|
className: "flex items-center justify-between gap-x-2",
|
|
3336
3161
|
children: [
|
|
3337
|
-
/* @__PURE__ */
|
|
3338
|
-
/* @__PURE__ */
|
|
3339
|
-
/* @__PURE__ */
|
|
3162
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex gap-1", children: [
|
|
3163
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small", children: t(`fields.${type}`) }),
|
|
3164
|
+
/* @__PURE__ */ jsxs18("span", { className: "txt-small", children: [
|
|
3340
3165
|
"(",
|
|
3341
3166
|
codes.join(", "),
|
|
3342
3167
|
")"
|
|
3343
3168
|
] })
|
|
3344
3169
|
] }),
|
|
3345
|
-
/* @__PURE__ */
|
|
3346
|
-
/* @__PURE__ */
|
|
3170
|
+
/* @__PURE__ */ jsx18("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx18("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
3171
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(total, order.currency_code) })
|
|
3347
3172
|
]
|
|
3348
3173
|
},
|
|
3349
3174
|
type
|
|
3350
3175
|
);
|
|
3351
3176
|
}) }),
|
|
3352
|
-
hasCreditLines && /* @__PURE__ */
|
|
3353
|
-
/* @__PURE__ */
|
|
3177
|
+
hasCreditLines && /* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
3178
|
+
/* @__PURE__ */ jsx18(
|
|
3354
3179
|
Cost,
|
|
3355
3180
|
{
|
|
3356
3181
|
label: (
|
|
3357
3182
|
// oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
3358
|
-
/* @__PURE__ */
|
|
3183
|
+
/* @__PURE__ */ jsxs18(
|
|
3359
3184
|
"span",
|
|
3360
3185
|
{
|
|
3361
3186
|
onClick: () => setIsCreditLinesOpen((o) => !o),
|
|
3362
3187
|
className: "flex cursor-pointer items-center gap-1",
|
|
3363
3188
|
children: [
|
|
3364
|
-
/* @__PURE__ */
|
|
3365
|
-
/* @__PURE__ */
|
|
3189
|
+
/* @__PURE__ */ jsx18("span", { children: t("orders.creditLines.title") }),
|
|
3190
|
+
/* @__PURE__ */ jsx18(
|
|
3366
3191
|
TriangleDownMini,
|
|
3367
3192
|
{
|
|
3368
3193
|
style: {
|
|
@@ -3380,34 +3205,34 @@ var DiscountAndTotalBreakdown = ({
|
|
|
3380
3205
|
)
|
|
3381
3206
|
}
|
|
3382
3207
|
),
|
|
3383
|
-
isCreditLinesOpen && /* @__PURE__ */
|
|
3208
|
+
isCreditLinesOpen && /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-1 pl-5", children: creditLines.map((creditLine) => {
|
|
3384
3209
|
const prettyReference = creditLine.reference?.split("_").join(" ").split("-").join(" ");
|
|
3385
|
-
return /* @__PURE__ */
|
|
3210
|
+
return /* @__PURE__ */ jsxs18(
|
|
3386
3211
|
"div",
|
|
3387
3212
|
{
|
|
3388
3213
|
className: "flex items-center justify-between gap-x-2",
|
|
3389
3214
|
children: [
|
|
3390
|
-
/* @__PURE__ */
|
|
3391
|
-
/* @__PURE__ */
|
|
3392
|
-
|
|
3215
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center", children: [
|
|
3216
|
+
/* @__PURE__ */ jsx18(
|
|
3217
|
+
Text13,
|
|
3393
3218
|
{
|
|
3394
3219
|
size: "small",
|
|
3395
3220
|
leading: "compact",
|
|
3396
3221
|
weight: "plus",
|
|
3397
3222
|
className: "txt-small text-ui-fg-subtle font-medium",
|
|
3398
|
-
children: /* @__PURE__ */
|
|
3223
|
+
children: /* @__PURE__ */ jsx18(display_id_default, { id: creditLine.id })
|
|
3399
3224
|
}
|
|
3400
3225
|
),
|
|
3401
|
-
/* @__PURE__ */
|
|
3402
|
-
/* @__PURE__ */
|
|
3226
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small text-ui-fg-subtle mx-1", children: "-" }),
|
|
3227
|
+
/* @__PURE__ */ jsx18(
|
|
3403
3228
|
Tooltip6,
|
|
3404
3229
|
{
|
|
3405
3230
|
content: format3(
|
|
3406
3231
|
new Date(creditLine.created_at),
|
|
3407
3232
|
"dd MMM, yyyy, HH:mm:ss"
|
|
3408
3233
|
),
|
|
3409
|
-
children: /* @__PURE__ */
|
|
3410
|
-
|
|
3234
|
+
children: /* @__PURE__ */ jsx18(
|
|
3235
|
+
Text13,
|
|
3411
3236
|
{
|
|
3412
3237
|
size: "small",
|
|
3413
3238
|
leading: "compact",
|
|
@@ -3420,9 +3245,9 @@ var DiscountAndTotalBreakdown = ({
|
|
|
3420
3245
|
)
|
|
3421
3246
|
}
|
|
3422
3247
|
),
|
|
3423
|
-
/* @__PURE__ */
|
|
3424
|
-
/* @__PURE__ */
|
|
3425
|
-
|
|
3248
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small text-ui-fg-subtle mx-1", children: "-" }),
|
|
3249
|
+
/* @__PURE__ */ jsxs18(
|
|
3250
|
+
Text13,
|
|
3426
3251
|
{
|
|
3427
3252
|
size: "small",
|
|
3428
3253
|
leading: "compact",
|
|
@@ -3435,8 +3260,8 @@ var DiscountAndTotalBreakdown = ({
|
|
|
3435
3260
|
}
|
|
3436
3261
|
)
|
|
3437
3262
|
] }),
|
|
3438
|
-
/* @__PURE__ */
|
|
3439
|
-
/* @__PURE__ */
|
|
3263
|
+
/* @__PURE__ */ jsx18("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx18("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
3264
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(
|
|
3440
3265
|
creditLine.amount,
|
|
3441
3266
|
order.currency_code
|
|
3442
3267
|
) })
|
|
@@ -3446,10 +3271,10 @@ var DiscountAndTotalBreakdown = ({
|
|
|
3446
3271
|
);
|
|
3447
3272
|
}) })
|
|
3448
3273
|
] }),
|
|
3449
|
-
/* @__PURE__ */
|
|
3450
|
-
/* @__PURE__ */
|
|
3451
|
-
/* @__PURE__ */
|
|
3452
|
-
|
|
3274
|
+
/* @__PURE__ */ jsxs18("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
3275
|
+
/* @__PURE__ */ jsx18(Text13, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: t("orders.summary.totalAfterDiscount") }),
|
|
3276
|
+
/* @__PURE__ */ jsx18(
|
|
3277
|
+
Text13,
|
|
3453
3278
|
{
|
|
3454
3279
|
className: "text-ui-fg-subtle text-bold",
|
|
3455
3280
|
size: "small",
|
|
@@ -3463,17 +3288,17 @@ var DiscountAndTotalBreakdown = ({
|
|
|
3463
3288
|
);
|
|
3464
3289
|
};
|
|
3465
3290
|
var InventoryKitBreakdown = ({ item }) => {
|
|
3466
|
-
const { t } =
|
|
3291
|
+
const { t } = useTranslation18();
|
|
3467
3292
|
const [isOpen, setIsOpen] = useState6(false);
|
|
3468
3293
|
const inventory = item.variant?.inventory_items || [];
|
|
3469
|
-
return /* @__PURE__ */
|
|
3470
|
-
/* @__PURE__ */
|
|
3294
|
+
return /* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
3295
|
+
/* @__PURE__ */ jsxs18(
|
|
3471
3296
|
"div",
|
|
3472
3297
|
{
|
|
3473
3298
|
onClick: () => setIsOpen((o) => !o),
|
|
3474
3299
|
className: "flex cursor-pointer items-center gap-2 border-t border-dashed px-6 py-4",
|
|
3475
3300
|
children: [
|
|
3476
|
-
/* @__PURE__ */
|
|
3301
|
+
/* @__PURE__ */ jsx18(
|
|
3477
3302
|
TriangleDownMini,
|
|
3478
3303
|
{
|
|
3479
3304
|
style: {
|
|
@@ -3481,26 +3306,26 @@ var InventoryKitBreakdown = ({ item }) => {
|
|
|
3481
3306
|
}
|
|
3482
3307
|
}
|
|
3483
3308
|
),
|
|
3484
|
-
/* @__PURE__ */
|
|
3309
|
+
/* @__PURE__ */ jsx18("span", { className: "text-ui-fg-muted txt-small select-none", children: t("orders.summary.inventoryKit", { count: inventory.length }) })
|
|
3485
3310
|
]
|
|
3486
3311
|
}
|
|
3487
3312
|
),
|
|
3488
|
-
isOpen && /* @__PURE__ */
|
|
3489
|
-
return /* @__PURE__ */
|
|
3313
|
+
isOpen && /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-1 px-6 pb-4", children: inventory.map((i) => {
|
|
3314
|
+
return /* @__PURE__ */ jsxs18(
|
|
3490
3315
|
"div",
|
|
3491
3316
|
{
|
|
3492
3317
|
className: "flex items-center justify-between gap-x-2",
|
|
3493
3318
|
children: [
|
|
3494
|
-
/* @__PURE__ */
|
|
3319
|
+
/* @__PURE__ */ jsx18("div", { children: /* @__PURE__ */ jsxs18("span", { className: "txt-small text-ui-fg-subtle font-medium", children: [
|
|
3495
3320
|
i.inventory.title,
|
|
3496
|
-
i.inventory.sku && /* @__PURE__ */
|
|
3321
|
+
i.inventory.sku && /* @__PURE__ */ jsxs18("span", { className: "text-ui-fg-subtle font-normal", children: [
|
|
3497
3322
|
" ",
|
|
3498
3323
|
"\u22C5 ",
|
|
3499
3324
|
i.inventory.sku
|
|
3500
3325
|
] })
|
|
3501
3326
|
] }) }),
|
|
3502
|
-
/* @__PURE__ */
|
|
3503
|
-
/* @__PURE__ */
|
|
3327
|
+
/* @__PURE__ */ jsx18("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx18("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
3328
|
+
/* @__PURE__ */ jsxs18("span", { className: "txt-small text-ui-fg-muted", children: [
|
|
3504
3329
|
i.required_quantity,
|
|
3505
3330
|
"x"
|
|
3506
3331
|
] })
|
|
@@ -3515,21 +3340,21 @@ var ReturnBreakdownWithDamages = ({
|
|
|
3515
3340
|
orderReturn,
|
|
3516
3341
|
itemId
|
|
3517
3342
|
}) => {
|
|
3518
|
-
const { t } =
|
|
3343
|
+
const { t } = useTranslation18();
|
|
3519
3344
|
const item = orderReturn?.items?.find((ri) => ri.item_id === itemId);
|
|
3520
3345
|
const damagedQuantity = item?.damaged_quantity || 0;
|
|
3521
|
-
return item && /* @__PURE__ */
|
|
3346
|
+
return item && /* @__PURE__ */ jsxs18(
|
|
3522
3347
|
"div",
|
|
3523
3348
|
{
|
|
3524
3349
|
className: "txt-compact-small-plus text-ui-fg-subtle bg-ui-bg-subtle flex flex-row justify-between gap-y-2 border-t-2 border-dotted px-6 py-4",
|
|
3525
3350
|
children: [
|
|
3526
|
-
/* @__PURE__ */
|
|
3527
|
-
/* @__PURE__ */
|
|
3528
|
-
/* @__PURE__ */
|
|
3351
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
3352
|
+
/* @__PURE__ */ jsx18(ArrowDownRightMini2, { className: "text-ui-fg-muted" }),
|
|
3353
|
+
/* @__PURE__ */ jsx18(Text13, { size: "small", children: t(`orders.returns.damagedItemsReturned`, {
|
|
3529
3354
|
quantity: damagedQuantity
|
|
3530
3355
|
}) }),
|
|
3531
|
-
item?.note && /* @__PURE__ */
|
|
3532
|
-
item?.reason && /* @__PURE__ */
|
|
3356
|
+
item?.note && /* @__PURE__ */ jsx18(Tooltip6, { content: item.note, children: /* @__PURE__ */ jsx18(DocumentText2, { className: "text-ui-tag-neutral-icon ml-1 inline" }) }),
|
|
3357
|
+
item?.reason && /* @__PURE__ */ jsx18(
|
|
3533
3358
|
Badge4,
|
|
3534
3359
|
{
|
|
3535
3360
|
size: "2xsmall",
|
|
@@ -3539,9 +3364,9 @@ var ReturnBreakdownWithDamages = ({
|
|
|
3539
3364
|
}
|
|
3540
3365
|
)
|
|
3541
3366
|
] }),
|
|
3542
|
-
/* @__PURE__ */
|
|
3367
|
+
/* @__PURE__ */ jsxs18(Text13, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: [
|
|
3543
3368
|
t(`orders.returns.damagedItemReceived`),
|
|
3544
|
-
/* @__PURE__ */
|
|
3369
|
+
/* @__PURE__ */ jsx18("span", { className: "ml-2", children: /* @__PURE__ */ jsx18(return_info_popover_default, { orderReturn }) })
|
|
3545
3370
|
] })
|
|
3546
3371
|
]
|
|
3547
3372
|
},
|
|
@@ -3552,7 +3377,7 @@ var ReturnBreakdown = ({
|
|
|
3552
3377
|
orderReturn,
|
|
3553
3378
|
itemId
|
|
3554
3379
|
}) => {
|
|
3555
|
-
const { t } =
|
|
3380
|
+
const { t } = useTranslation18();
|
|
3556
3381
|
const { getRelativeDate } = useDate();
|
|
3557
3382
|
if (!["requested", "received", "partially_received"].includes(
|
|
3558
3383
|
orderReturn.status || ""
|
|
@@ -3562,29 +3387,29 @@ var ReturnBreakdown = ({
|
|
|
3562
3387
|
const isRequested = orderReturn.status === "requested";
|
|
3563
3388
|
const item = orderReturn?.items?.find((ri) => ri.item_id === itemId);
|
|
3564
3389
|
const damagedQuantity = item?.damaged_quantity || 0;
|
|
3565
|
-
return item && /* @__PURE__ */
|
|
3566
|
-
damagedQuantity > 0 && /* @__PURE__ */
|
|
3390
|
+
return item && /* @__PURE__ */ jsxs18(Fragment3, { children: [
|
|
3391
|
+
damagedQuantity > 0 && /* @__PURE__ */ jsx18(
|
|
3567
3392
|
ReturnBreakdownWithDamages,
|
|
3568
3393
|
{
|
|
3569
3394
|
orderReturn,
|
|
3570
3395
|
itemId
|
|
3571
3396
|
}
|
|
3572
3397
|
),
|
|
3573
|
-
/* @__PURE__ */
|
|
3398
|
+
/* @__PURE__ */ jsxs18(
|
|
3574
3399
|
"div",
|
|
3575
3400
|
{
|
|
3576
3401
|
className: "txt-compact-small-plus text-ui-fg-subtle bg-ui-bg-subtle flex flex-row justify-between gap-y-2 border-t-2 border-dotted px-6 py-4",
|
|
3577
3402
|
children: [
|
|
3578
|
-
/* @__PURE__ */
|
|
3579
|
-
/* @__PURE__ */
|
|
3580
|
-
/* @__PURE__ */
|
|
3403
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
3404
|
+
/* @__PURE__ */ jsx18(ArrowDownRightMini2, { className: "text-ui-fg-muted" }),
|
|
3405
|
+
/* @__PURE__ */ jsx18(Text13, { size: "small", children: t(
|
|
3581
3406
|
`orders.returns.${isRequested ? "returnRequestedInfo" : "returnReceivedInfo"}`,
|
|
3582
3407
|
{
|
|
3583
3408
|
requestedItemsCount: item?.[isRequested ? "quantity" : "received_quantity"]
|
|
3584
3409
|
}
|
|
3585
3410
|
) }),
|
|
3586
|
-
item?.note && /* @__PURE__ */
|
|
3587
|
-
item?.reason && /* @__PURE__ */
|
|
3411
|
+
item?.note && /* @__PURE__ */ jsx18(Tooltip6, { content: item.note, children: /* @__PURE__ */ jsx18(DocumentText2, { className: "text-ui-tag-neutral-icon ml-1 inline" }) }),
|
|
3412
|
+
item?.reason && /* @__PURE__ */ jsx18(
|
|
3588
3413
|
Badge4,
|
|
3589
3414
|
{
|
|
3590
3415
|
size: "2xsmall",
|
|
@@ -3594,13 +3419,13 @@ var ReturnBreakdown = ({
|
|
|
3594
3419
|
}
|
|
3595
3420
|
)
|
|
3596
3421
|
] }),
|
|
3597
|
-
orderReturn && isRequested && /* @__PURE__ */
|
|
3422
|
+
orderReturn && isRequested && /* @__PURE__ */ jsxs18(Text13, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: [
|
|
3598
3423
|
getRelativeDate(orderReturn.created_at),
|
|
3599
|
-
/* @__PURE__ */
|
|
3424
|
+
/* @__PURE__ */ jsx18("span", { className: "ml-2", children: /* @__PURE__ */ jsx18(return_info_popover_default, { orderReturn }) })
|
|
3600
3425
|
] }),
|
|
3601
|
-
orderReturn && !isRequested && /* @__PURE__ */
|
|
3426
|
+
orderReturn && !isRequested && /* @__PURE__ */ jsxs18(Text13, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: [
|
|
3602
3427
|
t(`orders.returns.itemReceived`),
|
|
3603
|
-
/* @__PURE__ */
|
|
3428
|
+
/* @__PURE__ */ jsx18("span", { className: "ml-2", children: /* @__PURE__ */ jsx18(return_info_popover_default, { orderReturn }) })
|
|
3604
3429
|
] })
|
|
3605
3430
|
]
|
|
3606
3431
|
},
|
|
@@ -3612,26 +3437,26 @@ var ClaimBreakdown = ({
|
|
|
3612
3437
|
claim,
|
|
3613
3438
|
itemId
|
|
3614
3439
|
}) => {
|
|
3615
|
-
const { t } =
|
|
3440
|
+
const { t } = useTranslation18();
|
|
3616
3441
|
const { getRelativeDate } = useDate();
|
|
3617
3442
|
const items = claim.additional_items.filter(
|
|
3618
3443
|
(item) => item.item?.id === itemId
|
|
3619
3444
|
);
|
|
3620
|
-
return !!items.length && /* @__PURE__ */
|
|
3445
|
+
return !!items.length && /* @__PURE__ */ jsxs18(
|
|
3621
3446
|
"div",
|
|
3622
3447
|
{
|
|
3623
3448
|
className: "txt-compact-small-plus text-ui-fg-subtle bg-ui-bg-subtle flex flex-row justify-between gap-y-2 border-b-2 border-t-2 border-dotted px-6 py-4",
|
|
3624
3449
|
children: [
|
|
3625
|
-
/* @__PURE__ */
|
|
3626
|
-
/* @__PURE__ */
|
|
3627
|
-
/* @__PURE__ */
|
|
3450
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
3451
|
+
/* @__PURE__ */ jsx18(ArrowDownRightMini2, { className: "text-ui-fg-muted" }),
|
|
3452
|
+
/* @__PURE__ */ jsx18(Text13, { size: "small", children: t(`orders.claims.outboundItemAdded`, {
|
|
3628
3453
|
itemsCount: items.reduce(
|
|
3629
3454
|
(acc, item) => acc = acc + item.quantity,
|
|
3630
3455
|
0
|
|
3631
3456
|
)
|
|
3632
3457
|
}) })
|
|
3633
3458
|
] }),
|
|
3634
|
-
/* @__PURE__ */
|
|
3459
|
+
/* @__PURE__ */ jsx18(Text13, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: getRelativeDate(claim.created_at) })
|
|
3635
3460
|
]
|
|
3636
3461
|
},
|
|
3637
3462
|
claim.id
|
|
@@ -3641,68 +3466,68 @@ var ExchangeBreakdown = ({
|
|
|
3641
3466
|
exchange,
|
|
3642
3467
|
itemId
|
|
3643
3468
|
}) => {
|
|
3644
|
-
const { t } =
|
|
3469
|
+
const { t } = useTranslation18();
|
|
3645
3470
|
const { getRelativeDate } = useDate();
|
|
3646
3471
|
const items = exchange.additional_items.filter(
|
|
3647
3472
|
(item) => item?.item?.id === itemId
|
|
3648
3473
|
);
|
|
3649
|
-
return !!items.length && /* @__PURE__ */
|
|
3474
|
+
return !!items.length && /* @__PURE__ */ jsxs18(
|
|
3650
3475
|
"div",
|
|
3651
3476
|
{
|
|
3652
3477
|
className: "txt-compact-small-plus text-ui-fg-subtle bg-ui-bg-subtle flex flex-row justify-between gap-y-2 border-b-2 border-t-2 border-dotted px-6 py-4",
|
|
3653
3478
|
children: [
|
|
3654
|
-
/* @__PURE__ */
|
|
3655
|
-
/* @__PURE__ */
|
|
3656
|
-
/* @__PURE__ */
|
|
3479
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
|
|
3480
|
+
/* @__PURE__ */ jsx18(ArrowDownRightMini2, { className: "text-ui-fg-muted" }),
|
|
3481
|
+
/* @__PURE__ */ jsx18(Text13, { size: "small", children: t(`orders.exchanges.outboundItemAdded`, {
|
|
3657
3482
|
itemsCount: items.reduce(
|
|
3658
3483
|
(acc, item) => acc = acc + item.quantity,
|
|
3659
3484
|
0
|
|
3660
3485
|
)
|
|
3661
3486
|
}) })
|
|
3662
3487
|
] }),
|
|
3663
|
-
/* @__PURE__ */
|
|
3488
|
+
/* @__PURE__ */ jsx18(Text13, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: getRelativeDate(exchange.created_at) })
|
|
3664
3489
|
]
|
|
3665
3490
|
},
|
|
3666
3491
|
exchange.id
|
|
3667
3492
|
);
|
|
3668
3493
|
};
|
|
3669
3494
|
var Total2 = ({ order }) => {
|
|
3670
|
-
const { t } =
|
|
3671
|
-
return /* @__PURE__ */
|
|
3495
|
+
const { t } = useTranslation18();
|
|
3496
|
+
return /* @__PURE__ */ jsxs18(
|
|
3672
3497
|
"div",
|
|
3673
3498
|
{
|
|
3674
3499
|
className: " flex flex-col gap-y-2 px-6 py-4",
|
|
3675
3500
|
"data-testid": "order-summary-total",
|
|
3676
3501
|
children: [
|
|
3677
|
-
/* @__PURE__ */
|
|
3502
|
+
/* @__PURE__ */ jsxs18(
|
|
3678
3503
|
"div",
|
|
3679
3504
|
{
|
|
3680
3505
|
className: "text-ui-fg-base flex items-center justify-between",
|
|
3681
3506
|
"data-testid": "order-summary-paid-total",
|
|
3682
3507
|
children: [
|
|
3683
|
-
/* @__PURE__ */
|
|
3684
|
-
/* @__PURE__ */
|
|
3508
|
+
/* @__PURE__ */ jsx18(Text13, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: t("fields.paidTotal") }),
|
|
3509
|
+
/* @__PURE__ */ jsx18(Text13, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: getStylizedAmount(
|
|
3685
3510
|
getTotalCaptured(order.payment_collections || []),
|
|
3686
3511
|
order.currency_code
|
|
3687
3512
|
) })
|
|
3688
3513
|
]
|
|
3689
3514
|
}
|
|
3690
3515
|
),
|
|
3691
|
-
getTotalCreditLines(order.credit_lines ?? []) > 0 && /* @__PURE__ */
|
|
3692
|
-
/* @__PURE__ */
|
|
3693
|
-
/* @__PURE__ */
|
|
3516
|
+
getTotalCreditLines(order.credit_lines ?? []) > 0 && /* @__PURE__ */ jsxs18("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
3517
|
+
/* @__PURE__ */ jsx18(Text13, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: t("fields.creditTotal") }),
|
|
3518
|
+
/* @__PURE__ */ jsx18(Text13, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: getStylizedAmount(
|
|
3694
3519
|
getTotalCreditLines(order.credit_lines ?? []),
|
|
3695
3520
|
order.currency_code
|
|
3696
3521
|
) })
|
|
3697
3522
|
] }),
|
|
3698
|
-
/* @__PURE__ */
|
|
3523
|
+
/* @__PURE__ */ jsxs18(
|
|
3699
3524
|
"div",
|
|
3700
3525
|
{
|
|
3701
3526
|
className: "text-ui-fg-base flex items-center justify-between",
|
|
3702
3527
|
"data-testid": "order-summary-outstanding-amount",
|
|
3703
3528
|
children: [
|
|
3704
|
-
/* @__PURE__ */
|
|
3705
|
-
|
|
3529
|
+
/* @__PURE__ */ jsx18(
|
|
3530
|
+
Text13,
|
|
3706
3531
|
{
|
|
3707
3532
|
className: "text-ui-fg-subtle text-semibold",
|
|
3708
3533
|
size: "small",
|
|
@@ -3710,8 +3535,8 @@ var Total2 = ({ order }) => {
|
|
|
3710
3535
|
children: t("orders.returns.outstandingAmount")
|
|
3711
3536
|
}
|
|
3712
3537
|
),
|
|
3713
|
-
/* @__PURE__ */
|
|
3714
|
-
|
|
3538
|
+
/* @__PURE__ */ jsx18(
|
|
3539
|
+
Text13,
|
|
3715
3540
|
{
|
|
3716
3541
|
className: "text-ui-fg-subtle text-bold",
|
|
3717
3542
|
size: "small",
|
|
@@ -3731,21 +3556,21 @@ var Total2 = ({ order }) => {
|
|
|
3731
3556
|
};
|
|
3732
3557
|
|
|
3733
3558
|
// src/pages/orders/order-detail/components/order-remaining-orders-group-section/order-remaining-orders-group-section.tsx
|
|
3734
|
-
import { Container as
|
|
3559
|
+
import { Container as Container12, Heading as Heading12 } from "@medusajs/ui";
|
|
3735
3560
|
import { createColumnHelper } from "@tanstack/react-table";
|
|
3736
|
-
import { useMemo as
|
|
3737
|
-
import { useTranslation as
|
|
3561
|
+
import { useMemo as useMemo5 } from "react";
|
|
3562
|
+
import { useTranslation as useTranslation19 } from "react-i18next";
|
|
3738
3563
|
import { useParams } from "react-router-dom";
|
|
3739
|
-
import { jsx as
|
|
3564
|
+
import { jsx as jsx19, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3740
3565
|
var DEFAULT_FIELDS2 = "id,*orders,*orders.customer,*orders.seller,*orders.sales_channel";
|
|
3741
3566
|
var OrderRemainingOrdersGroupSection = () => {
|
|
3742
3567
|
const { id } = useParams();
|
|
3743
|
-
const { t } =
|
|
3568
|
+
const { t } = useTranslation19();
|
|
3744
3569
|
const { order_group, isLoading, isError, error } = useOrderGroupByOrderId(
|
|
3745
3570
|
id,
|
|
3746
3571
|
{ fields: DEFAULT_FIELDS2 }
|
|
3747
3572
|
);
|
|
3748
|
-
const orders =
|
|
3573
|
+
const orders = useMemo5(() => {
|
|
3749
3574
|
const group = order_group;
|
|
3750
3575
|
if (!group?.orders) return [];
|
|
3751
3576
|
return group.orders.filter((o) => o.id !== id);
|
|
@@ -3765,24 +3590,21 @@ var OrderRemainingOrdersGroupSection = () => {
|
|
|
3765
3590
|
if (!isLoading && orders.length === 0) {
|
|
3766
3591
|
return null;
|
|
3767
3592
|
}
|
|
3768
|
-
return /* @__PURE__ */
|
|
3769
|
-
|
|
3593
|
+
return /* @__PURE__ */ jsxs19(
|
|
3594
|
+
Container12,
|
|
3770
3595
|
{
|
|
3771
3596
|
className: "divide-y p-0",
|
|
3772
3597
|
"data-testid": "order-remaining-orders-group-section",
|
|
3773
3598
|
children: [
|
|
3774
|
-
/* @__PURE__ */
|
|
3599
|
+
/* @__PURE__ */ jsx19(
|
|
3775
3600
|
"div",
|
|
3776
3601
|
{
|
|
3777
3602
|
className: "flex items-center justify-between px-6 py-4",
|
|
3778
3603
|
"data-testid": "order-remaining-orders-group-header",
|
|
3779
|
-
children: /* @__PURE__ */
|
|
3780
|
-
t("orders.domain"),
|
|
3781
|
-
" in group"
|
|
3782
|
-
] })
|
|
3604
|
+
children: /* @__PURE__ */ jsx19(Heading12, { level: "h2", "data-testid": "order-remaining-orders-group-heading", children: t("orders.group.heading") })
|
|
3783
3605
|
}
|
|
3784
3606
|
),
|
|
3785
|
-
/* @__PURE__ */
|
|
3607
|
+
/* @__PURE__ */ jsx19(
|
|
3786
3608
|
_DataTable,
|
|
3787
3609
|
{
|
|
3788
3610
|
columns,
|
|
@@ -3792,7 +3614,7 @@ var OrderRemainingOrdersGroupSection = () => {
|
|
|
3792
3614
|
isLoading,
|
|
3793
3615
|
pageSize: orders.length,
|
|
3794
3616
|
noRecords: {
|
|
3795
|
-
message: "
|
|
3617
|
+
message: t("orders.group.noOtherOrders")
|
|
3796
3618
|
}
|
|
3797
3619
|
}
|
|
3798
3620
|
)
|
|
@@ -3802,35 +3624,35 @@ var OrderRemainingOrdersGroupSection = () => {
|
|
|
3802
3624
|
};
|
|
3803
3625
|
var columnHelper = createColumnHelper();
|
|
3804
3626
|
var useColumns = () => {
|
|
3805
|
-
return
|
|
3627
|
+
return useMemo5(
|
|
3806
3628
|
() => [
|
|
3807
3629
|
columnHelper.accessor("display_id", {
|
|
3808
|
-
header: () => /* @__PURE__ */
|
|
3809
|
-
cell: ({ getValue }) => /* @__PURE__ */
|
|
3630
|
+
header: () => /* @__PURE__ */ jsx19(DisplayIdHeader, {}),
|
|
3631
|
+
cell: ({ getValue }) => /* @__PURE__ */ jsx19(DisplayIdCell, { displayId: getValue() })
|
|
3810
3632
|
}),
|
|
3811
3633
|
columnHelper.display({
|
|
3812
3634
|
id: "seller",
|
|
3813
|
-
header: () => /* @__PURE__ */
|
|
3635
|
+
header: () => /* @__PURE__ */ jsx19(TextHeader, { text: "Store" }),
|
|
3814
3636
|
cell: ({ row }) => {
|
|
3815
3637
|
const seller = row.original.seller;
|
|
3816
|
-
return /* @__PURE__ */
|
|
3638
|
+
return /* @__PURE__ */ jsx19(TextCell, { text: seller?.name ?? "-" });
|
|
3817
3639
|
}
|
|
3818
3640
|
}),
|
|
3819
3641
|
columnHelper.accessor("created_at", {
|
|
3820
|
-
header: () => /* @__PURE__ */
|
|
3821
|
-
cell: ({ getValue }) => /* @__PURE__ */
|
|
3642
|
+
header: () => /* @__PURE__ */ jsx19(DateHeader, {}),
|
|
3643
|
+
cell: ({ getValue }) => /* @__PURE__ */ jsx19(DateCell, { date: new Date(getValue()) })
|
|
3822
3644
|
}),
|
|
3823
3645
|
columnHelper.accessor("payment_status", {
|
|
3824
|
-
header: () => /* @__PURE__ */
|
|
3825
|
-
cell: ({ getValue }) => /* @__PURE__ */
|
|
3646
|
+
header: () => /* @__PURE__ */ jsx19(PaymentStatusHeader, {}),
|
|
3647
|
+
cell: ({ getValue }) => /* @__PURE__ */ jsx19(PaymentStatusCell, { status: getValue() })
|
|
3826
3648
|
}),
|
|
3827
3649
|
columnHelper.accessor("fulfillment_status", {
|
|
3828
|
-
header: () => /* @__PURE__ */
|
|
3829
|
-
cell: ({ getValue }) => /* @__PURE__ */
|
|
3650
|
+
header: () => /* @__PURE__ */ jsx19(FulfillmentStatusHeader, {}),
|
|
3651
|
+
cell: ({ getValue }) => /* @__PURE__ */ jsx19(FulfillmentStatusCell, { status: getValue() })
|
|
3830
3652
|
}),
|
|
3831
3653
|
columnHelper.accessor("total", {
|
|
3832
|
-
header: () => /* @__PURE__ */
|
|
3833
|
-
cell: ({ getValue, row }) => /* @__PURE__ */
|
|
3654
|
+
header: () => /* @__PURE__ */ jsx19(TotalHeader, {}),
|
|
3655
|
+
cell: ({ getValue, row }) => /* @__PURE__ */ jsx19(
|
|
3834
3656
|
TotalCell,
|
|
3835
3657
|
{
|
|
3836
3658
|
currencyCode: row.original.currency_code,
|
|
@@ -3844,7 +3666,7 @@ var useColumns = () => {
|
|
|
3844
3666
|
};
|
|
3845
3667
|
|
|
3846
3668
|
// src/pages/orders/order-detail/order-detail.tsx
|
|
3847
|
-
import { jsx as
|
|
3669
|
+
import { jsx as jsx20, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3848
3670
|
var Root = ({ children }) => {
|
|
3849
3671
|
const initialData = useLoaderData();
|
|
3850
3672
|
const { id } = useParams2();
|
|
@@ -3873,12 +3695,12 @@ var Root = ({ children }) => {
|
|
|
3873
3695
|
id
|
|
3874
3696
|
);
|
|
3875
3697
|
if (isLoading || !order || isPreviewLoading) {
|
|
3876
|
-
return /* @__PURE__ */
|
|
3698
|
+
return /* @__PURE__ */ jsx20(TwoColumnPageSkeleton, { mainSections: 4, sidebarSections: 2, showJSON: true });
|
|
3877
3699
|
}
|
|
3878
3700
|
if (isError) {
|
|
3879
3701
|
throw error;
|
|
3880
3702
|
}
|
|
3881
|
-
return Children.count(children) > 0 ? /* @__PURE__ */
|
|
3703
|
+
return Children.count(children) > 0 ? /* @__PURE__ */ jsx20(
|
|
3882
3704
|
TwoColumnPage,
|
|
3883
3705
|
{
|
|
3884
3706
|
data: order,
|
|
@@ -3888,7 +3710,7 @@ var Root = ({ children }) => {
|
|
|
3888
3710
|
"data-testid": "order-detail-page",
|
|
3889
3711
|
children
|
|
3890
3712
|
}
|
|
3891
|
-
) : /* @__PURE__ */
|
|
3713
|
+
) : /* @__PURE__ */ jsxs20(
|
|
3892
3714
|
TwoColumnPage,
|
|
3893
3715
|
{
|
|
3894
3716
|
data: order,
|
|
@@ -3897,20 +3719,21 @@ var Root = ({ children }) => {
|
|
|
3897
3719
|
hasOutlet: true,
|
|
3898
3720
|
"data-testid": "order-detail-page",
|
|
3899
3721
|
children: [
|
|
3900
|
-
/* @__PURE__ */
|
|
3901
|
-
/* @__PURE__ */
|
|
3902
|
-
/* @__PURE__ */
|
|
3903
|
-
/* @__PURE__ */
|
|
3904
|
-
/* @__PURE__ */
|
|
3905
|
-
/* @__PURE__ */
|
|
3906
|
-
/* @__PURE__ */
|
|
3907
|
-
/* @__PURE__ */
|
|
3908
|
-
/* @__PURE__ */
|
|
3722
|
+
/* @__PURE__ */ jsxs20(TwoColumnPage.Main, { "data-testid": "order-detail-main", children: [
|
|
3723
|
+
/* @__PURE__ */ jsx20(OrderActiveEditSection, { order }),
|
|
3724
|
+
/* @__PURE__ */ jsx20(ActiveOrderClaimSection, { orderPreview }),
|
|
3725
|
+
/* @__PURE__ */ jsx20(ActiveOrderExchangeSection, { orderPreview }),
|
|
3726
|
+
/* @__PURE__ */ jsx20(ActiveOrderReturnSection, { orderPreview }),
|
|
3727
|
+
/* @__PURE__ */ jsx20(OrderGeneralSection, { order }),
|
|
3728
|
+
/* @__PURE__ */ jsx20(OrderSummarySection, { order }),
|
|
3729
|
+
/* @__PURE__ */ jsx20(OrderCommissionSection, { order }),
|
|
3730
|
+
/* @__PURE__ */ jsx20(OrderPaymentSection, { order }),
|
|
3731
|
+
/* @__PURE__ */ jsx20(OrderFulfillmentSection, { order })
|
|
3909
3732
|
] }),
|
|
3910
|
-
/* @__PURE__ */
|
|
3911
|
-
/* @__PURE__ */
|
|
3912
|
-
/* @__PURE__ */
|
|
3913
|
-
/* @__PURE__ */
|
|
3733
|
+
/* @__PURE__ */ jsxs20(TwoColumnPage.Sidebar, { "data-testid": "order-detail-sidebar", children: [
|
|
3734
|
+
/* @__PURE__ */ jsx20(OrderCustomerSection, { order }),
|
|
3735
|
+
/* @__PURE__ */ jsx20(OrderActivitySection, { order }),
|
|
3736
|
+
/* @__PURE__ */ jsx20(OrderRemainingOrdersGroupSection, {})
|
|
3914
3737
|
] })
|
|
3915
3738
|
]
|
|
3916
3739
|
}
|