@mercurjs/vendor 2.2.0-rc.0 → 2.2.0-rc.1
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/{[id]-5P5LTATX.js → [id]-2LOU4IGP.js} +29 -11
- package/dist/{[id]-DT5YJVKG.js → [id]-6K5OJU5T.js} +18 -17
- package/dist/{[id]-N7JEZFXQ.js → [id]-6RTJXOT5.js} +2 -1
- package/dist/{[id]-XP5KEMNX.js → [id]-7T4JCGCZ.js} +86 -49
- package/dist/{[id]-DCGPICT3.js → [id]-BMW6PEZT.js} +23 -22
- package/dist/{[id]-CUBGVODE.js → [id]-FN47ZDW5.js} +89 -48
- package/dist/{[id]-4HO4S2PX.js → [id]-KTJU7CRX.js} +691 -657
- package/dist/{[id]-3LNKC5OJ.js → [id]-NUH6WK7Y.js} +80 -39
- package/dist/{[id]-AQUUZFRX.js → [id]-RRWUTLTP.js} +141 -43
- package/dist/{[id]-4LIIFGET.js → [id]-TJF2WSOF.js} +139 -50
- package/dist/{[id]-IEBZ6V3W.js → [id]-UWBLKWZI.js} +29 -28
- package/dist/{[id]-5EECCIRP.js → [id]-VWIZD2JL.js} +61 -36
- package/dist/{[id]-U6FKX5UQ.js → [id]-XRSZYRKI.js} +55 -33
- package/dist/{[id]-XB45DY2D.js → [id]-YIP2TDVC.js} +120 -42
- package/dist/{[location_id]-I4HHUHWY.js → [location_id]-TUAKRLYQ.js} +6 -5
- package/dist/{[province_id]-OYX4MOCF.js → [province_id]-6VYYS4DZ.js} +17 -16
- package/dist/{add-RPRJWCYU.js → add-KB477RH5.js} +18 -17
- package/dist/{add-3T4GBFMM.js → add-NSLA2RT7.js} +24 -24
- package/dist/{add-customer-groups-FB5T6PQN.js → add-customer-groups-PB4LCA5E.js} +12 -12
- package/dist/{add-products-F243SWGD.js → add-products-O72MJ3N2.js} +17 -17
- package/dist/{add-promotions-TJDK7HLW.js → add-promotions-6X7N3DTU.js} +6 -6
- package/dist/{add-to-campaign-Q6OAJMUJ.js → add-to-campaign-7WAUGNNI.js} +4 -4
- package/dist/{address-XVBSNMFU.js → address-ZR4EM2QA.js} +28 -16
- package/dist/{adjust-inventory-IZLRMQXV.js → adjust-inventory-P4X6PFKW.js} +1 -1
- package/dist/{allocate-items-Q3VALDYT.js → allocate-items-NSQOU2QJ.js} +2 -2
- package/dist/{areas-IYGBRCRH.js → areas-N4ORDJTD.js} +3 -3
- package/dist/{attributes-LGEM2JJW.js → attributes-DRC3WYY6.js} +1 -1
- package/dist/{breadcrumb-XGXKCDYS.js → breadcrumb-4YT6FRUQ.js} +3 -3
- package/dist/{breadcrumb-H45Z2WNG.js → breadcrumb-BKBSL3PC.js} +3 -3
- package/dist/{breadcrumb-K4HBKZUE.js → breadcrumb-ETWGVI34.js} +2 -2
- package/dist/{breadcrumb-KZPOPXGG.js → breadcrumb-F4N5CPRD.js} +1 -1
- package/dist/{breadcrumb-BXD3SRM7.js → breadcrumb-JGDD7EHO.js} +1 -1
- package/dist/{breadcrumb-VY5DNTTJ.js → breadcrumb-JWDW3P6C.js} +10 -10
- package/dist/{breadcrumb-FEYGZFJU.js → breadcrumb-KKWNLFMC.js} +2 -2
- package/dist/{breadcrumb-WG6TIF4C.js → breadcrumb-PJOTRHG7.js} +4 -2
- package/dist/{breadcrumb-NZYOCEEM.js → breadcrumb-PYLGF3AN.js} +10 -10
- package/dist/{breadcrumb-XEZCMI55.js → breadcrumb-TO45VBVD.js} +1 -1
- package/dist/{breadcrumb-L262VPBO.js → breadcrumb-UEUUMDIY.js} +1 -1
- package/dist/{breadcrumb-ILEAQRW7.js → breadcrumb-VCRGVYJR.js} +10 -10
- package/dist/{breadcrumb-BFNJWOJ4.js → breadcrumb-WWLMQQQF.js} +1 -1
- package/dist/{breadcrumb-BC6XN2SE.js → breadcrumb-Y7N7L7DM.js} +2 -2
- package/dist/{campaigns-DZKRNCA4.js → campaigns-GPLRB2AR.js} +5 -5
- package/dist/{categories-JZJA2IBQ.js → categories-53X36JNS.js} +6 -6
- package/dist/{chunk-JDNXS37G.js → chunk-2INANL6V.js} +2 -2
- package/dist/{chunk-3I6ZAMGN.js → chunk-2P5H7EVR.js} +1 -1
- package/dist/{chunk-ZTOYVPGA.js → chunk-3F4MUPGR.js} +1 -1
- package/dist/chunk-432S4FGR.js +0 -0
- package/dist/{chunk-JY2XON7H.js → chunk-4CNLTLQP.js} +6 -5
- package/dist/{chunk-3SH24DGG.js → chunk-4EAC3GT7.js} +1 -1
- package/dist/{chunk-MVEHWM7K.js → chunk-4NADEZZQ.js} +14 -3
- package/dist/{chunk-HDEOZN2Q.js → chunk-4OQLPIUZ.js} +27 -27
- package/dist/{chunk-MAW6ZT3D.js → chunk-55TS752B.js} +1 -1
- package/dist/{chunk-O7BGGWW6.js → chunk-5NVY7JZC.js} +4 -4
- package/dist/{chunk-MUGQQY6P.js → chunk-5SRG2247.js} +49 -11
- package/dist/{chunk-L57USMYC.js → chunk-5YZ3G5EZ.js} +1 -1
- package/dist/{chunk-G6YNCIVF.js → chunk-744GLNZW.js} +1 -1
- package/dist/{chunk-CUAGC54B.js → chunk-7CQ4RKVV.js} +23 -9
- package/dist/{chunk-WBCWER26.js → chunk-7HLAOLG7.js} +1 -1
- package/dist/{chunk-W3UHAQCV.js → chunk-7TQNE3E2.js} +1 -1
- package/dist/{chunk-7EXKHL5L.js → chunk-7ZNZJIVN.js} +1 -1
- package/dist/{chunk-UNE4VD5U.js → chunk-APWPWXWQ.js} +21 -10
- package/dist/{chunk-EAAZV3B7.js → chunk-BXDN7ZA5.js} +24 -12
- package/dist/{chunk-5PAUN3PM.js → chunk-CLS6PNZY.js} +2 -2
- package/dist/{chunk-MJP5V3JN.js → chunk-COGWTNSC.js} +1 -1
- package/dist/{chunk-RPU4UOQK.js → chunk-CQRCUQC4.js} +1 -1
- package/dist/{chunk-634XVU3D.js → chunk-CVXKASWV.js} +2 -2
- package/dist/{chunk-CRYZK4NU.js → chunk-EFKHV25A.js} +1 -1
- package/dist/{chunk-KZQFIPY2.js → chunk-ESXMD6CR.js} +12 -4
- package/dist/{chunk-5BYYDBLS.js → chunk-EX5IIVVN.js} +2 -2
- package/dist/{chunk-TJKZ5QCJ.js → chunk-FXQWGW2J.js} +2 -2
- package/dist/{chunk-Y4PM3IDZ.js → chunk-GGXGKMYK.js} +1 -1
- package/dist/{chunk-EDV4MTTT.js → chunk-GK6X67DV.js} +65 -37
- package/dist/{chunk-2KA4TGBQ.js → chunk-GZRCPKO5.js} +19 -8
- package/dist/{chunk-3TST3EWQ.js → chunk-HLAV55RT.js} +1 -1
- package/dist/{chunk-E6W57UP3.js → chunk-HRUO43BZ.js} +2 -2
- package/dist/{chunk-UX5UYDCY.js → chunk-I3I5IYHO.js} +1 -1
- package/dist/{chunk-3ALBZK4M.js → chunk-ICKOFNHF.js} +5 -2
- package/dist/{chunk-RTMMO6IU.js → chunk-II2GAEVL.js} +25 -13
- package/dist/{chunk-HXGLPDZW.js → chunk-IMVZFBCM.js} +6 -17
- package/dist/{chunk-GSH6ZGI6.js → chunk-IPNO77ZJ.js} +35 -12
- package/dist/{chunk-4IRQSBA7.js → chunk-IWF43LO2.js} +1 -1
- package/dist/{chunk-ZLHCZ5F2.js → chunk-JIXW4WHZ.js} +4 -4
- package/dist/{chunk-IEVN722X.js → chunk-JLLFEA23.js} +1 -1
- package/dist/{chunk-7BFQKYCJ.js → chunk-KEXXZLVI.js} +1 -1
- package/dist/{chunk-JTHDMXZV.js → chunk-LOBDXF34.js} +2 -2
- package/dist/{chunk-5BQO3YQP.js → chunk-MABIMRLS.js} +1 -1
- package/dist/{chunk-WFE6CT6M.js → chunk-MDGTQT5D.js} +1 -1
- package/dist/{chunk-LWFBBTJ3.js → chunk-MJ4B2OFU.js} +21 -10
- package/dist/{chunk-S7NGDLZ3.js → chunk-MK44MYO7.js} +2 -2
- package/dist/{chunk-2NPD4S55.js → chunk-O4N6UK6M.js} +2 -2
- package/dist/{chunk-JK4M3ZKY.js → chunk-OOK3BD5Z.js} +3 -3
- package/dist/{chunk-V5K6HISS.js → chunk-P3ETXWHD.js} +1 -1
- package/dist/{chunk-D76WZZSB.js → chunk-P6XBOWET.js} +6 -5
- package/dist/{chunk-H6LZ77GX.js → chunk-QGZH3D2P.js} +4 -1
- package/dist/{chunk-KTJLJTFO.js → chunk-QMTSINXN.js} +93 -66
- package/dist/{chunk-KG2NUK4J.js → chunk-QU444FAP.js} +46 -15
- package/dist/{chunk-WFHGJGCW.js → chunk-S4ILPAEO.js} +27 -12
- package/dist/{chunk-QWW6RHZC.js → chunk-SYWAMZNQ.js} +3 -2
- package/dist/{chunk-LQSLDDPT.js → chunk-T35QBLG7.js} +1 -1
- package/dist/{chunk-VD27SL7H.js → chunk-TNZMNJRF.js} +6 -5
- package/dist/{chunk-DQ7LZZJX.js → chunk-U5MXCMDR.js} +24 -13
- package/dist/{chunk-6FDPVW7Y.js → chunk-UEPUKWD7.js} +1 -1
- package/dist/{chunk-MT6WOKIW.js → chunk-UKTJEFMZ.js} +1 -1
- package/dist/{chunk-EPRYM3FA.js → chunk-ULEW54ED.js} +1 -1
- package/dist/{chunk-TPGIMZLI.js → chunk-VR7P4DAZ.js} +1 -1
- package/dist/{chunk-DSTHXHJ5.js → chunk-VYSB4CTB.js} +1356 -1356
- package/dist/{chunk-WCXFUBEF.js → chunk-W5LVOEN2.js} +7 -7
- package/dist/{chunk-FDKFUIYV.js → chunk-WQQMCV7M.js} +1 -1
- package/dist/chunk-WQTWBXKO.js +23 -0
- package/dist/{chunk-3BXCPHN6.js → chunk-XCHKUSUU.js} +1 -0
- package/dist/{chunk-OYUJYPDF.js → chunk-XWHHBJGS.js} +2 -1
- package/dist/{chunk-27WLUOI2.js → chunk-Y6S7K3YB.js} +1 -1
- package/dist/{chunk-6Q3J6ZMM.js → chunk-YEPZGGUE.js} +41 -19
- package/dist/{chunk-RILHLBKW.js → chunk-YRXXO2RT.js} +2 -2
- package/dist/{chunk-3C2T27YW.js → chunk-YXWZT3PX.js} +1 -1
- package/dist/{chunk-QWJTJSIT.js → chunk-Z3SPAROE.js} +1 -1
- package/dist/{collections-XIHCTMSJ.js → collections-AE7QLCFD.js} +18 -18
- package/dist/{configuration-3GCBMM27.js → configuration-I6BUESSG.js} +1 -1
- package/dist/{configuration-FWZTMYXY.js → configuration-QVMG6LAM.js} +3 -3
- package/dist/{create-PJVLJ7T6.js → create-2DXKC5OJ.js} +18 -18
- package/dist/{create-2RGNAVVY.js → create-2WFPJBDQ.js} +14 -14
- package/dist/{create-VL7LDTVE.js → create-3PIY2COT.js} +8 -8
- package/dist/{create-HEZYB7RF.js → create-7HXY7U5W.js} +55 -21
- package/dist/{create-FHIFVCSG.js → create-BE2YNVX3.js} +24 -24
- package/dist/{create-YKYLCEAK.js → create-C2WABAJU.js} +4 -4
- package/dist/{create-NEK6JCKR.js → create-EIMV4KCC.js} +9 -9
- package/dist/{create-XLYGW5PN.js → create-F2VZZ7XS.js} +11 -11
- package/dist/{create-N534JQPH.js → create-K7V36IWH.js} +3 -3
- package/dist/{create-32MXB6FD.js → create-KW6KFXGI.js} +10 -10
- package/dist/{create-3AMFYYI6.js → create-MW33P4AB.js} +12 -12
- package/dist/{create-GO7APBBU.js → create-RXIY777H.js} +12 -12
- package/dist/{create-RPBHXU32.js → create-TPNH5U7Z.js} +10 -10
- package/dist/{create-AMNH3WXL.js → create-ZZBMZZQG.js} +23 -19
- package/dist/{customer-group-add-customers-2C53NFBJ.js → customer-group-add-customers-DZ3JYD6S.js} +4 -4
- package/dist/{customer-group-create-75QQEQZF.js → customer-group-create-6YNGAE2W.js} +1 -1
- package/dist/{customer-group-detail-AOQYYAOG.js → customer-group-detail-VZUHEIRY.js} +18 -14
- package/dist/{customer-group-edit-N77RCW6I.js → customer-group-edit-UA36663R.js} +48 -27
- package/dist/{customer-groups-GNFV7VMT.js → customer-groups-RGHBJV55.js} +36 -15
- package/dist/{customers-HNINO6YL.js → customers-7S2MK4VG.js} +6 -6
- package/dist/{edit-BSD6667Q.js → edit-3RDEZH6V.js} +12 -12
- package/dist/{edit-7CLOJ3UZ.js → edit-3XGZNC24.js} +24 -24
- package/dist/{edit-4PWAJ7A3.js → edit-45TYWHR6.js} +11 -11
- package/dist/{edit-3DUCWSLA.js → edit-5IQNX7YB.js} +66 -33
- package/dist/{edit-ZGAOUZYP.js → edit-GBTLRL6H.js} +12 -12
- package/dist/{edit-SIKOSSHF.js → edit-HXCSFGP5.js} +10 -10
- package/dist/{edit-UNN3QTEJ.js → edit-JT4OKP5H.js} +23 -7
- package/dist/{edit-O65JD54W.js → edit-PIOHPBF5.js} +2 -2
- package/dist/{edit-IJ6DCBUU.js → edit-UYYI6HIT.js} +28 -11
- package/dist/{edit-TD7QFM4Z.js → edit-VFHZ6GVR.js} +14 -9
- package/dist/{edit-WEUFBORT.js → edit-W7T5NAFW.js} +12 -12
- package/dist/{edit-ZORE6RUD.js → edit-X4DFAW7S.js} +46 -24
- package/dist/{edit-7SBPHN6P.js → edit-YLWMEXUS.js} +23 -7
- package/dist/{edit-budget-D22WMVYR.js → edit-budget-XVJ65KUO.js} +1 -1
- package/dist/{edit-inventory-item-QMYWEBZ3.js → edit-inventory-item-NHSXZ7UB.js} +22 -7
- package/dist/{edit-inventory-item-attributes-HLG6JR6S.js → edit-inventory-item-attributes-VTFPTLLT.js} +1 -1
- package/dist/{edit-price-F7ZWM3FN.js → edit-price-XCJDZ4CU.js} +3 -3
- package/dist/{edit-stock-ITAZNHPU.js → edit-stock-5SQJH74B.js} +2 -2
- package/dist/extension-targets.d.ts +248 -0
- package/dist/extension-targets.js +1 -0
- package/dist/{fulfillment-U2GRQ6DD.js → fulfillment-5LEDKCH7.js} +20 -11
- package/dist/{fulfillment-providers-CMU2JB5X.js → fulfillment-providers-KUIDFRP4.js} +15 -15
- package/dist/index.css +18 -12
- package/dist/index.d.ts +2 -0
- package/dist/index.js +228 -201
- package/dist/{inventory-4JKLAZ2Q.js → inventory-L26YLIBO.js} +2 -2
- package/dist/{inventory-FKEXULLT.js → inventory-ZWZ2SUYW.js} +5 -5
- package/dist/{invite-3R2CEWLN.js → invite-CQEODMVX.js} +16 -27
- package/dist/{invite-MNAX6EUC.js → invite-VYXX7ICP.js} +14 -14
- package/dist/{loader-HTPUNIOS.js → loader-CDW7SKZP.js} +2 -2
- package/dist/{loader-MAAMUP2Z.js → loader-OGR7BCER.js} +12 -10
- package/dist/{locations-2VWSMWHL.js → locations-UVMY2QLW.js} +1 -1
- package/dist/{login-YUWOWICV.js → login-Z43XSPNR.js} +12 -12
- package/dist/{manage-locations-RWGDXXJQ.js → manage-locations-WD3WRVMF.js} +1 -1
- package/dist/{media-YB4G5CMV.js → media-UAAKHWJZ.js} +12 -12
- package/dist/{media-P6WSFHY4.js → media-VRNKF2TX.js} +14 -14
- package/dist/{metadata-J447GEBP.js → metadata-6FYHGP2P.js} +10 -10
- package/dist/{metadata-5Q6FLVX4.js → metadata-GI4A7XUC.js} +10 -10
- package/dist/{metadata-VTQ2CGZX.js → metadata-GR7QS5N6.js} +10 -10
- package/dist/{metadata-ADXGD4Y6.js → metadata-MRDVKETB.js} +10 -10
- package/dist/{metadata-6OYHLPLA.js → metadata-QZEX5FQH.js} +10 -10
- package/dist/{offer-create-page-ACPKTNHA.js → offer-create-page-LRKRHBRT.js} +18 -16
- package/dist/{offer-detail-page-S4R4N5GL.js → offer-detail-page-RSBA6WJB.js} +80 -27
- package/dist/{offer-variant-detail-page-XUMDXZUD.js → offer-variant-detail-page-KBDN27ZG.js} +25 -16
- package/dist/{offers-OTZJBW43.js → offers-LBJILJQX.js} +17 -17
- package/dist/{onboarding-TUGXFOA6.js → onboarding-4DXHB5KY.js} +58 -59
- package/dist/{orders-PJSJNGZS.js → orders-JGKXRRJ6.js} +21 -21
- package/dist/{organization-YIOAVFHN.js → organization-NQHWLNES.js} +12 -12
- package/dist/{organize-OWT5QSJR.js → organize-PNLFCNY4.js} +3 -3
- package/dist/{organize-BTA7NJD2.js → organize-X4IMS4S5.js} +3 -3
- package/dist/pages/index.d.ts +17 -2
- package/dist/pages/index.js +55 -54
- package/dist/{payment-details-K2XFATEL.js → payment-details-T7CKYYQR.js} +29 -17
- package/dist/{payouts-K5IDTJV3.js → payouts-MGC6Z3AT.js} +6 -6
- package/dist/{price-lists-DNPIPDAW.js → price-lists-QJTMWEEP.js} +8 -8
- package/dist/{pricing-J5FIDZIY.js → pricing-CFDZXHIE.js} +12 -12
- package/dist/{pricing-5VUPPNKS.js → pricing-LEEEQ2TR.js} +3 -3
- package/dist/{product-tags-SJYIGXEV.js → product-tags-Z7DOYERG.js} +25 -25
- package/dist/{product-types-4PTJW5DE.js → product-types-F5YH6TBY.js} +4 -4
- package/dist/{product-variant-detail-FO6J3RFA.js → product-variant-detail-EUWXJWAJ.js} +14 -13
- package/dist/{product-variant-edit-55TAIBZO.js → product-variant-edit-OP7DAKIN.js} +12 -12
- package/dist/{products-EQMANSO6.js → products-QRYZFYMR.js} +17 -17
- package/dist/{products-XM57LXJK.js → products-SGYVJ33I.js} +30 -29
- package/dist/{professional-details-WWZPTXSX.js → professional-details-UVRM7GID.js} +28 -16
- package/dist/{profile-5IADQ727.js → profile-HYJJLO63.js} +58 -24
- package/dist/{promotions-BYW6TZ5B.js → promotions-TF4GPADY.js} +8 -8
- package/dist/{receive-MTXKKPKZ.js → receive-NHOBI4NE.js} +4 -4
- package/dist/{refund-3IXGYA7W.js → refund-6MXXZP2L.js} +73 -49
- package/dist/{register-U5PQZATC.js → register-SC2R7TDT.js} +13 -13
- package/dist/{reset-password-SKUJJLSV.js → reset-password-OIZAI2US.js} +1 -1
- package/dist/{return-reasons-QDPSIJG3.js → return-reasons-L5BFL5WW.js} +18 -15
- package/dist/{sales-channels-GBSTCWVP.js → sales-channels-57VSC3CU.js} +4 -3
- package/dist/{sales-channels-N4NE3FXP.js → sales-channels-VXOZQKLK.js} +4 -3
- package/dist/{settings-ZUBBFS67.js → settings-UZGHDHAR.js} +28 -28
- package/dist/{shipment-TKSCPC3M.js → shipment-KF4M3RDJ.js} +10 -10
- package/dist/{shipping-DODEUYOQ.js → shipping-3KKFZONF.js} +2 -2
- package/dist/{shipping-profile-O4JMJLN7.js → shipping-profile-ZHE4U2MG.js} +1 -1
- package/dist/{shipping-profiles-4TJ4IH6U.js → shipping-profiles-W6ESWKTU.js} +14 -14
- package/dist/{stock-GYK2GHJN.js → stock-JCDE7SMM.js} +10 -10
- package/dist/{store-XWOALZ5Q.js → store-UOOVXKZY.js} +121 -47
- package/dist/{store-closure-46B3XZ2I.js → store-closure-7TG7Y7LW.js} +10 -10
- package/dist/{store-select-E77E3ZY7.js → store-select-SARJSWL4.js} +32 -13
- package/dist/{tax-regions-S2LFRTMP.js → tax-regions-4NK7L6FA.js} +7 -4
- package/dist/{team-N2C5JPSU.js → team-45IARFMH.js} +19 -18
- package/package.json +17 -12
- /package/dist/{chunk-HFRHHT36.js → chunk-NWU7EGGF.js} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useCancelExchangeBegin,
|
|
3
3
|
useExchanges
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EFKHV25A.js";
|
|
5
5
|
import {
|
|
6
6
|
useCancelClaimBegin,
|
|
7
7
|
useClaims
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MK44MYO7.js";
|
|
9
9
|
import {
|
|
10
10
|
getReturnableQuantity
|
|
11
11
|
} from "./chunk-UM7ZR3VU.js";
|
|
@@ -25,11 +25,14 @@ import {
|
|
|
25
25
|
useCancelReturn,
|
|
26
26
|
useCancelReturnRequest,
|
|
27
27
|
useReturns
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-HLAV55RT.js";
|
|
29
|
+
import {
|
|
30
|
+
display_id_default
|
|
31
|
+
} from "./chunk-WQTWBXKO.js";
|
|
29
32
|
import {
|
|
30
33
|
useCancelOrderEdit,
|
|
31
34
|
useConfirmOrderEdit
|
|
32
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-KEXXZLVI.js";
|
|
33
36
|
import {
|
|
34
37
|
formatProvider
|
|
35
38
|
} from "./chunk-VW56KWO2.js";
|
|
@@ -42,12 +45,12 @@ import {
|
|
|
42
45
|
getCanceledOrderStatus,
|
|
43
46
|
getOrderFulfillmentStatus,
|
|
44
47
|
getOrderPaymentStatus
|
|
45
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-T35QBLG7.js";
|
|
46
49
|
import {
|
|
47
50
|
getLocaleAmount,
|
|
48
51
|
getStylizedAmount,
|
|
49
52
|
isAmountLessThenRoundingError
|
|
50
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-XCHKUSUU.js";
|
|
51
54
|
import "./chunk-JRTZWK77.js";
|
|
52
55
|
import "./chunk-IQPN4PZJ.js";
|
|
53
56
|
import {
|
|
@@ -75,25 +78,25 @@ import "./chunk-VE6GRIIN.js";
|
|
|
75
78
|
import "./chunk-7MARNXFG.js";
|
|
76
79
|
import "./chunk-MNHP6YRC.js";
|
|
77
80
|
import "./chunk-NTJ3BMOE.js";
|
|
78
|
-
import "./chunk-
|
|
79
|
-
import "./chunk-
|
|
81
|
+
import "./chunk-CLS6PNZY.js";
|
|
82
|
+
import "./chunk-JIXW4WHZ.js";
|
|
80
83
|
import "./chunk-GZ4KTAWS.js";
|
|
81
84
|
import "./chunk-PUAWN7SS.js";
|
|
82
85
|
import {
|
|
83
86
|
useMember
|
|
84
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-4NADEZZQ.js";
|
|
85
88
|
import {
|
|
86
89
|
useCustomer
|
|
87
|
-
} from "./chunk-
|
|
88
|
-
import "./chunk-
|
|
90
|
+
} from "./chunk-XWHHBJGS.js";
|
|
91
|
+
import "./chunk-5NVY7JZC.js";
|
|
89
92
|
import "./chunk-KIURBTC4.js";
|
|
90
|
-
import "./chunk-
|
|
93
|
+
import "./chunk-4EAC3GT7.js";
|
|
91
94
|
import "./chunk-JR7AABT5.js";
|
|
92
95
|
import {
|
|
93
96
|
useStockLocation
|
|
94
97
|
} from "./chunk-ZQCCVCHB.js";
|
|
95
|
-
import "./chunk-
|
|
96
|
-
import "./chunk-
|
|
98
|
+
import "./chunk-MABIMRLS.js";
|
|
99
|
+
import "./chunk-ULEW54ED.js";
|
|
97
100
|
import {
|
|
98
101
|
ordersQueryKeys,
|
|
99
102
|
useCancelOrder,
|
|
@@ -104,9 +107,9 @@ import {
|
|
|
104
107
|
useOrderCommissionLines,
|
|
105
108
|
useOrderPreview,
|
|
106
109
|
useReservationItems
|
|
107
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-UEPUKWD7.js";
|
|
108
111
|
import "./chunk-JJP6AKMV.js";
|
|
109
|
-
import "./chunk-
|
|
112
|
+
import "./chunk-744GLNZW.js";
|
|
110
113
|
import "./chunk-A5DJIOHN.js";
|
|
111
114
|
import {
|
|
112
115
|
queryClient
|
|
@@ -118,13 +121,17 @@ import {
|
|
|
118
121
|
import "./chunk-NBMM2TZK.js";
|
|
119
122
|
|
|
120
123
|
// src/pages/orders/[id]/loader.tsx
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
import { getLinkQuery } from "@mercurjs/dashboard-shared";
|
|
125
|
+
var orderDetailQuery = (id) => {
|
|
126
|
+
const { fields } = getLinkQuery("order", DEFAULT_FIELDS);
|
|
127
|
+
return {
|
|
128
|
+
queryKey: ordersQueryKeys.detail(id, { fields }),
|
|
129
|
+
queryFn: async () => fetchQuery(`/vendor/orders/${id}`, {
|
|
130
|
+
method: "GET",
|
|
131
|
+
query: { fields }
|
|
132
|
+
})
|
|
133
|
+
};
|
|
134
|
+
};
|
|
128
135
|
var loader = async ({ params }) => {
|
|
129
136
|
const id = params.id;
|
|
130
137
|
const query = orderDetailQuery(id);
|
|
@@ -134,12 +141,14 @@ var loader = async ({ params }) => {
|
|
|
134
141
|
// src/pages/orders/[id]/order-detail-page.tsx
|
|
135
142
|
import { Children } from "react";
|
|
136
143
|
import { useLoaderData, useParams } from "react-router-dom";
|
|
144
|
+
import { useLinkQuery, WidgetZone as WidgetZone2 } from "@mercurjs/dashboard-shared";
|
|
137
145
|
|
|
138
146
|
// src/pages/orders/[id]/_components/active-order-claim-section/active-order-claim-section.tsx
|
|
139
147
|
import { ExclamationCircle } from "@medusajs/icons";
|
|
140
148
|
import { Button, Container, Heading, Text, toast } from "@medusajs/ui";
|
|
141
149
|
import { useNavigate } from "react-router-dom";
|
|
142
150
|
import { useTranslation } from "react-i18next";
|
|
151
|
+
import { DisplayExtensionZone } from "@mercurjs/dashboard-shared";
|
|
143
152
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
144
153
|
var readClaimId = (change) => {
|
|
145
154
|
if (change && typeof change === "object" && "claim_id" in change && typeof change.claim_id === "string") {
|
|
@@ -181,37 +190,47 @@ var ActiveOrderClaimSection = ({
|
|
|
181
190
|
},
|
|
182
191
|
className: "-m-4 mb-1 border-b border-l p-4",
|
|
183
192
|
"data-testid": "active-order-claim-section",
|
|
184
|
-
children: /* @__PURE__ */
|
|
185
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
186
|
-
/* @__PURE__ */ jsxs("div", {
|
|
187
|
-
/* @__PURE__ */
|
|
188
|
-
|
|
193
|
+
children: /* @__PURE__ */ jsxs(Container, { className: "flex items-center justify-between p-0", children: [
|
|
194
|
+
/* @__PURE__ */ jsxs("div", { className: "flex w-full flex-row justify-between", children: [
|
|
195
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
196
|
+
/* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center gap-2 px-6 pt-4", children: [
|
|
197
|
+
/* @__PURE__ */ jsx(ExclamationCircle, { className: "text-ui-fg-subtle" }),
|
|
198
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", children: t("orders.claims.panel.title") })
|
|
199
|
+
] }),
|
|
200
|
+
/* @__PURE__ */ jsx("div", { className: "gap-2 px-6 pb-4", children: /* @__PURE__ */ jsx(Text, { children: t("orders.claims.panel.description") }) })
|
|
189
201
|
] }),
|
|
190
|
-
/* @__PURE__ */
|
|
202
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
203
|
+
/* @__PURE__ */ jsx(
|
|
204
|
+
Button,
|
|
205
|
+
{
|
|
206
|
+
size: "small",
|
|
207
|
+
variant: "secondary",
|
|
208
|
+
onClick: onCancelClaim,
|
|
209
|
+
"data-testid": "active-order-claim-cancel",
|
|
210
|
+
children: t("orders.claims.cancel.title")
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
/* @__PURE__ */ jsx(
|
|
214
|
+
Button,
|
|
215
|
+
{
|
|
216
|
+
size: "small",
|
|
217
|
+
variant: "secondary",
|
|
218
|
+
onClick: onContinueClaim,
|
|
219
|
+
"data-testid": "active-order-claim-continue",
|
|
220
|
+
children: t("actions.continue")
|
|
221
|
+
}
|
|
222
|
+
)
|
|
223
|
+
] })
|
|
191
224
|
] }),
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}
|
|
202
|
-
),
|
|
203
|
-
/* @__PURE__ */ jsx(
|
|
204
|
-
Button,
|
|
205
|
-
{
|
|
206
|
-
size: "small",
|
|
207
|
-
variant: "secondary",
|
|
208
|
-
onClick: onContinueClaim,
|
|
209
|
-
"data-testid": "active-order-claim-continue",
|
|
210
|
-
children: t("actions.continue")
|
|
211
|
-
}
|
|
212
|
-
)
|
|
213
|
-
] })
|
|
214
|
-
] }) })
|
|
225
|
+
/* @__PURE__ */ jsx(
|
|
226
|
+
DisplayExtensionZone,
|
|
227
|
+
{
|
|
228
|
+
model: "order",
|
|
229
|
+
zone: "active-claim",
|
|
230
|
+
data: orderPreview
|
|
231
|
+
}
|
|
232
|
+
)
|
|
233
|
+
] })
|
|
215
234
|
}
|
|
216
235
|
);
|
|
217
236
|
};
|
|
@@ -221,6 +240,7 @@ import { ArrowPath } from "@medusajs/icons";
|
|
|
221
240
|
import { Button as Button2, Container as Container2, Heading as Heading2, Text as Text2, toast as toast2 } from "@medusajs/ui";
|
|
222
241
|
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
223
242
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
243
|
+
import { DisplayExtensionZone as DisplayExtensionZone2 } from "@mercurjs/dashboard-shared";
|
|
224
244
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
225
245
|
var readExchangeId = (change) => {
|
|
226
246
|
if (change && typeof change === "object" && "exchange_id" in change && typeof change.exchange_id === "string") {
|
|
@@ -262,37 +282,47 @@ var ActiveOrderExchangeSection = ({
|
|
|
262
282
|
},
|
|
263
283
|
className: "-m-4 mb-1 border-b border-l p-4",
|
|
264
284
|
"data-testid": "active-order-exchange-section",
|
|
265
|
-
children: /* @__PURE__ */
|
|
266
|
-
/* @__PURE__ */ jsxs2("div", { children: [
|
|
267
|
-
/* @__PURE__ */ jsxs2("div", {
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
|
|
285
|
+
children: /* @__PURE__ */ jsxs2(Container2, { className: "flex items-center justify-between p-0", children: [
|
|
286
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex w-full flex-row justify-between", children: [
|
|
287
|
+
/* @__PURE__ */ jsxs2("div", { children: [
|
|
288
|
+
/* @__PURE__ */ jsxs2("div", { className: "mb-2 flex items-center gap-2 px-6 pt-4", children: [
|
|
289
|
+
/* @__PURE__ */ jsx2(ArrowPath, { className: "text-ui-fg-subtle" }),
|
|
290
|
+
/* @__PURE__ */ jsx2(Heading2, { level: "h2", children: t("orders.exchanges.panel.title") })
|
|
291
|
+
] }),
|
|
292
|
+
/* @__PURE__ */ jsx2("div", { className: "gap-2 px-6 pb-4", children: /* @__PURE__ */ jsx2(Text2, { children: t("orders.exchanges.panel.description") }) })
|
|
270
293
|
] }),
|
|
271
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
295
|
+
/* @__PURE__ */ jsx2(
|
|
296
|
+
Button2,
|
|
297
|
+
{
|
|
298
|
+
size: "small",
|
|
299
|
+
variant: "secondary",
|
|
300
|
+
onClick: onCancelExchange,
|
|
301
|
+
"data-testid": "active-order-exchange-cancel",
|
|
302
|
+
children: t("orders.exchanges.cancel.title")
|
|
303
|
+
}
|
|
304
|
+
),
|
|
305
|
+
/* @__PURE__ */ jsx2(
|
|
306
|
+
Button2,
|
|
307
|
+
{
|
|
308
|
+
size: "small",
|
|
309
|
+
variant: "secondary",
|
|
310
|
+
onClick: onContinueExchange,
|
|
311
|
+
"data-testid": "active-order-exchange-continue",
|
|
312
|
+
children: t("actions.continue")
|
|
313
|
+
}
|
|
314
|
+
)
|
|
315
|
+
] })
|
|
272
316
|
] }),
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
283
|
-
),
|
|
284
|
-
/* @__PURE__ */ jsx2(
|
|
285
|
-
Button2,
|
|
286
|
-
{
|
|
287
|
-
size: "small",
|
|
288
|
-
variant: "secondary",
|
|
289
|
-
onClick: onContinueExchange,
|
|
290
|
-
"data-testid": "active-order-exchange-continue",
|
|
291
|
-
children: t("actions.continue")
|
|
292
|
-
}
|
|
293
|
-
)
|
|
294
|
-
] })
|
|
295
|
-
] }) })
|
|
317
|
+
/* @__PURE__ */ jsx2(
|
|
318
|
+
DisplayExtensionZone2,
|
|
319
|
+
{
|
|
320
|
+
model: "order",
|
|
321
|
+
zone: "active-exchange",
|
|
322
|
+
data: orderPreview
|
|
323
|
+
}
|
|
324
|
+
)
|
|
325
|
+
] })
|
|
296
326
|
}
|
|
297
327
|
);
|
|
298
328
|
};
|
|
@@ -302,6 +332,7 @@ import { ArrowUturnLeft } from "@medusajs/icons";
|
|
|
302
332
|
import { Button as Button3, Container as Container3, Heading as Heading3, Text as Text3, toast as toast3 } from "@medusajs/ui";
|
|
303
333
|
import { useNavigate as useNavigate3 } from "react-router-dom";
|
|
304
334
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
335
|
+
import { DisplayExtensionZone as DisplayExtensionZone3 } from "@mercurjs/dashboard-shared";
|
|
305
336
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
306
337
|
var readReturnId = (change) => {
|
|
307
338
|
if (change && typeof change === "object" && "return_id" in change && typeof change.return_id === "string") {
|
|
@@ -345,37 +376,47 @@ var ActiveOrderReturnSection = ({
|
|
|
345
376
|
},
|
|
346
377
|
className: "-m-4 mb-1 border-b border-l p-4",
|
|
347
378
|
"data-testid": "active-order-return-section",
|
|
348
|
-
children: /* @__PURE__ */
|
|
349
|
-
/* @__PURE__ */ jsxs3("div", { children: [
|
|
350
|
-
/* @__PURE__ */ jsxs3("div", {
|
|
351
|
-
/* @__PURE__ */
|
|
352
|
-
|
|
379
|
+
children: /* @__PURE__ */ jsxs3(Container3, { className: "flex items-center justify-between p-0", children: [
|
|
380
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex w-full flex-row justify-between", children: [
|
|
381
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
382
|
+
/* @__PURE__ */ jsxs3("div", { className: "mb-2 flex items-center gap-2 px-6 pt-4", children: [
|
|
383
|
+
/* @__PURE__ */ jsx3(ArrowUturnLeft, { className: "text-ui-fg-subtle" }),
|
|
384
|
+
/* @__PURE__ */ jsx3(Heading3, { level: "h2", children: t("orders.returns.panel.title") })
|
|
385
|
+
] }),
|
|
386
|
+
/* @__PURE__ */ jsx3("div", { className: "gap-2 px-6 pb-4", children: /* @__PURE__ */ jsx3(Text3, { children: t("orders.returns.panel.description") }) })
|
|
353
387
|
] }),
|
|
354
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
389
|
+
/* @__PURE__ */ jsx3(
|
|
390
|
+
Button3,
|
|
391
|
+
{
|
|
392
|
+
size: "small",
|
|
393
|
+
variant: "secondary",
|
|
394
|
+
onClick: onCancelReturn,
|
|
395
|
+
"data-testid": "active-order-return-cancel",
|
|
396
|
+
children: t("orders.returns.cancel.title")
|
|
397
|
+
}
|
|
398
|
+
),
|
|
399
|
+
/* @__PURE__ */ jsx3(
|
|
400
|
+
Button3,
|
|
401
|
+
{
|
|
402
|
+
size: "small",
|
|
403
|
+
variant: "secondary",
|
|
404
|
+
onClick: onContinueReturn,
|
|
405
|
+
"data-testid": "active-order-return-continue",
|
|
406
|
+
children: t("actions.continue")
|
|
407
|
+
}
|
|
408
|
+
)
|
|
409
|
+
] })
|
|
355
410
|
] }),
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
),
|
|
367
|
-
/* @__PURE__ */ jsx3(
|
|
368
|
-
Button3,
|
|
369
|
-
{
|
|
370
|
-
size: "small",
|
|
371
|
-
variant: "secondary",
|
|
372
|
-
onClick: onContinueReturn,
|
|
373
|
-
"data-testid": "active-order-return-continue",
|
|
374
|
-
children: t("actions.continue")
|
|
375
|
-
}
|
|
376
|
-
)
|
|
377
|
-
] })
|
|
378
|
-
] }) })
|
|
411
|
+
/* @__PURE__ */ jsx3(
|
|
412
|
+
DisplayExtensionZone3,
|
|
413
|
+
{
|
|
414
|
+
model: "order",
|
|
415
|
+
zone: "active-return",
|
|
416
|
+
data: orderPreview
|
|
417
|
+
}
|
|
418
|
+
)
|
|
419
|
+
] })
|
|
379
420
|
}
|
|
380
421
|
);
|
|
381
422
|
};
|
|
@@ -386,6 +427,7 @@ import { Button as Button4, Container as Container4, Copy, Heading as Heading4,
|
|
|
386
427
|
import { useMemo } from "react";
|
|
387
428
|
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
388
429
|
import { useNavigate as useNavigate4 } from "react-router-dom";
|
|
430
|
+
import { DisplayExtensionZone as DisplayExtensionZone4 } from "@mercurjs/dashboard-shared";
|
|
389
431
|
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
390
432
|
function EditItem({
|
|
391
433
|
item,
|
|
@@ -473,53 +515,56 @@ var OrderActiveEditSection = ({
|
|
|
473
515
|
},
|
|
474
516
|
className: "-m-4 mb-1 border-b border-l p-4",
|
|
475
517
|
"data-testid": "order-active-edit-section",
|
|
476
|
-
children: /* @__PURE__ */
|
|
477
|
-
/* @__PURE__ */ jsxs4("div", { className: "flex
|
|
478
|
-
/* @__PURE__ */
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
/* @__PURE__ */
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
|
|
518
|
+
children: /* @__PURE__ */ jsxs4(Container4, { className: "flex items-center justify-between p-0", children: [
|
|
519
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex w-full flex-col divide-y divide-dashed", children: [
|
|
520
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center gap-2 px-6 py-4", children: [
|
|
521
|
+
/* @__PURE__ */ jsx4(ExclamationCircleSolid, { className: "text-blue-500" }),
|
|
522
|
+
/* @__PURE__ */ jsx4(Heading4, { level: "h2", children: t(
|
|
523
|
+
isPending ? "orders.edits.panel.titlePending" : "orders.edits.panel.title"
|
|
524
|
+
) })
|
|
525
|
+
] }),
|
|
526
|
+
!!addedItems.length && /* @__PURE__ */ jsxs4("div", { className: "txt-small text-ui-fg-subtle flex flex-row px-6 py-4", children: [
|
|
527
|
+
/* @__PURE__ */ jsx4("span", { className: "flex-1 font-medium", children: t("labels.added") }),
|
|
528
|
+
/* @__PURE__ */ jsx4("div", { className: "flex flex-1 flex-col gap-y-2", children: addedItems.map(({ item, quantity }) => /* @__PURE__ */ jsx4(EditItem, { item, quantity }, item.id)) })
|
|
529
|
+
] }),
|
|
530
|
+
!!removedItems.length && /* @__PURE__ */ jsxs4("div", { className: "txt-small text-ui-fg-subtle flex flex-row px-6 py-4", children: [
|
|
531
|
+
/* @__PURE__ */ jsx4("span", { className: "flex-1 font-medium", children: t("labels.removed") }),
|
|
532
|
+
/* @__PURE__ */ jsx4("div", { className: "flex flex-1 flex-col gap-y-2", children: removedItems.map(({ item, quantity }) => /* @__PURE__ */ jsx4(EditItem, { item, quantity }, item.id)) })
|
|
533
|
+
] }),
|
|
534
|
+
/* @__PURE__ */ jsxs4("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
535
|
+
isPending ? /* @__PURE__ */ jsx4(
|
|
536
|
+
Button4,
|
|
537
|
+
{
|
|
538
|
+
size: "small",
|
|
539
|
+
variant: "secondary",
|
|
540
|
+
onClick: () => navigate(`/orders/${order.id}/edit`),
|
|
541
|
+
"data-testid": "order-active-edit-continue",
|
|
542
|
+
children: t("actions.continueEdit")
|
|
543
|
+
}
|
|
544
|
+
) : /* @__PURE__ */ jsx4(
|
|
545
|
+
Button4,
|
|
546
|
+
{
|
|
547
|
+
size: "small",
|
|
548
|
+
variant: "secondary",
|
|
549
|
+
onClick: onConfirmOrderEdit,
|
|
550
|
+
"data-testid": "order-active-edit-force-confirm",
|
|
551
|
+
children: t("actions.forceConfirm")
|
|
552
|
+
}
|
|
553
|
+
),
|
|
554
|
+
/* @__PURE__ */ jsx4(
|
|
555
|
+
Button4,
|
|
556
|
+
{
|
|
557
|
+
size: "small",
|
|
558
|
+
variant: "secondary",
|
|
559
|
+
onClick: onCancelOrderEdit,
|
|
560
|
+
"data-testid": "order-active-edit-cancel",
|
|
561
|
+
children: t("actions.cancel")
|
|
562
|
+
}
|
|
563
|
+
)
|
|
564
|
+
] })
|
|
490
565
|
] }),
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
-
|
|
493
|
-
Button4,
|
|
494
|
-
{
|
|
495
|
-
size: "small",
|
|
496
|
-
variant: "secondary",
|
|
497
|
-
onClick: () => navigate(`/orders/${order.id}/edit`),
|
|
498
|
-
"data-testid": "order-active-edit-continue",
|
|
499
|
-
children: t("actions.continueEdit")
|
|
500
|
-
}
|
|
501
|
-
) : /* @__PURE__ */ jsx4(
|
|
502
|
-
Button4,
|
|
503
|
-
{
|
|
504
|
-
size: "small",
|
|
505
|
-
variant: "secondary",
|
|
506
|
-
onClick: onConfirmOrderEdit,
|
|
507
|
-
"data-testid": "order-active-edit-force-confirm",
|
|
508
|
-
children: t("actions.forceConfirm")
|
|
509
|
-
}
|
|
510
|
-
),
|
|
511
|
-
/* @__PURE__ */ jsx4(
|
|
512
|
-
Button4,
|
|
513
|
-
{
|
|
514
|
-
size: "small",
|
|
515
|
-
variant: "secondary",
|
|
516
|
-
onClick: onCancelOrderEdit,
|
|
517
|
-
"data-testid": "order-active-edit-cancel",
|
|
518
|
-
children: t("actions.cancel")
|
|
519
|
-
}
|
|
520
|
-
)
|
|
521
|
-
] })
|
|
522
|
-
] }) })
|
|
566
|
+
/* @__PURE__ */ jsx4(DisplayExtensionZone4, { model: "order", zone: "active-edit", data: order })
|
|
567
|
+
] })
|
|
523
568
|
}
|
|
524
569
|
);
|
|
525
570
|
};
|
|
@@ -527,6 +572,7 @@ var OrderActiveEditSection = ({
|
|
|
527
572
|
// src/pages/orders/[id]/_components/order-activity-section/order-activity-section.tsx
|
|
528
573
|
import { Container as Container5, Heading as Heading5 } from "@medusajs/ui";
|
|
529
574
|
import { useTranslation as useTranslation15 } from "react-i18next";
|
|
575
|
+
import { DisplayExtensionZone as DisplayExtensionZone5 } from "@mercurjs/dashboard-shared";
|
|
530
576
|
|
|
531
577
|
// src/pages/orders/[id]/_components/order-activity-section/hooks/use-activity-items.tsx
|
|
532
578
|
import { useMemo as useMemo3 } from "react";
|
|
@@ -1370,83 +1416,38 @@ var OrderActivitySection = ({ order }) => {
|
|
|
1370
1416
|
const { t } = useTranslation15();
|
|
1371
1417
|
return /* @__PURE__ */ jsxs17(Container5, { className: "flex flex-col gap-y-8 px-6 py-4", children: [
|
|
1372
1418
|
/* @__PURE__ */ jsx16("div", { className: "flex flex-col gap-y-4", children: /* @__PURE__ */ jsx16("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx16(Heading5, { level: "h2", children: t("orders.activity.header") }) }) }),
|
|
1373
|
-
/* @__PURE__ */ jsx16(OrderTimeline, { order })
|
|
1374
|
-
|
|
1375
|
-
};
|
|
1376
|
-
|
|
1377
|
-
// src/pages/orders/[id]/_components/order-commission-section/order-commission-section.tsx
|
|
1378
|
-
import { Container as Container6, Heading as Heading6, Text as Text16 } from "@medusajs/ui";
|
|
1379
|
-
import { useMemo as useMemo4 } from "react";
|
|
1380
|
-
import { useTranslation as useTranslation16 } from "react-i18next";
|
|
1381
|
-
import { jsx as jsx17, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1382
|
-
var OrderCommissionSection = ({
|
|
1383
|
-
order
|
|
1384
|
-
}) => {
|
|
1385
|
-
const { t } = useTranslation16();
|
|
1386
|
-
const { commission_lines, isLoading } = useOrderCommissionLines(order.id);
|
|
1387
|
-
const itemTitleById = useMemo4(() => {
|
|
1388
|
-
const map = /* @__PURE__ */ new Map();
|
|
1389
|
-
order.items?.forEach((item) => {
|
|
1390
|
-
map.set(item.id, item.product_title ?? item.title);
|
|
1391
|
-
});
|
|
1392
|
-
return map;
|
|
1393
|
-
}, [order.items]);
|
|
1394
|
-
if (isLoading || !commission_lines.length) {
|
|
1395
|
-
return null;
|
|
1396
|
-
}
|
|
1397
|
-
const total = commission_lines.reduce(
|
|
1398
|
-
(acc, line) => acc + (line.amount ?? 0),
|
|
1399
|
-
0
|
|
1400
|
-
);
|
|
1401
|
-
return /* @__PURE__ */ jsxs18(Container6, { className: "divide-y p-0", "data-testid": "order-commission-section", children: [
|
|
1402
|
-
/* @__PURE__ */ jsx17("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx17(Heading6, { level: "h2", children: t("fields.commission", "Commission") }) }),
|
|
1403
|
-
/* @__PURE__ */ jsx17("div", { className: "divide-y", children: commission_lines.map((line) => {
|
|
1404
|
-
const label = line.shipping_method_id ? t("fields.shipping") : itemTitleById.get(line.item_id ?? "") ?? line.code;
|
|
1405
|
-
return /* @__PURE__ */ jsxs18(
|
|
1406
|
-
"div",
|
|
1407
|
-
{
|
|
1408
|
-
className: "text-ui-fg-subtle grid grid-cols-2 items-center gap-4 px-6 py-4",
|
|
1409
|
-
children: [
|
|
1410
|
-
/* @__PURE__ */ jsx17(Text16, { size: "small", leading: "compact", children: label }),
|
|
1411
|
-
/* @__PURE__ */ jsx17(Text16, { size: "small", leading: "compact", className: "text-right", children: getLocaleAmount(line.amount, order.currency_code) })
|
|
1412
|
-
]
|
|
1413
|
-
},
|
|
1414
|
-
line.id
|
|
1415
|
-
);
|
|
1416
|
-
}) }),
|
|
1417
|
-
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1418
|
-
/* @__PURE__ */ jsx17(Text16, { size: "small", weight: "plus", leading: "compact", children: t("orders.commission.total", "Total") }),
|
|
1419
|
-
/* @__PURE__ */ jsx17(Text16, { size: "small", weight: "plus", leading: "compact", children: getLocaleAmount(total, order.currency_code) })
|
|
1420
|
-
] })
|
|
1419
|
+
/* @__PURE__ */ jsx16(OrderTimeline, { order }),
|
|
1420
|
+
/* @__PURE__ */ jsx16(DisplayExtensionZone5, { model: "order", zone: "activity", data: order })
|
|
1421
1421
|
] });
|
|
1422
1422
|
};
|
|
1423
1423
|
|
|
1424
1424
|
// src/pages/orders/[id]/_components/order-customer-section/order-customer-section.tsx
|
|
1425
|
-
import { Container as
|
|
1426
|
-
import { useTranslation as
|
|
1425
|
+
import { Container as Container6, Heading as Heading6 } from "@medusajs/ui";
|
|
1426
|
+
import { useTranslation as useTranslation17 } from "react-i18next";
|
|
1427
|
+
import { DisplayExtensionZone as DisplayExtensionZone6 } from "@mercurjs/dashboard-shared";
|
|
1427
1428
|
|
|
1428
1429
|
// src/components/common/customer-info/customer-info.tsx
|
|
1429
|
-
import { Avatar as Avatar2, Copy as Copy2, Text as
|
|
1430
|
-
import { useTranslation as
|
|
1430
|
+
import { Avatar as Avatar2, Copy as Copy2, Text as Text16 } from "@medusajs/ui";
|
|
1431
|
+
import { useTranslation as useTranslation16 } from "react-i18next";
|
|
1431
1432
|
import { Link as Link2 } from "react-router-dom";
|
|
1432
|
-
import { jsx as
|
|
1433
|
+
import { jsx as jsx17, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1433
1434
|
var ID = ({ data }) => {
|
|
1434
|
-
const { t } =
|
|
1435
|
+
const { t } = useTranslation16();
|
|
1435
1436
|
const id = data.customer_id;
|
|
1436
1437
|
const name = getOrderCustomer(data);
|
|
1437
1438
|
const email = data.email;
|
|
1438
1439
|
const fallback = (name || email || "").charAt(0).toUpperCase();
|
|
1439
|
-
return /* @__PURE__ */
|
|
1440
|
-
/* @__PURE__ */
|
|
1441
|
-
/* @__PURE__ */
|
|
1440
|
+
return /* @__PURE__ */ jsxs18("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1441
|
+
/* @__PURE__ */ jsx17(Text16, { size: "small", leading: "compact", weight: "plus", children: t("fields.id") }),
|
|
1442
|
+
/* @__PURE__ */ jsx17(
|
|
1442
1443
|
Link2,
|
|
1443
1444
|
{
|
|
1444
1445
|
to: `/customers/${id}`,
|
|
1445
1446
|
className: "focus:shadow-borders-focus rounded-[4px] outline-none transition-shadow",
|
|
1446
|
-
children: /* @__PURE__ */
|
|
1447
|
-
/* @__PURE__ */
|
|
1448
|
-
/* @__PURE__ */
|
|
1449
|
-
|
|
1447
|
+
children: /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-x-2 overflow-hidden", children: [
|
|
1448
|
+
/* @__PURE__ */ jsx17(Avatar2, { size: "2xsmall", fallback }),
|
|
1449
|
+
/* @__PURE__ */ jsx17(
|
|
1450
|
+
Text16,
|
|
1450
1451
|
{
|
|
1451
1452
|
size: "small",
|
|
1452
1453
|
leading: "compact",
|
|
@@ -1460,26 +1461,26 @@ var ID = ({ data }) => {
|
|
|
1460
1461
|
] });
|
|
1461
1462
|
};
|
|
1462
1463
|
var Company = ({ data }) => {
|
|
1463
|
-
const { t } =
|
|
1464
|
+
const { t } = useTranslation16();
|
|
1464
1465
|
const company = data.shipping_address?.company || data.billing_address?.company;
|
|
1465
1466
|
if (!company) {
|
|
1466
1467
|
return null;
|
|
1467
1468
|
}
|
|
1468
|
-
return /* @__PURE__ */
|
|
1469
|
-
/* @__PURE__ */
|
|
1470
|
-
/* @__PURE__ */
|
|
1469
|
+
return /* @__PURE__ */ jsxs18("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1470
|
+
/* @__PURE__ */ jsx17(Text16, { size: "small", leading: "compact", weight: "plus", children: t("fields.company") }),
|
|
1471
|
+
/* @__PURE__ */ jsx17(Text16, { size: "small", leading: "compact", className: "truncate", children: company })
|
|
1471
1472
|
] });
|
|
1472
1473
|
};
|
|
1473
1474
|
var Contact = ({ data }) => {
|
|
1474
|
-
const { t } =
|
|
1475
|
+
const { t } = useTranslation16();
|
|
1475
1476
|
const phone = data.shipping_address?.phone || data.billing_address?.phone;
|
|
1476
1477
|
const email = data.email || "";
|
|
1477
|
-
return /* @__PURE__ */
|
|
1478
|
-
/* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1482
|
-
|
|
1478
|
+
return /* @__PURE__ */ jsxs18("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1479
|
+
/* @__PURE__ */ jsx17(Text16, { size: "small", leading: "compact", weight: "plus", children: t("orders.customer.contactLabel") }),
|
|
1480
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-y-2", children: [
|
|
1481
|
+
/* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
1482
|
+
/* @__PURE__ */ jsx17(
|
|
1483
|
+
Text16,
|
|
1483
1484
|
{
|
|
1484
1485
|
size: "small",
|
|
1485
1486
|
leading: "compact",
|
|
@@ -1487,11 +1488,11 @@ var Contact = ({ data }) => {
|
|
|
1487
1488
|
children: email
|
|
1488
1489
|
}
|
|
1489
1490
|
),
|
|
1490
|
-
/* @__PURE__ */
|
|
1491
|
+
/* @__PURE__ */ jsx17("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx17(Copy2, { content: email, className: "text-ui-fg-muted" }) })
|
|
1491
1492
|
] }),
|
|
1492
|
-
phone && /* @__PURE__ */
|
|
1493
|
-
/* @__PURE__ */
|
|
1494
|
-
|
|
1493
|
+
phone && /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
1494
|
+
/* @__PURE__ */ jsx17(
|
|
1495
|
+
Text16,
|
|
1495
1496
|
{
|
|
1496
1497
|
size: "small",
|
|
1497
1498
|
leading: "compact",
|
|
@@ -1499,7 +1500,7 @@ var Contact = ({ data }) => {
|
|
|
1499
1500
|
children: phone
|
|
1500
1501
|
}
|
|
1501
1502
|
),
|
|
1502
|
-
/* @__PURE__ */
|
|
1503
|
+
/* @__PURE__ */ jsx17("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx17(Copy2, { content: phone, className: "text-ui-fg-muted" }) })
|
|
1503
1504
|
] })
|
|
1504
1505
|
] })
|
|
1505
1506
|
] });
|
|
@@ -1508,33 +1509,33 @@ var AddressPrint = ({
|
|
|
1508
1509
|
address,
|
|
1509
1510
|
type
|
|
1510
1511
|
}) => {
|
|
1511
|
-
const { t } =
|
|
1512
|
-
return /* @__PURE__ */
|
|
1513
|
-
/* @__PURE__ */
|
|
1514
|
-
address ? /* @__PURE__ */
|
|
1515
|
-
/* @__PURE__ */
|
|
1516
|
-
return /* @__PURE__ */
|
|
1512
|
+
const { t } = useTranslation16();
|
|
1513
|
+
return /* @__PURE__ */ jsxs18("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1514
|
+
/* @__PURE__ */ jsx17(Text16, { size: "small", leading: "compact", weight: "plus", children: type === "shipping" ? t("addresses.shippingAddress.label") : t("addresses.billingAddress.label") }),
|
|
1515
|
+
address ? /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
1516
|
+
/* @__PURE__ */ jsx17(Text16, { size: "small", leading: "compact", children: getFormattedAddress({ address }).map((line, i) => {
|
|
1517
|
+
return /* @__PURE__ */ jsxs18("span", { className: "break-words", children: [
|
|
1517
1518
|
line,
|
|
1518
|
-
/* @__PURE__ */
|
|
1519
|
+
/* @__PURE__ */ jsx17("br", {})
|
|
1519
1520
|
] }, i);
|
|
1520
1521
|
}) }),
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
+
/* @__PURE__ */ jsx17("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx17(
|
|
1522
1523
|
Copy2,
|
|
1523
1524
|
{
|
|
1524
1525
|
content: getFormattedAddress({ address }).join("\n"),
|
|
1525
1526
|
className: "text-ui-fg-muted"
|
|
1526
1527
|
}
|
|
1527
1528
|
) })
|
|
1528
|
-
] }) : /* @__PURE__ */
|
|
1529
|
+
] }) : /* @__PURE__ */ jsx17(Text16, { size: "small", leading: "compact", children: "-" })
|
|
1529
1530
|
] });
|
|
1530
1531
|
};
|
|
1531
1532
|
var Addresses = ({ data }) => {
|
|
1532
|
-
const { t } =
|
|
1533
|
-
return /* @__PURE__ */
|
|
1534
|
-
/* @__PURE__ */
|
|
1535
|
-
!isSameAddress(data.shipping_address, data.billing_address) ? /* @__PURE__ */
|
|
1536
|
-
/* @__PURE__ */
|
|
1537
|
-
|
|
1533
|
+
const { t } = useTranslation16();
|
|
1534
|
+
return /* @__PURE__ */ jsxs18("div", { className: "divide-y", children: [
|
|
1535
|
+
/* @__PURE__ */ jsx17(AddressPrint, { address: data.shipping_address, type: "shipping" }),
|
|
1536
|
+
!isSameAddress(data.shipping_address, data.billing_address) ? /* @__PURE__ */ jsx17(AddressPrint, { address: data.billing_address, type: "billing" }) : /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1537
|
+
/* @__PURE__ */ jsx17(
|
|
1538
|
+
Text16,
|
|
1538
1539
|
{
|
|
1539
1540
|
size: "small",
|
|
1540
1541
|
leading: "compact",
|
|
@@ -1543,7 +1544,7 @@ var Addresses = ({ data }) => {
|
|
|
1543
1544
|
children: t("addresses.billingAddress.label")
|
|
1544
1545
|
}
|
|
1545
1546
|
),
|
|
1546
|
-
/* @__PURE__ */
|
|
1547
|
+
/* @__PURE__ */ jsx17(Text16, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: t("addresses.billingAddress.sameAsShipping") })
|
|
1547
1548
|
] })
|
|
1548
1549
|
] });
|
|
1549
1550
|
};
|
|
@@ -1568,61 +1569,64 @@ var getOrderCustomer = (obj) => {
|
|
|
1568
1569
|
};
|
|
1569
1570
|
|
|
1570
1571
|
// src/pages/orders/[id]/_components/order-customer-section/order-customer-section.tsx
|
|
1571
|
-
import { jsx as
|
|
1572
|
+
import { jsx as jsx18, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1572
1573
|
var OrderCustomerSection = ({ order }) => {
|
|
1573
|
-
return /* @__PURE__ */
|
|
1574
|
-
/* @__PURE__ */
|
|
1575
|
-
/* @__PURE__ */
|
|
1576
|
-
/* @__PURE__ */
|
|
1577
|
-
/* @__PURE__ */
|
|
1578
|
-
/* @__PURE__ */
|
|
1574
|
+
return /* @__PURE__ */ jsxs19(Container6, { className: "divide-y p-0", children: [
|
|
1575
|
+
/* @__PURE__ */ jsx18(Header, {}),
|
|
1576
|
+
/* @__PURE__ */ jsx18(CustomerInfo.ID, { data: order }),
|
|
1577
|
+
/* @__PURE__ */ jsx18(CustomerInfo.Contact, { data: order }),
|
|
1578
|
+
/* @__PURE__ */ jsx18(CustomerInfo.Company, { data: order }),
|
|
1579
|
+
/* @__PURE__ */ jsx18(CustomerInfo.Addresses, { data: order }),
|
|
1580
|
+
/* @__PURE__ */ jsx18(DisplayExtensionZone6, { model: "order", zone: "customer", data: order })
|
|
1579
1581
|
] });
|
|
1580
1582
|
};
|
|
1581
1583
|
var Header = () => {
|
|
1582
|
-
const { t } =
|
|
1583
|
-
return /* @__PURE__ */
|
|
1584
|
+
const { t } = useTranslation17();
|
|
1585
|
+
return /* @__PURE__ */ jsx18("div", { className: "flex items-center justify-between px-6 py-4", children: /* @__PURE__ */ jsx18(Heading6, { level: "h2", children: t("fields.customer") }) });
|
|
1584
1586
|
};
|
|
1585
1587
|
|
|
1586
1588
|
// src/pages/orders/[id]/_components/order-fulfillment-section/order-fulfillment-section.tsx
|
|
1587
1589
|
import { Buildings, XCircle } from "@medusajs/icons";
|
|
1588
1590
|
import {
|
|
1589
1591
|
Button as Button6,
|
|
1590
|
-
Container as
|
|
1592
|
+
Container as Container7,
|
|
1591
1593
|
Copy as Copy3,
|
|
1592
|
-
Heading as
|
|
1594
|
+
Heading as Heading7,
|
|
1593
1595
|
StatusBadge,
|
|
1594
|
-
Text as
|
|
1596
|
+
Text as Text17,
|
|
1595
1597
|
Tooltip as Tooltip2,
|
|
1596
1598
|
toast as toast5,
|
|
1597
1599
|
usePrompt as usePrompt2
|
|
1598
1600
|
} from "@medusajs/ui";
|
|
1599
1601
|
import { format } from "date-fns";
|
|
1600
|
-
import { useTranslation as
|
|
1602
|
+
import { useTranslation as useTranslation18 } from "react-i18next";
|
|
1601
1603
|
import { Link as Link3, useNavigate as useNavigate5 } from "react-router-dom";
|
|
1602
|
-
import {
|
|
1604
|
+
import { DisplayExtensionZone as DisplayExtensionZone7 } from "@mercurjs/dashboard-shared";
|
|
1605
|
+
import { Fragment as Fragment2, jsx as jsx19, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1603
1606
|
var OrderFulfillmentSection = ({
|
|
1604
1607
|
order
|
|
1605
1608
|
}) => {
|
|
1606
1609
|
const fulfillments = order.fulfillments || [];
|
|
1607
|
-
return /* @__PURE__ */
|
|
1608
|
-
/* @__PURE__ */
|
|
1609
|
-
fulfillments.map((f, index) => /* @__PURE__ */
|
|
1610
|
+
return /* @__PURE__ */ jsxs20("div", { className: "flex flex-col gap-y-3", children: [
|
|
1611
|
+
/* @__PURE__ */ jsx19(UnfulfilledItemBreakdown, { order }),
|
|
1612
|
+
fulfillments.map((f, index) => /* @__PURE__ */ jsx19(Fulfillment, { index, fulfillment: f, order }, f.id)),
|
|
1613
|
+
/* @__PURE__ */ jsx19(DisplayExtensionZone7, { model: "order", zone: "fulfillment", data: order })
|
|
1610
1614
|
] });
|
|
1611
1615
|
};
|
|
1612
1616
|
var UnfulfilledItem = ({
|
|
1613
1617
|
item,
|
|
1614
1618
|
currencyCode
|
|
1615
1619
|
}) => {
|
|
1616
|
-
return /* @__PURE__ */
|
|
1620
|
+
return /* @__PURE__ */ jsxs20(
|
|
1617
1621
|
"div",
|
|
1618
1622
|
{
|
|
1619
1623
|
className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4",
|
|
1620
1624
|
children: [
|
|
1621
|
-
/* @__PURE__ */
|
|
1622
|
-
/* @__PURE__ */
|
|
1623
|
-
/* @__PURE__ */
|
|
1624
|
-
/* @__PURE__ */
|
|
1625
|
-
|
|
1625
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-start gap-x-4", children: [
|
|
1626
|
+
/* @__PURE__ */ jsx19(Thumbnail, { src: item.thumbnail }),
|
|
1627
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
1628
|
+
/* @__PURE__ */ jsx19(
|
|
1629
|
+
Text17,
|
|
1626
1630
|
{
|
|
1627
1631
|
size: "small",
|
|
1628
1632
|
leading: "compact",
|
|
@@ -1631,20 +1635,20 @@ var UnfulfilledItem = ({
|
|
|
1631
1635
|
children: item.title
|
|
1632
1636
|
}
|
|
1633
1637
|
),
|
|
1634
|
-
item.variant_sku && /* @__PURE__ */
|
|
1635
|
-
/* @__PURE__ */
|
|
1636
|
-
/* @__PURE__ */
|
|
1638
|
+
item.variant_sku && /* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-x-1", children: [
|
|
1639
|
+
/* @__PURE__ */ jsx19(Text17, { size: "small", children: item.variant_sku }),
|
|
1640
|
+
/* @__PURE__ */ jsx19(Copy3, { content: item.variant_sku, className: "text-ui-fg-muted" })
|
|
1637
1641
|
] }),
|
|
1638
|
-
/* @__PURE__ */
|
|
1642
|
+
/* @__PURE__ */ jsx19(Text17, { size: "small", children: item.variant?.options?.map((o) => o.value).join(" \xB7 ") })
|
|
1639
1643
|
] })
|
|
1640
1644
|
] }),
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
1643
|
-
/* @__PURE__ */
|
|
1644
|
-
/* @__PURE__ */
|
|
1645
|
+
/* @__PURE__ */ jsxs20("div", { className: "grid grid-cols-3 items-center gap-x-4", children: [
|
|
1646
|
+
/* @__PURE__ */ jsx19("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx19(Text17, { size: "small", children: getLocaleAmount(item.unit_price, currencyCode) }) }),
|
|
1647
|
+
/* @__PURE__ */ jsx19("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsxs20(Text17, { children: [
|
|
1648
|
+
/* @__PURE__ */ jsx19("span", { className: "tabular-nums", children: item.quantity - item.detail.fulfilled_quantity }),
|
|
1645
1649
|
"x"
|
|
1646
1650
|
] }) }),
|
|
1647
|
-
/* @__PURE__ */
|
|
1651
|
+
/* @__PURE__ */ jsx19("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx19(Text17, { size: "small", children: getLocaleAmount(item.subtotal || 0, currencyCode) }) })
|
|
1648
1652
|
] })
|
|
1649
1653
|
]
|
|
1650
1654
|
},
|
|
@@ -1658,8 +1662,8 @@ var UnfulfilledItemBreakdown = ({ order }) => {
|
|
|
1658
1662
|
const unfulfilledItemsWithoutShipping = order.items.filter(
|
|
1659
1663
|
(i) => !i.requires_shipping && i.detail && i.quantity && i.detail.fulfilled_quantity < i.quantity
|
|
1660
1664
|
);
|
|
1661
|
-
return /* @__PURE__ */
|
|
1662
|
-
!!unfulfilledItemsWithShipping.length && /* @__PURE__ */
|
|
1665
|
+
return /* @__PURE__ */ jsxs20(Fragment2, { children: [
|
|
1666
|
+
!!unfulfilledItemsWithShipping.length && /* @__PURE__ */ jsx19(
|
|
1663
1667
|
UnfulfilledItemDisplay,
|
|
1664
1668
|
{
|
|
1665
1669
|
order,
|
|
@@ -1667,7 +1671,7 @@ var UnfulfilledItemBreakdown = ({ order }) => {
|
|
|
1667
1671
|
requiresShipping: true
|
|
1668
1672
|
}
|
|
1669
1673
|
),
|
|
1670
|
-
!!unfulfilledItemsWithoutShipping.length && /* @__PURE__ */
|
|
1674
|
+
!!unfulfilledItemsWithoutShipping.length && /* @__PURE__ */ jsx19(
|
|
1671
1675
|
UnfulfilledItemDisplay,
|
|
1672
1676
|
{
|
|
1673
1677
|
order,
|
|
@@ -1682,17 +1686,17 @@ var UnfulfilledItemDisplay = ({
|
|
|
1682
1686
|
unfulfilledItems,
|
|
1683
1687
|
requiresShipping = false
|
|
1684
1688
|
}) => {
|
|
1685
|
-
const { t } =
|
|
1689
|
+
const { t } = useTranslation18();
|
|
1686
1690
|
if (order.status === "canceled") {
|
|
1687
1691
|
return;
|
|
1688
1692
|
}
|
|
1689
|
-
return /* @__PURE__ */
|
|
1690
|
-
/* @__PURE__ */
|
|
1691
|
-
/* @__PURE__ */
|
|
1692
|
-
/* @__PURE__ */
|
|
1693
|
-
requiresShipping && /* @__PURE__ */
|
|
1694
|
-
/* @__PURE__ */
|
|
1695
|
-
/* @__PURE__ */
|
|
1693
|
+
return /* @__PURE__ */ jsxs20(Container7, { className: "divide-y p-0", children: [
|
|
1694
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1695
|
+
/* @__PURE__ */ jsx19(Heading7, { level: "h2", children: t("orders.fulfillment.unfulfilledItems") }),
|
|
1696
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-x-4", children: [
|
|
1697
|
+
requiresShipping && /* @__PURE__ */ jsx19(StatusBadge, { color: "red", className: "text-nowrap", children: t("orders.fulfillment.requiresShipping") }),
|
|
1698
|
+
/* @__PURE__ */ jsx19(StatusBadge, { color: "red", className: "text-nowrap", children: t("orders.fulfillment.awaitingFulfillmentBadge") }),
|
|
1699
|
+
/* @__PURE__ */ jsx19(
|
|
1696
1700
|
ActionMenu,
|
|
1697
1701
|
{
|
|
1698
1702
|
groups: [
|
|
@@ -1700,7 +1704,7 @@ var UnfulfilledItemDisplay = ({
|
|
|
1700
1704
|
actions: [
|
|
1701
1705
|
{
|
|
1702
1706
|
label: t("orders.fulfillment.fulfillItems"),
|
|
1703
|
-
icon: /* @__PURE__ */
|
|
1707
|
+
icon: /* @__PURE__ */ jsx19(Buildings, {}),
|
|
1704
1708
|
to: `/orders/${order.id}/fulfillment?requires_shipping=${requiresShipping}`
|
|
1705
1709
|
}
|
|
1706
1710
|
]
|
|
@@ -1710,7 +1714,7 @@ var UnfulfilledItemDisplay = ({
|
|
|
1710
1714
|
)
|
|
1711
1715
|
] })
|
|
1712
1716
|
] }),
|
|
1713
|
-
/* @__PURE__ */
|
|
1717
|
+
/* @__PURE__ */ jsx19("div", { children: unfulfilledItems.map((item) => /* @__PURE__ */ jsx19(
|
|
1714
1718
|
UnfulfilledItem,
|
|
1715
1719
|
{
|
|
1716
1720
|
item,
|
|
@@ -1725,7 +1729,7 @@ var Fulfillment = ({
|
|
|
1725
1729
|
order,
|
|
1726
1730
|
index
|
|
1727
1731
|
}) => {
|
|
1728
|
-
const { t } =
|
|
1732
|
+
const { t } = useTranslation18();
|
|
1729
1733
|
const prompt = usePrompt2();
|
|
1730
1734
|
const navigate = useNavigate5();
|
|
1731
1735
|
const showLocation = !!fulfillment.location_id;
|
|
@@ -1809,23 +1813,23 @@ var Fulfillment = ({
|
|
|
1809
1813
|
if (isError) {
|
|
1810
1814
|
throw error;
|
|
1811
1815
|
}
|
|
1812
|
-
return /* @__PURE__ */
|
|
1813
|
-
/* @__PURE__ */
|
|
1814
|
-
/* @__PURE__ */
|
|
1816
|
+
return /* @__PURE__ */ jsxs20(Container7, { className: "divide-y p-0", children: [
|
|
1817
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1818
|
+
/* @__PURE__ */ jsx19(Heading7, { level: "h2", children: t("orders.fulfillment.number", {
|
|
1815
1819
|
number: index + 1
|
|
1816
1820
|
}) }),
|
|
1817
|
-
/* @__PURE__ */
|
|
1818
|
-
/* @__PURE__ */
|
|
1821
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-x-4", children: [
|
|
1822
|
+
/* @__PURE__ */ jsx19(
|
|
1819
1823
|
Tooltip2,
|
|
1820
1824
|
{
|
|
1821
1825
|
content: format(
|
|
1822
1826
|
new Date(statusTimestamp),
|
|
1823
1827
|
"dd MMM, yyyy, HH:mm:ss"
|
|
1824
1828
|
),
|
|
1825
|
-
children: /* @__PURE__ */
|
|
1829
|
+
children: /* @__PURE__ */ jsx19(StatusBadge, { color: statusColor, className: "text-nowrap", children: statusText })
|
|
1826
1830
|
}
|
|
1827
1831
|
),
|
|
1828
|
-
/* @__PURE__ */
|
|
1832
|
+
/* @__PURE__ */ jsx19(
|
|
1829
1833
|
ActionMenu,
|
|
1830
1834
|
{
|
|
1831
1835
|
groups: [
|
|
@@ -1833,7 +1837,7 @@ var Fulfillment = ({
|
|
|
1833
1837
|
actions: [
|
|
1834
1838
|
{
|
|
1835
1839
|
label: t("actions.cancel"),
|
|
1836
|
-
icon: /* @__PURE__ */
|
|
1840
|
+
icon: /* @__PURE__ */ jsx19(XCircle, {}),
|
|
1837
1841
|
onClick: handleCancel,
|
|
1838
1842
|
disabled: cancelDisabled
|
|
1839
1843
|
}
|
|
@@ -1844,50 +1848,50 @@ var Fulfillment = ({
|
|
|
1844
1848
|
)
|
|
1845
1849
|
] })
|
|
1846
1850
|
] }),
|
|
1847
|
-
/* @__PURE__ */
|
|
1848
|
-
/* @__PURE__ */
|
|
1849
|
-
/* @__PURE__ */
|
|
1851
|
+
/* @__PURE__ */ jsxs20("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1852
|
+
/* @__PURE__ */ jsx19(Text17, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.itemsLabel") }),
|
|
1853
|
+
/* @__PURE__ */ jsx19("ul", { children: (fulfillment.items || []).map((f_item) => /* @__PURE__ */ jsx19("li", { children: /* @__PURE__ */ jsxs20(Text17, { size: "small", leading: "compact", children: [
|
|
1850
1854
|
f_item.quantity,
|
|
1851
1855
|
"x ",
|
|
1852
1856
|
f_item.title
|
|
1853
1857
|
] }) }, f_item.line_item_id)) })
|
|
1854
1858
|
] }),
|
|
1855
|
-
showLocation && /* @__PURE__ */
|
|
1856
|
-
/* @__PURE__ */
|
|
1857
|
-
stock_location ? /* @__PURE__ */
|
|
1859
|
+
showLocation && /* @__PURE__ */ jsxs20("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1860
|
+
/* @__PURE__ */ jsx19(Text17, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.shippingFromLabel") }),
|
|
1861
|
+
stock_location ? /* @__PURE__ */ jsx19(
|
|
1858
1862
|
Link3,
|
|
1859
1863
|
{
|
|
1860
1864
|
to: `/settings/locations/${stock_location.id}`,
|
|
1861
1865
|
className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover transition-fg",
|
|
1862
|
-
children: /* @__PURE__ */
|
|
1866
|
+
children: /* @__PURE__ */ jsx19(Text17, { size: "small", leading: "compact", children: stock_location.name })
|
|
1863
1867
|
}
|
|
1864
|
-
) : /* @__PURE__ */
|
|
1868
|
+
) : /* @__PURE__ */ jsx19(Skeleton, { className: "w-16" })
|
|
1865
1869
|
] }),
|
|
1866
|
-
/* @__PURE__ */
|
|
1867
|
-
/* @__PURE__ */
|
|
1868
|
-
/* @__PURE__ */
|
|
1870
|
+
/* @__PURE__ */ jsxs20("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1871
|
+
/* @__PURE__ */ jsx19(Text17, { size: "small", leading: "compact", weight: "plus", children: t("fields.provider") }),
|
|
1872
|
+
/* @__PURE__ */ jsx19(Text17, { size: "small", leading: "compact", children: formatProvider(fulfillment.provider_id) })
|
|
1869
1873
|
] }),
|
|
1870
|
-
/* @__PURE__ */
|
|
1871
|
-
/* @__PURE__ */
|
|
1872
|
-
/* @__PURE__ */
|
|
1874
|
+
/* @__PURE__ */ jsxs20("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1875
|
+
/* @__PURE__ */ jsx19(Text17, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.trackingLabel") }),
|
|
1876
|
+
/* @__PURE__ */ jsx19("div", { children: fulfillment.labels && fulfillment.labels.length > 0 ? /* @__PURE__ */ jsx19("ul", { children: fulfillment.labels.map((tlink) => {
|
|
1873
1877
|
const hasUrl = !!tlink.tracking_url?.length && tlink.tracking_url !== "#";
|
|
1874
1878
|
if (hasUrl) {
|
|
1875
|
-
return /* @__PURE__ */
|
|
1879
|
+
return /* @__PURE__ */ jsx19("li", { children: /* @__PURE__ */ jsx19(
|
|
1876
1880
|
"a",
|
|
1877
1881
|
{
|
|
1878
1882
|
href: tlink.tracking_url || "",
|
|
1879
1883
|
target: "_blank",
|
|
1880
1884
|
rel: "noopener noreferrer",
|
|
1881
1885
|
className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover transition-fg",
|
|
1882
|
-
children: /* @__PURE__ */
|
|
1886
|
+
children: /* @__PURE__ */ jsx19(Text17, { size: "small", leading: "compact", children: tlink.tracking_number })
|
|
1883
1887
|
}
|
|
1884
1888
|
) }, tlink.tracking_number);
|
|
1885
1889
|
}
|
|
1886
|
-
return /* @__PURE__ */
|
|
1887
|
-
}) }) : /* @__PURE__ */
|
|
1890
|
+
return /* @__PURE__ */ jsx19("li", { children: /* @__PURE__ */ jsx19(Text17, { size: "small", leading: "compact", children: tlink.tracking_number }) }, tlink.tracking_number);
|
|
1891
|
+
}) }) : /* @__PURE__ */ jsx19(Text17, { size: "small", leading: "compact", children: "-" }) })
|
|
1888
1892
|
] }),
|
|
1889
|
-
(showShippingButton || showDeliveryButton) && /* @__PURE__ */
|
|
1890
|
-
showDeliveryButton && /* @__PURE__ */
|
|
1893
|
+
(showShippingButton || showDeliveryButton) && /* @__PURE__ */ jsxs20("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
1894
|
+
showDeliveryButton && /* @__PURE__ */ jsx19(
|
|
1891
1895
|
Button6,
|
|
1892
1896
|
{
|
|
1893
1897
|
size: "small",
|
|
@@ -1898,7 +1902,7 @@ var Fulfillment = ({
|
|
|
1898
1902
|
)
|
|
1899
1903
|
}
|
|
1900
1904
|
),
|
|
1901
|
-
showShippingButton && /* @__PURE__ */
|
|
1905
|
+
showShippingButton && /* @__PURE__ */ jsx19(
|
|
1902
1906
|
Button6,
|
|
1903
1907
|
{
|
|
1904
1908
|
size: "small",
|
|
@@ -1914,18 +1918,25 @@ var Fulfillment = ({
|
|
|
1914
1918
|
// src/pages/orders/[id]/_components/order-general-section/order-general-section.tsx
|
|
1915
1919
|
import { XCircle as XCircle2 } from "@medusajs/icons";
|
|
1916
1920
|
import {
|
|
1917
|
-
Container as
|
|
1921
|
+
Container as Container8,
|
|
1918
1922
|
Copy as Copy4,
|
|
1919
|
-
Heading as
|
|
1923
|
+
Heading as Heading8,
|
|
1920
1924
|
StatusBadge as StatusBadge2,
|
|
1921
|
-
Text as
|
|
1925
|
+
Text as Text18,
|
|
1922
1926
|
toast as toast6,
|
|
1923
1927
|
usePrompt as usePrompt3
|
|
1924
1928
|
} from "@medusajs/ui";
|
|
1925
|
-
import { useTranslation as
|
|
1926
|
-
import {
|
|
1929
|
+
import { useTranslation as useTranslation19 } from "react-i18next";
|
|
1930
|
+
import { DisplayExtensionZone as DisplayExtensionZone8, DisplayField } from "@mercurjs/dashboard-shared";
|
|
1931
|
+
import { jsx as jsx20, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1932
|
+
var GENERAL_FIELD_IDS = [
|
|
1933
|
+
"display_id",
|
|
1934
|
+
"status",
|
|
1935
|
+
"payment_status",
|
|
1936
|
+
"fulfillment_status"
|
|
1937
|
+
];
|
|
1927
1938
|
var OrderGeneralSection = ({ order }) => {
|
|
1928
|
-
const { t } =
|
|
1939
|
+
const { t } = useTranslation19();
|
|
1929
1940
|
const prompt = usePrompt3();
|
|
1930
1941
|
const { getFullDate } = useDate();
|
|
1931
1942
|
const { mutateAsync: cancelOrder } = useCancelOrder(order.id);
|
|
@@ -1956,27 +1967,51 @@ var OrderGeneralSection = ({ order }) => {
|
|
|
1956
1967
|
}
|
|
1957
1968
|
});
|
|
1958
1969
|
};
|
|
1959
|
-
return /* @__PURE__ */
|
|
1960
|
-
/* @__PURE__ */
|
|
1961
|
-
/* @__PURE__ */
|
|
1962
|
-
/* @__PURE__ */
|
|
1970
|
+
return /* @__PURE__ */ jsxs21(Container8, { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1971
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
1972
|
+
/* @__PURE__ */ jsx20(DisplayField, { model: "order", zone: "general", id: "display_id", data: order, children: /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-x-1", children: [
|
|
1973
|
+
/* @__PURE__ */ jsxs21(Heading8, { children: [
|
|
1963
1974
|
"#",
|
|
1964
1975
|
order.display_id
|
|
1965
1976
|
] }),
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
|
|
1968
|
-
|
|
1977
|
+
/* @__PURE__ */ jsx20(
|
|
1978
|
+
Copy4,
|
|
1979
|
+
{
|
|
1980
|
+
content: `#${order.display_id}`,
|
|
1981
|
+
className: "text-ui-fg-muted"
|
|
1982
|
+
}
|
|
1983
|
+
)
|
|
1984
|
+
] }) }),
|
|
1985
|
+
/* @__PURE__ */ jsx20(Text18, { size: "small", className: "text-ui-fg-subtle", children: t("orders.onDateFromSalesChannel", {
|
|
1969
1986
|
date: getFullDate({ date: order.created_at, includeTime: true }),
|
|
1970
1987
|
salesChannel: order.sales_channel?.name
|
|
1971
1988
|
}) })
|
|
1972
1989
|
] }),
|
|
1973
|
-
/* @__PURE__ */
|
|
1974
|
-
/* @__PURE__ */
|
|
1975
|
-
/* @__PURE__ */
|
|
1976
|
-
/* @__PURE__ */
|
|
1977
|
-
|
|
1990
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-x-4", children: [
|
|
1991
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-x-1.5", children: [
|
|
1992
|
+
/* @__PURE__ */ jsx20(DisplayField, { model: "order", zone: "general", id: "status", data: order, children: /* @__PURE__ */ jsx20(OrderBadge, { order }) }),
|
|
1993
|
+
/* @__PURE__ */ jsx20(
|
|
1994
|
+
DisplayField,
|
|
1995
|
+
{
|
|
1996
|
+
model: "order",
|
|
1997
|
+
zone: "general",
|
|
1998
|
+
id: "payment_status",
|
|
1999
|
+
data: order,
|
|
2000
|
+
children: /* @__PURE__ */ jsx20(PaymentBadge, { order })
|
|
2001
|
+
}
|
|
2002
|
+
),
|
|
2003
|
+
/* @__PURE__ */ jsx20(
|
|
2004
|
+
DisplayField,
|
|
2005
|
+
{
|
|
2006
|
+
model: "order",
|
|
2007
|
+
zone: "general",
|
|
2008
|
+
id: "fulfillment_status",
|
|
2009
|
+
data: order,
|
|
2010
|
+
children: /* @__PURE__ */ jsx20(FulfillmentBadge, { order })
|
|
2011
|
+
}
|
|
2012
|
+
)
|
|
1978
2013
|
] }),
|
|
1979
|
-
/* @__PURE__ */
|
|
2014
|
+
/* @__PURE__ */ jsx20(
|
|
1980
2015
|
ActionMenu,
|
|
1981
2016
|
{
|
|
1982
2017
|
groups: [
|
|
@@ -1987,18 +2022,27 @@ var OrderGeneralSection = ({ order }) => {
|
|
|
1987
2022
|
onClick: handleCancel,
|
|
1988
2023
|
disabled: cancelDisabled,
|
|
1989
2024
|
disabledTooltip: cancelDisabledTooltip,
|
|
1990
|
-
icon: /* @__PURE__ */
|
|
2025
|
+
icon: /* @__PURE__ */ jsx20(XCircle2, {})
|
|
1991
2026
|
}
|
|
1992
2027
|
]
|
|
1993
2028
|
}
|
|
1994
2029
|
]
|
|
1995
2030
|
}
|
|
1996
2031
|
)
|
|
1997
|
-
] })
|
|
2032
|
+
] }),
|
|
2033
|
+
/* @__PURE__ */ jsx20(
|
|
2034
|
+
DisplayExtensionZone8,
|
|
2035
|
+
{
|
|
2036
|
+
model: "order",
|
|
2037
|
+
zone: "general",
|
|
2038
|
+
data: order,
|
|
2039
|
+
builtInFieldIds: GENERAL_FIELD_IDS
|
|
2040
|
+
}
|
|
2041
|
+
)
|
|
1998
2042
|
] });
|
|
1999
2043
|
};
|
|
2000
2044
|
var FulfillmentBadge = ({ order }) => {
|
|
2001
|
-
const { t } =
|
|
2045
|
+
const { t } = useTranslation19();
|
|
2002
2046
|
if (!order.fulfillment_status) {
|
|
2003
2047
|
return null;
|
|
2004
2048
|
}
|
|
@@ -2006,36 +2050,37 @@ var FulfillmentBadge = ({ order }) => {
|
|
|
2006
2050
|
t,
|
|
2007
2051
|
order.fulfillment_status
|
|
2008
2052
|
);
|
|
2009
|
-
return /* @__PURE__ */
|
|
2053
|
+
return /* @__PURE__ */ jsx20(StatusBadge2, { color, className: "text-nowrap", children: label });
|
|
2010
2054
|
};
|
|
2011
2055
|
var PaymentBadge = ({ order }) => {
|
|
2012
|
-
const { t } =
|
|
2056
|
+
const { t } = useTranslation19();
|
|
2013
2057
|
if (!order.payment_status) {
|
|
2014
2058
|
return null;
|
|
2015
2059
|
}
|
|
2016
2060
|
const { label, color } = getOrderPaymentStatus(t, order.payment_status);
|
|
2017
|
-
return /* @__PURE__ */
|
|
2061
|
+
return /* @__PURE__ */ jsx20(StatusBadge2, { color, className: "text-nowrap", children: label });
|
|
2018
2062
|
};
|
|
2019
2063
|
var OrderBadge = ({ order }) => {
|
|
2020
|
-
const { t } =
|
|
2064
|
+
const { t } = useTranslation19();
|
|
2021
2065
|
const orderStatus = getCanceledOrderStatus(t, order.status);
|
|
2022
2066
|
if (!orderStatus) {
|
|
2023
2067
|
return null;
|
|
2024
2068
|
}
|
|
2025
|
-
return /* @__PURE__ */
|
|
2069
|
+
return /* @__PURE__ */ jsx20(StatusBadge2, { color: orderStatus.color, className: "text-nowrap", children: orderStatus.label });
|
|
2026
2070
|
};
|
|
2027
2071
|
|
|
2028
2072
|
// src/pages/orders/[id]/_components/order-payment-section/order-payment-section.tsx
|
|
2029
|
-
import {
|
|
2073
|
+
import { ArrowDownRightMini, DocumentText } from "@medusajs/icons";
|
|
2030
2074
|
import {
|
|
2031
2075
|
Badge,
|
|
2032
|
-
Container as
|
|
2033
|
-
Heading as
|
|
2076
|
+
Container as Container9,
|
|
2077
|
+
Heading as Heading9,
|
|
2034
2078
|
StatusBadge as StatusBadge3,
|
|
2035
|
-
Text as
|
|
2079
|
+
Text as Text19,
|
|
2036
2080
|
Tooltip as Tooltip3
|
|
2037
2081
|
} from "@medusajs/ui";
|
|
2038
|
-
import { useTranslation as
|
|
2082
|
+
import { useTranslation as useTranslation20 } from "react-i18next";
|
|
2083
|
+
import { DisplayExtensionZone as DisplayExtensionZone9 } from "@mercurjs/dashboard-shared";
|
|
2039
2084
|
|
|
2040
2085
|
// src/lib/payment.ts
|
|
2041
2086
|
var getTotalCaptured = (paymentCollections) => paymentCollections.reduce((acc, paymentCollection) => {
|
|
@@ -2048,23 +2093,24 @@ var getTotalPending = (paymentCollections) => paymentCollections.filter((pc) =>
|
|
|
2048
2093
|
}, 0);
|
|
2049
2094
|
|
|
2050
2095
|
// src/pages/orders/[id]/_components/order-payment-section/order-payment-section.tsx
|
|
2051
|
-
import { jsx as
|
|
2096
|
+
import { jsx as jsx21, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2052
2097
|
var getPaymentsFromOrder = (order) => {
|
|
2053
2098
|
return order.payment_collections?.map((collection) => collection.payments).flat(1).filter(Boolean);
|
|
2054
2099
|
};
|
|
2055
2100
|
var OrderPaymentSection = ({ order }) => {
|
|
2056
2101
|
const payments = getPaymentsFromOrder(order) ?? [];
|
|
2057
|
-
return /* @__PURE__ */
|
|
2058
|
-
/* @__PURE__ */
|
|
2059
|
-
payments.length > 0 && /* @__PURE__ */
|
|
2060
|
-
/* @__PURE__ */
|
|
2102
|
+
return /* @__PURE__ */ jsxs22(Container9, { className: "divide-y divide-dashed p-0", children: [
|
|
2103
|
+
/* @__PURE__ */ jsx21(Header2, { order }),
|
|
2104
|
+
payments.length > 0 && /* @__PURE__ */ jsx21("div", { className: "divide-y divide-dashed", children: payments.map((payment) => /* @__PURE__ */ jsx21(PaymentRow, { order, payment }, payment.id)) }),
|
|
2105
|
+
/* @__PURE__ */ jsx21(Total, { order }),
|
|
2106
|
+
/* @__PURE__ */ jsx21(DisplayExtensionZone9, { model: "order", zone: "payment", data: order })
|
|
2061
2107
|
] });
|
|
2062
2108
|
};
|
|
2063
2109
|
var Header2 = ({ order }) => {
|
|
2064
|
-
const { t } =
|
|
2065
|
-
return /* @__PURE__ */
|
|
2066
|
-
/* @__PURE__ */
|
|
2067
|
-
order.payment_status && /* @__PURE__ */
|
|
2110
|
+
const { t } = useTranslation20();
|
|
2111
|
+
return /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
2112
|
+
/* @__PURE__ */ jsx21(Heading9, { level: "h2", children: t("orders.payment.title") }),
|
|
2113
|
+
order.payment_status && /* @__PURE__ */ jsx21(
|
|
2068
2114
|
StatusBadge3,
|
|
2069
2115
|
{
|
|
2070
2116
|
color: getOrderPaymentStatus(t, order.payment_status).color,
|
|
@@ -2075,46 +2121,28 @@ var Header2 = ({ order }) => {
|
|
|
2075
2121
|
] });
|
|
2076
2122
|
};
|
|
2077
2123
|
var Total = ({ order }) => {
|
|
2078
|
-
const { t } =
|
|
2124
|
+
const { t } = useTranslation20();
|
|
2079
2125
|
if (!order.payment_collections?.length) {
|
|
2080
2126
|
return null;
|
|
2081
2127
|
}
|
|
2082
2128
|
const paymentCollections = order.payment_collections;
|
|
2083
2129
|
const totalCaptured = getTotalCaptured(paymentCollections);
|
|
2084
2130
|
const totalPending = getTotalPending(paymentCollections);
|
|
2085
|
-
|
|
2086
|
-
(
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
return /* @__PURE__ */ jsxs23("div", { children: [
|
|
2090
|
-
/* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
2091
|
-
/* @__PURE__ */ jsx22(Text20, { size: "small", weight: "plus", leading: "compact", children: t("orders.payment.totalPaidByCustomer") }),
|
|
2092
|
-
/* @__PURE__ */ jsx22(Text20, { size: "small", weight: "plus", leading: "compact", children: getStylizedAmount(totalCaptured, order.currency_code) })
|
|
2131
|
+
return /* @__PURE__ */ jsxs22("div", { children: [
|
|
2132
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
2133
|
+
/* @__PURE__ */ jsx21(Text19, { size: "small", weight: "plus", leading: "compact", children: t("orders.payment.totalPaidByCustomer") }),
|
|
2134
|
+
/* @__PURE__ */ jsx21(Text19, { size: "small", weight: "plus", leading: "compact", children: getStylizedAmount(totalCaptured, order.currency_code) })
|
|
2093
2135
|
] }),
|
|
2094
|
-
|
|
2095
|
-
/* @__PURE__ */
|
|
2096
|
-
/* @__PURE__ */
|
|
2097
|
-
] }),
|
|
2098
|
-
order.status !== "canceled" && totalPending > 0 && /* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
2099
|
-
/* @__PURE__ */ jsx22(Text20, { size: "small", weight: "plus", leading: "compact", children: t("orders.payment.totalPending") }),
|
|
2100
|
-
/* @__PURE__ */ jsx22(Text20, { size: "small", weight: "plus", leading: "compact", children: getStylizedAmount(totalPending, order.currency_code) })
|
|
2136
|
+
order.status !== "canceled" && totalPending > 0 && /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
2137
|
+
/* @__PURE__ */ jsx21(Text19, { size: "small", weight: "plus", leading: "compact", children: t("orders.payment.totalPending") }),
|
|
2138
|
+
/* @__PURE__ */ jsx21(Text19, { size: "small", weight: "plus", leading: "compact", children: getStylizedAmount(totalPending, order.currency_code) })
|
|
2101
2139
|
] })
|
|
2102
2140
|
] });
|
|
2103
2141
|
};
|
|
2104
2142
|
var getPaymentStatus = (payment) => {
|
|
2105
|
-
const refundedAmount = (payment.refunds ?? []).reduce(
|
|
2106
|
-
(acc, r) => acc + (r.amount ?? 0),
|
|
2107
|
-
0
|
|
2108
|
-
);
|
|
2109
2143
|
if (payment.canceled_at) {
|
|
2110
2144
|
return { labelKey: "orders.payment.status.canceled", color: "red" };
|
|
2111
2145
|
}
|
|
2112
|
-
if (refundedAmount > 0 && refundedAmount >= payment.amount) {
|
|
2113
|
-
return { labelKey: "orders.payment.status.refunded", color: "grey" };
|
|
2114
|
-
}
|
|
2115
|
-
if (refundedAmount > 0) {
|
|
2116
|
-
return { labelKey: "orders.payment.status.partiallyRefunded", color: "orange" };
|
|
2117
|
-
}
|
|
2118
2146
|
if (payment.captured_at) {
|
|
2119
2147
|
return { labelKey: "orders.payment.status.captured", color: "green" };
|
|
2120
2148
|
}
|
|
@@ -2124,71 +2152,41 @@ var PaymentRow = ({
|
|
|
2124
2152
|
order,
|
|
2125
2153
|
payment
|
|
2126
2154
|
}) => {
|
|
2127
|
-
const { t } =
|
|
2155
|
+
const { t } = useTranslation20();
|
|
2128
2156
|
const { getFullDate } = useDate();
|
|
2129
2157
|
const status = getPaymentStatus(payment);
|
|
2130
2158
|
const refunds = payment.refunds ?? [];
|
|
2131
|
-
const refundedAmount = refunds.reduce(
|
|
2132
|
-
(acc, r) => acc + (r.amount ?? 0),
|
|
2133
|
-
0
|
|
2134
|
-
);
|
|
2159
|
+
const refundedAmount = refunds.reduce((acc, r) => acc + (r.amount ?? 0), 0);
|
|
2135
2160
|
const isFullyRefunded = refundedAmount > 0 && refundedAmount >= payment.amount;
|
|
2136
2161
|
const canRefund = !!payment.captured_at && !payment.canceled_at && !isFullyRefunded;
|
|
2137
|
-
return /* @__PURE__ */
|
|
2138
|
-
/* @__PURE__ */
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
2141
|
-
|
|
2142
|
-
{
|
|
2143
|
-
size: "small",
|
|
2144
|
-
weight: "plus",
|
|
2145
|
-
leading: "compact",
|
|
2146
|
-
className: isFullyRefunded ? "text-ui-fg-muted truncate line-through" : "text-ui-fg-base truncate",
|
|
2147
|
-
children: `#${payment.id.slice(-7)}`
|
|
2148
|
-
}
|
|
2149
|
-
) }),
|
|
2150
|
-
/* @__PURE__ */ jsx22(
|
|
2151
|
-
Text20,
|
|
2152
|
-
{
|
|
2153
|
-
size: "xsmall",
|
|
2154
|
-
leading: "compact",
|
|
2155
|
-
className: isFullyRefunded ? "text-ui-fg-muted line-through" : "text-ui-fg-subtle",
|
|
2156
|
-
children: payment.created_at ? getFullDate({ date: payment.created_at, includeTime: true }) : null
|
|
2157
|
-
}
|
|
2158
|
-
)
|
|
2162
|
+
return /* @__PURE__ */ jsxs22("div", { className: "divide-y divide-dashed", "data-testid": `payment-row-${payment.id}`, children: [
|
|
2163
|
+
/* @__PURE__ */ jsxs22("div", { className: "text-ui-fg-subtle grid grid-cols-[1fr_1fr_1fr_20px] items-center gap-x-4 px-6 py-4 sm:grid-cols-[1fr_1fr_1fr_1fr_20px]", children: [
|
|
2164
|
+
/* @__PURE__ */ jsxs22("div", { className: "w-full min-w-[60px] overflow-hidden", children: [
|
|
2165
|
+
/* @__PURE__ */ jsx21(Text19, { size: "small", leading: "compact", weight: "plus", className: "truncate", children: /* @__PURE__ */ jsx21(display_id_default, { id: payment.id }) }),
|
|
2166
|
+
/* @__PURE__ */ jsx21(Text19, { size: "small", leading: "compact", children: payment.created_at ? getFullDate({ date: payment.created_at, includeTime: true }) : null })
|
|
2159
2167
|
] }),
|
|
2160
|
-
/* @__PURE__ */
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
icon: /* @__PURE__ */ jsx22(ArrowUturnLeft2, {}),
|
|
2181
|
-
to: `/orders/${order.id}/refund?payment_id=${payment.id}`,
|
|
2182
|
-
disabled: !canRefund
|
|
2183
|
-
}
|
|
2184
|
-
]
|
|
2185
|
-
}
|
|
2186
|
-
]
|
|
2187
|
-
}
|
|
2188
|
-
)
|
|
2189
|
-
] })
|
|
2168
|
+
/* @__PURE__ */ jsx21("div", { className: "hidden items-center justify-end sm:flex", children: /* @__PURE__ */ jsx21(Text19, { size: "small", leading: "compact", className: "capitalize", children: payment.provider_id }) }),
|
|
2169
|
+
/* @__PURE__ */ jsx21("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx21(StatusBadge3, { color: status.color, className: "text-nowrap", children: t(status.labelKey) }) }),
|
|
2170
|
+
/* @__PURE__ */ jsx21("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx21(Text19, { size: "small", leading: "compact", children: getLocaleAmount(payment.amount, order.currency_code) }) }),
|
|
2171
|
+
/* @__PURE__ */ jsx21(
|
|
2172
|
+
ActionMenu,
|
|
2173
|
+
{
|
|
2174
|
+
groups: [
|
|
2175
|
+
{
|
|
2176
|
+
actions: [
|
|
2177
|
+
{
|
|
2178
|
+
label: t("orders.payment.createRefund"),
|
|
2179
|
+
icon: /* @__PURE__ */ jsx21(ArrowDownRightMini, {}),
|
|
2180
|
+
to: `/orders/${order.id}/refund?payment_id=${payment.id}`,
|
|
2181
|
+
disabled: !canRefund
|
|
2182
|
+
}
|
|
2183
|
+
]
|
|
2184
|
+
}
|
|
2185
|
+
]
|
|
2186
|
+
}
|
|
2187
|
+
)
|
|
2190
2188
|
] }),
|
|
2191
|
-
refunds.map((refund) => /* @__PURE__ */
|
|
2189
|
+
refunds.map((refund) => /* @__PURE__ */ jsx21(
|
|
2192
2190
|
RefundRow,
|
|
2193
2191
|
{
|
|
2194
2192
|
refund,
|
|
@@ -2202,38 +2200,49 @@ var RefundRow = ({
|
|
|
2202
2200
|
refund,
|
|
2203
2201
|
currencyCode
|
|
2204
2202
|
}) => {
|
|
2205
|
-
const { t } =
|
|
2203
|
+
const { t } = useTranslation20();
|
|
2206
2204
|
const { getFullDate } = useDate();
|
|
2207
2205
|
const reasonLabel = refund.refund_reason?.label ?? null;
|
|
2208
|
-
return /* @__PURE__ */
|
|
2206
|
+
return /* @__PURE__ */ jsxs22(
|
|
2209
2207
|
"div",
|
|
2210
2208
|
{
|
|
2211
|
-
className: "
|
|
2209
|
+
className: "bg-ui-bg-subtle text-ui-fg-subtle grid grid-cols-[1fr_1fr_1fr_20px] items-center gap-x-4 px-6 py-4",
|
|
2212
2210
|
"data-testid": `refund-row-${refund.id}`,
|
|
2213
2211
|
children: [
|
|
2214
|
-
/* @__PURE__ */
|
|
2215
|
-
/* @__PURE__ */
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2212
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex flex-row", children: [
|
|
2213
|
+
/* @__PURE__ */ jsx21("div", { className: "self-center pr-3", children: /* @__PURE__ */ jsx21(ArrowDownRightMini, { className: "text-ui-fg-muted" }) }),
|
|
2214
|
+
/* @__PURE__ */ jsxs22("div", { className: "min-w-0", children: [
|
|
2215
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-x-1", children: [
|
|
2216
|
+
/* @__PURE__ */ jsx21(Text19, { size: "small", leading: "compact", weight: "plus", children: t("orders.payment.refund") }),
|
|
2217
|
+
refund.note && /* @__PURE__ */ jsx21(Tooltip3, { content: refund.note, children: /* @__PURE__ */ jsx21(DocumentText, { className: "text-ui-tag-neutral-icon inline" }) })
|
|
2218
|
+
] }),
|
|
2219
|
+
refund.created_at && /* @__PURE__ */ jsx21(Text19, { size: "small", leading: "compact", children: getFullDate({ date: refund.created_at, includeTime: true }) })
|
|
2220
|
+
] })
|
|
2221
2221
|
] }),
|
|
2222
|
-
/* @__PURE__ */
|
|
2222
|
+
/* @__PURE__ */ jsx21("div", { className: "flex items-center justify-end", children: reasonLabel && /* @__PURE__ */ jsx21(
|
|
2223
|
+
Badge,
|
|
2224
|
+
{
|
|
2225
|
+
size: "2xsmall",
|
|
2226
|
+
className: "cursor-default select-none capitalize",
|
|
2227
|
+
rounded: "full",
|
|
2228
|
+
children: reasonLabel
|
|
2229
|
+
}
|
|
2230
|
+
) }),
|
|
2231
|
+
/* @__PURE__ */ jsx21("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx21(Text19, { size: "small", leading: "compact", children: `- ${getLocaleAmount(refund.amount ?? 0, currencyCode)}` }) })
|
|
2223
2232
|
]
|
|
2224
2233
|
}
|
|
2225
2234
|
);
|
|
2226
2235
|
};
|
|
2227
2236
|
|
|
2228
2237
|
// src/pages/orders/[id]/_components/order-summary-section/order-summary-section.tsx
|
|
2229
|
-
import { useMemo as
|
|
2230
|
-
import { useTranslation as
|
|
2238
|
+
import { useMemo as useMemo4, useState as useState5 } from "react";
|
|
2239
|
+
import { useTranslation as useTranslation23 } from "react-i18next";
|
|
2231
2240
|
import { Link as Link4 } from "react-router-dom";
|
|
2232
2241
|
import {
|
|
2233
|
-
ArrowDownRightMini,
|
|
2242
|
+
ArrowDownRightMini as ArrowDownRightMini2,
|
|
2234
2243
|
ArrowLongRight,
|
|
2235
2244
|
ArrowPath as ArrowPath2,
|
|
2236
|
-
ArrowUturnLeft as
|
|
2245
|
+
ArrowUturnLeft as ArrowUturnLeft2,
|
|
2237
2246
|
DocumentText as DocumentText2,
|
|
2238
2247
|
ExclamationCircle as ExclamationCircle2,
|
|
2239
2248
|
PencilSquare,
|
|
@@ -2243,23 +2252,23 @@ import {
|
|
|
2243
2252
|
Badge as Badge4,
|
|
2244
2253
|
Button as Button7,
|
|
2245
2254
|
clx as clx2,
|
|
2246
|
-
Container as
|
|
2255
|
+
Container as Container10,
|
|
2247
2256
|
Copy as Copy5,
|
|
2248
|
-
Heading as
|
|
2257
|
+
Heading as Heading10,
|
|
2249
2258
|
StatusBadge as StatusBadge4,
|
|
2250
|
-
Text as
|
|
2251
|
-
Tooltip as Tooltip5
|
|
2252
|
-
toast as toast7
|
|
2259
|
+
Text as Text21,
|
|
2260
|
+
Tooltip as Tooltip5
|
|
2253
2261
|
} from "@medusajs/ui";
|
|
2262
|
+
import { DisplayExtensionZone as DisplayExtensionZone10, WidgetZone } from "@mercurjs/dashboard-shared";
|
|
2254
2263
|
|
|
2255
2264
|
// src/pages/orders/[id]/_components/order-summary-section/return-info-popover.tsx
|
|
2256
2265
|
import { useState as useState4 } from "react";
|
|
2257
|
-
import { useTranslation as
|
|
2266
|
+
import { useTranslation as useTranslation21 } from "react-i18next";
|
|
2258
2267
|
import { InformationCircleSolid } from "@medusajs/icons";
|
|
2259
|
-
import { Badge as Badge2, Popover as Popover3, Text as
|
|
2260
|
-
import { jsx as
|
|
2268
|
+
import { Badge as Badge2, Popover as Popover3, Text as Text20 } from "@medusajs/ui";
|
|
2269
|
+
import { jsx as jsx22, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2261
2270
|
function ReturnInfoPopover({ orderReturn }) {
|
|
2262
|
-
const { t } =
|
|
2271
|
+
const { t } = useTranslation21();
|
|
2263
2272
|
const { getFullDate } = useDate();
|
|
2264
2273
|
const [open, setOpen] = useState4(false);
|
|
2265
2274
|
if (typeof orderReturn !== "object") {
|
|
@@ -2275,8 +2284,8 @@ function ReturnInfoPopover({ orderReturn }) {
|
|
|
2275
2284
|
returnType = "Exchange";
|
|
2276
2285
|
returnTypeId = orderReturn.exchange_id;
|
|
2277
2286
|
}
|
|
2278
|
-
return /* @__PURE__ */
|
|
2279
|
-
/* @__PURE__ */
|
|
2287
|
+
return /* @__PURE__ */ jsxs23(Popover3, { open, children: [
|
|
2288
|
+
/* @__PURE__ */ jsx22(
|
|
2280
2289
|
Popover3.Trigger,
|
|
2281
2290
|
{
|
|
2282
2291
|
onMouseEnter: () => setOpen(true),
|
|
@@ -2284,31 +2293,31 @@ function ReturnInfoPopover({ orderReturn }) {
|
|
|
2284
2293
|
autoFocus: false,
|
|
2285
2294
|
className: "align-sub focus-visible:outline-none",
|
|
2286
2295
|
"data-testid": "order-summary-return-info-trigger",
|
|
2287
|
-
children: /* @__PURE__ */
|
|
2296
|
+
children: /* @__PURE__ */ jsx22(InformationCircleSolid, {})
|
|
2288
2297
|
}
|
|
2289
2298
|
),
|
|
2290
|
-
/* @__PURE__ */
|
|
2299
|
+
/* @__PURE__ */ jsx22(
|
|
2291
2300
|
Popover3.Content,
|
|
2292
2301
|
{
|
|
2293
2302
|
align: "center",
|
|
2294
2303
|
side: "top",
|
|
2295
2304
|
className: "bg-ui-bg-component p-2 focus-visible:outline-none",
|
|
2296
|
-
children: /* @__PURE__ */
|
|
2297
|
-
/* @__PURE__ */
|
|
2305
|
+
children: /* @__PURE__ */ jsxs23("div", { children: [
|
|
2306
|
+
/* @__PURE__ */ jsxs23(Badge2, { size: "2xsmall", className: "mb-2", rounded: "full", children: [
|
|
2298
2307
|
returnType,
|
|
2299
2308
|
": #",
|
|
2300
2309
|
returnTypeId.slice(-7)
|
|
2301
2310
|
] }),
|
|
2302
|
-
/* @__PURE__ */
|
|
2303
|
-
/* @__PURE__ */
|
|
2311
|
+
/* @__PURE__ */ jsxs23(Text20, { size: "xsmall", children: [
|
|
2312
|
+
/* @__PURE__ */ jsx22("span", { className: "text-ui-fg-subtle", children: t("orders.returns.returnRequested") }),
|
|
2304
2313
|
" \xB7 ",
|
|
2305
2314
|
getFullDate({
|
|
2306
2315
|
date: orderReturn.requested_at,
|
|
2307
2316
|
includeTime: true
|
|
2308
2317
|
})
|
|
2309
2318
|
] }),
|
|
2310
|
-
/* @__PURE__ */
|
|
2311
|
-
/* @__PURE__ */
|
|
2319
|
+
/* @__PURE__ */ jsxs23(Text20, { size: "xsmall", children: [
|
|
2320
|
+
/* @__PURE__ */ jsx22("span", { className: "text-ui-fg-subtle", children: t("orders.returns.itemReceived") }),
|
|
2312
2321
|
" \xB7 ",
|
|
2313
2322
|
orderReturn.received_at ? getFullDate({
|
|
2314
2323
|
date: orderReturn.received_at,
|
|
@@ -2325,10 +2334,10 @@ var return_info_popover_default = ReturnInfoPopover;
|
|
|
2325
2334
|
// src/pages/orders/[id]/_components/order-summary-section/shipping-info-popover.tsx
|
|
2326
2335
|
import { InformationCircleSolid as InformationCircleSolid2 } from "@medusajs/icons";
|
|
2327
2336
|
import { Badge as Badge3, Tooltip as Tooltip4 } from "@medusajs/ui";
|
|
2328
|
-
import { useTranslation as
|
|
2329
|
-
import { jsx as
|
|
2337
|
+
import { useTranslation as useTranslation22 } from "react-i18next";
|
|
2338
|
+
import { jsx as jsx23, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2330
2339
|
function ShippingInfoPopover({ shippingMethod }) {
|
|
2331
|
-
const { t } =
|
|
2340
|
+
const { t } = useTranslation22();
|
|
2332
2341
|
const shippingDetail = shippingMethod?.detail;
|
|
2333
2342
|
if (!shippingDetail) {
|
|
2334
2343
|
return;
|
|
@@ -2346,26 +2355,26 @@ function ShippingInfoPopover({ shippingMethod }) {
|
|
|
2346
2355
|
if (!rmaId) {
|
|
2347
2356
|
return;
|
|
2348
2357
|
}
|
|
2349
|
-
return /* @__PURE__ */
|
|
2358
|
+
return /* @__PURE__ */ jsx23(
|
|
2350
2359
|
Tooltip4,
|
|
2351
2360
|
{
|
|
2352
|
-
content: /* @__PURE__ */
|
|
2361
|
+
content: /* @__PURE__ */ jsxs24(Badge3, { size: "2xsmall", rounded: "full", children: [
|
|
2353
2362
|
rmaType,
|
|
2354
2363
|
": #",
|
|
2355
2364
|
rmaId.slice(-7)
|
|
2356
2365
|
] }),
|
|
2357
|
-
children: /* @__PURE__ */
|
|
2366
|
+
children: /* @__PURE__ */ jsx23(InformationCircleSolid2, { className: "inline-block text-ui-fg-muted ml-1" })
|
|
2358
2367
|
}
|
|
2359
2368
|
);
|
|
2360
2369
|
}
|
|
2361
2370
|
var shipping_info_popover_default = ShippingInfoPopover;
|
|
2362
2371
|
|
|
2363
2372
|
// src/pages/orders/[id]/_components/order-summary-section/order-summary-section.tsx
|
|
2364
|
-
import { Fragment as Fragment3, jsx as
|
|
2373
|
+
import { Fragment as Fragment3, jsx as jsx24, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2365
2374
|
var OrderSummarySection = ({
|
|
2366
2375
|
order
|
|
2367
2376
|
}) => {
|
|
2368
|
-
const { t } =
|
|
2377
|
+
const { t } = useTranslation23();
|
|
2369
2378
|
const { reservations } = useReservationItems(
|
|
2370
2379
|
{
|
|
2371
2380
|
line_item_id: order?.items?.map((i) => i.id),
|
|
@@ -2374,7 +2383,7 @@ var OrderSummarySection = ({
|
|
|
2374
2383
|
{ enabled: Array.isArray(order?.items) }
|
|
2375
2384
|
);
|
|
2376
2385
|
const { order: orderPreview } = useOrderPreview(order.id);
|
|
2377
|
-
const reservationList =
|
|
2386
|
+
const reservationList = useMemo4(
|
|
2378
2387
|
() => reservations ?? [],
|
|
2379
2388
|
[reservations]
|
|
2380
2389
|
);
|
|
@@ -2383,12 +2392,12 @@ var OrderSummarySection = ({
|
|
|
2383
2392
|
order_id: order.id,
|
|
2384
2393
|
fields: "+received_at"
|
|
2385
2394
|
});
|
|
2386
|
-
const receivableReturns =
|
|
2395
|
+
const receivableReturns = useMemo4(
|
|
2387
2396
|
() => receivableReturnsList.filter((r) => !r.canceled_at),
|
|
2388
2397
|
[receivableReturnsList]
|
|
2389
2398
|
);
|
|
2390
2399
|
const showReturns = !!receivableReturns.length;
|
|
2391
|
-
const showAllocateButton =
|
|
2400
|
+
const showAllocateButton = useMemo4(() => {
|
|
2392
2401
|
if (!reservations) {
|
|
2393
2402
|
return false;
|
|
2394
2403
|
}
|
|
@@ -2416,19 +2425,19 @@ var OrderSummarySection = ({
|
|
|
2416
2425
|
order.currency_code
|
|
2417
2426
|
);
|
|
2418
2427
|
const showRefund = unpaidPaymentCollection && pendingDifference < 0 && isAmountSignificant;
|
|
2419
|
-
return /* @__PURE__ */
|
|
2420
|
-
/* @__PURE__ */
|
|
2421
|
-
/* @__PURE__ */
|
|
2422
|
-
/* @__PURE__ */
|
|
2423
|
-
/* @__PURE__ */
|
|
2424
|
-
(showReturns || showRefund || showAllocateButton) && /* @__PURE__ */
|
|
2425
|
-
showReturns && (receivableReturns.length === 1 ? /* @__PURE__ */
|
|
2428
|
+
return /* @__PURE__ */ jsxs25(Container10, { className: "divide-y p-0", children: [
|
|
2429
|
+
/* @__PURE__ */ jsx24(Header3, { order, orderPreview }),
|
|
2430
|
+
/* @__PURE__ */ jsx24(ItemBreakdown, { order, reservations: reservationList }),
|
|
2431
|
+
/* @__PURE__ */ jsx24(CostBreakdown, { order }),
|
|
2432
|
+
/* @__PURE__ */ jsx24(Total2, { order }),
|
|
2433
|
+
(showReturns || showRefund || showAllocateButton) && /* @__PURE__ */ jsxs25("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
2434
|
+
showReturns && (receivableReturns.length === 1 ? /* @__PURE__ */ jsx24(Button7, { asChild: true, variant: "secondary", size: "small", children: /* @__PURE__ */ jsx24(
|
|
2426
2435
|
Link4,
|
|
2427
2436
|
{
|
|
2428
2437
|
to: `/orders/${order.id}/returns/${receivableReturns[0].id}/receive`,
|
|
2429
2438
|
children: t("orders.returns.receive.action")
|
|
2430
2439
|
}
|
|
2431
|
-
) }) : /* @__PURE__ */
|
|
2440
|
+
) }) : /* @__PURE__ */ jsx24(
|
|
2432
2441
|
ActionMenu,
|
|
2433
2442
|
{
|
|
2434
2443
|
groups: [
|
|
@@ -2449,40 +2458,41 @@ var OrderSummarySection = ({
|
|
|
2449
2458
|
id: `#${id?.slice(-7)}`,
|
|
2450
2459
|
returnType
|
|
2451
2460
|
}),
|
|
2452
|
-
icon: /* @__PURE__ */
|
|
2461
|
+
icon: /* @__PURE__ */ jsx24(ArrowLongRight, {}),
|
|
2453
2462
|
to: `/orders/${order.id}/returns/${r.id}/receive`
|
|
2454
2463
|
};
|
|
2455
2464
|
})
|
|
2456
2465
|
}
|
|
2457
2466
|
],
|
|
2458
|
-
children: /* @__PURE__ */
|
|
2467
|
+
children: /* @__PURE__ */ jsx24(Button7, { variant: "secondary", size: "small", children: t("orders.returns.receive.action") })
|
|
2459
2468
|
}
|
|
2460
2469
|
)),
|
|
2461
|
-
showAllocateButton && /* @__PURE__ */
|
|
2470
|
+
showAllocateButton && /* @__PURE__ */ jsx24(
|
|
2462
2471
|
Button7,
|
|
2463
2472
|
{
|
|
2464
2473
|
asChild: true,
|
|
2465
2474
|
variant: "secondary",
|
|
2466
2475
|
size: "small",
|
|
2467
2476
|
"data-testid": "order-summary-allocate-items-cta",
|
|
2468
|
-
children: /* @__PURE__ */
|
|
2477
|
+
children: /* @__PURE__ */ jsx24(Link4, { to: "allocate-items", children: t("orders.allocateItems.action") })
|
|
2469
2478
|
}
|
|
2470
2479
|
),
|
|
2471
|
-
showRefund && /* @__PURE__ */
|
|
2480
|
+
showRefund && /* @__PURE__ */ jsx24(Button7, { size: "small", variant: "secondary", asChild: true, children: /* @__PURE__ */ jsx24(Link4, { to: `/orders/${order.id}/refund`, children: t("orders.payment.refundAmount", {
|
|
2472
2481
|
amount: getStylizedAmount(
|
|
2473
2482
|
pendingDifference * -1,
|
|
2474
2483
|
order?.currency_code
|
|
2475
2484
|
)
|
|
2476
2485
|
}) }) })
|
|
2477
2486
|
] }),
|
|
2478
|
-
/* @__PURE__ */
|
|
2487
|
+
/* @__PURE__ */ jsx24(WidgetZone, { id: "orders.detail.summary", data: order }),
|
|
2488
|
+
/* @__PURE__ */ jsx24(DisplayExtensionZone10, { model: "order", zone: "summary", data: order })
|
|
2479
2489
|
] });
|
|
2480
2490
|
};
|
|
2481
2491
|
var Header3 = ({
|
|
2482
2492
|
order,
|
|
2483
2493
|
orderPreview
|
|
2484
2494
|
}) => {
|
|
2485
|
-
const { t } =
|
|
2495
|
+
const { t } = useTranslation23();
|
|
2486
2496
|
const isCanceled = !!order.canceled_at;
|
|
2487
2497
|
const returnOutOfPolicy = isOutsidePolicyWindow(order, RETURN_POLICY_DAYS);
|
|
2488
2498
|
const exchangeOutOfPolicy = isOutsidePolicyWindow(
|
|
@@ -2500,9 +2510,9 @@ var Header3 = ({
|
|
|
2500
2510
|
const returnDisabledByChange = isOrderEditActive || !!orderChange?.exchange_id || !!orderChange?.claim_id;
|
|
2501
2511
|
const exchangeDisabledByChange = isOrderEditActive || !!orderChange?.return_id && !orderChange?.exchange_id || !!orderChange?.claim_id;
|
|
2502
2512
|
const claimDisabledByChange = isOrderEditActive || !!orderChange?.return_id && !orderChange?.claim_id || !!orderChange?.exchange_id;
|
|
2503
|
-
return /* @__PURE__ */
|
|
2504
|
-
/* @__PURE__ */
|
|
2505
|
-
/* @__PURE__ */
|
|
2513
|
+
return /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
2514
|
+
/* @__PURE__ */ jsx24(Heading10, { level: "h2", children: t("fields.summary") }),
|
|
2515
|
+
/* @__PURE__ */ jsx24(
|
|
2506
2516
|
ActionMenu,
|
|
2507
2517
|
{
|
|
2508
2518
|
groups: [
|
|
@@ -2514,7 +2524,7 @@ var Header3 = ({
|
|
|
2514
2524
|
),
|
|
2515
2525
|
to: "edit",
|
|
2516
2526
|
disabled: editDisabled,
|
|
2517
|
-
icon: /* @__PURE__ */
|
|
2527
|
+
icon: /* @__PURE__ */ jsx24(PencilSquare, {})
|
|
2518
2528
|
}
|
|
2519
2529
|
]
|
|
2520
2530
|
},
|
|
@@ -2527,7 +2537,7 @@ var Header3 = ({
|
|
|
2527
2537
|
disabledTooltip: returnOutOfPolicy ? t("orders.returns.outOfPolicy", {
|
|
2528
2538
|
days: RETURN_POLICY_DAYS
|
|
2529
2539
|
}) : void 0,
|
|
2530
|
-
icon: /* @__PURE__ */
|
|
2540
|
+
icon: /* @__PURE__ */ jsx24(ArrowUturnLeft2, {})
|
|
2531
2541
|
},
|
|
2532
2542
|
{
|
|
2533
2543
|
label: orderChange?.id && orderChange?.exchange_id ? t("orders.exchanges.manage") : t("orders.exchanges.create"),
|
|
@@ -2536,7 +2546,7 @@ var Header3 = ({
|
|
|
2536
2546
|
disabledTooltip: exchangeOutOfPolicy ? t("orders.exchanges.outOfPolicy", {
|
|
2537
2547
|
days: EXCHANGE_POLICY_DAYS
|
|
2538
2548
|
}) : void 0,
|
|
2539
|
-
icon: /* @__PURE__ */
|
|
2549
|
+
icon: /* @__PURE__ */ jsx24(ArrowPath2, {})
|
|
2540
2550
|
},
|
|
2541
2551
|
{
|
|
2542
2552
|
label: orderChange?.id && orderChange?.claim_id ? t("orders.claims.manage") : t("orders.claims.create"),
|
|
@@ -2545,7 +2555,7 @@ var Header3 = ({
|
|
|
2545
2555
|
disabledTooltip: claimOutOfPolicy ? t("orders.claims.outOfPolicy", {
|
|
2546
2556
|
days: CLAIM_POLICY_DAYS
|
|
2547
2557
|
}) : void 0,
|
|
2548
|
-
icon: /* @__PURE__ */
|
|
2558
|
+
icon: /* @__PURE__ */ jsx24(ExclamationCircle2, {})
|
|
2549
2559
|
}
|
|
2550
2560
|
]
|
|
2551
2561
|
}
|
|
@@ -2560,7 +2570,7 @@ var Item = ({
|
|
|
2560
2570
|
returns,
|
|
2561
2571
|
reservation
|
|
2562
2572
|
}) => {
|
|
2563
|
-
const { t } =
|
|
2573
|
+
const { t } = useTranslation23();
|
|
2564
2574
|
const original_price = item.variant?.prices?.find((price2) => price2.currency_code === currencyCode)?.amount || 0;
|
|
2565
2575
|
const price = item.unit_price;
|
|
2566
2576
|
const offerInventoryLinks = item.offer?.inventory_item_link ?? [];
|
|
@@ -2568,17 +2578,17 @@ var Item = ({
|
|
|
2568
2578
|
const hasUnfulfilledItems = item.quantity - (item.detail?.fulfilled_quantity ?? 0) > 0;
|
|
2569
2579
|
const offerSku = item.offer?.sku ?? null;
|
|
2570
2580
|
const captionSku = offerSku ?? item.variant_sku ?? null;
|
|
2571
|
-
return /* @__PURE__ */
|
|
2572
|
-
/* @__PURE__ */
|
|
2581
|
+
return /* @__PURE__ */ jsxs25(Fragment3, { children: [
|
|
2582
|
+
/* @__PURE__ */ jsxs25(
|
|
2573
2583
|
"div",
|
|
2574
2584
|
{
|
|
2575
2585
|
className: "text-ui-fg-subtle grid grid-cols-2 items-center gap-x-4 px-6 py-4",
|
|
2576
2586
|
children: [
|
|
2577
|
-
/* @__PURE__ */
|
|
2578
|
-
/* @__PURE__ */
|
|
2579
|
-
/* @__PURE__ */
|
|
2580
|
-
/* @__PURE__ */
|
|
2581
|
-
|
|
2587
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-start gap-x-4", children: [
|
|
2588
|
+
/* @__PURE__ */ jsx24(Thumbnail, { src: item.thumbnail }),
|
|
2589
|
+
/* @__PURE__ */ jsxs25("div", { children: [
|
|
2590
|
+
/* @__PURE__ */ jsx24(
|
|
2591
|
+
Text21,
|
|
2582
2592
|
{
|
|
2583
2593
|
size: "small",
|
|
2584
2594
|
leading: "compact",
|
|
@@ -2587,24 +2597,24 @@ var Item = ({
|
|
|
2587
2597
|
children: item.title || item.product_title
|
|
2588
2598
|
}
|
|
2589
2599
|
),
|
|
2590
|
-
captionSku && /* @__PURE__ */
|
|
2591
|
-
/* @__PURE__ */
|
|
2592
|
-
/* @__PURE__ */
|
|
2600
|
+
captionSku && /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-x-1", children: [
|
|
2601
|
+
/* @__PURE__ */ jsx24(Text21, { size: "small", children: captionSku }),
|
|
2602
|
+
/* @__PURE__ */ jsx24(Copy5, { content: captionSku, className: "text-ui-fg-muted" })
|
|
2593
2603
|
] }),
|
|
2594
|
-
/* @__PURE__ */
|
|
2604
|
+
/* @__PURE__ */ jsx24(Text21, { size: "small", children: item.variant?.options?.map((o) => o.value).join(" \xB7 ") })
|
|
2595
2605
|
] })
|
|
2596
2606
|
] }),
|
|
2597
|
-
/* @__PURE__ */
|
|
2598
|
-
/* @__PURE__ */
|
|
2599
|
-
original_price !== price && /* @__PURE__ */
|
|
2607
|
+
/* @__PURE__ */ jsxs25("div", { className: "grid grid-cols-3 items-center gap-x-4", children: [
|
|
2608
|
+
/* @__PURE__ */ jsx24("div", { className: "flex items-center justify-end gap-x-4", children: /* @__PURE__ */ jsxs25(Text21, { size: "small", children: [
|
|
2609
|
+
original_price !== price && /* @__PURE__ */ jsx24("span", { className: "line-through text-ui-fg-muted text-xs mr-1", children: getLocaleAmount(original_price, currencyCode) }),
|
|
2600
2610
|
getLocaleAmount(price, currencyCode)
|
|
2601
2611
|
] }) }),
|
|
2602
|
-
/* @__PURE__ */
|
|
2603
|
-
/* @__PURE__ */
|
|
2604
|
-
/* @__PURE__ */
|
|
2612
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-x-2", children: [
|
|
2613
|
+
/* @__PURE__ */ jsx24("div", { className: "w-fit min-w-[27px]", children: /* @__PURE__ */ jsxs25(Text21, { size: "small", children: [
|
|
2614
|
+
/* @__PURE__ */ jsx24("span", { className: "tabular-nums", children: item.quantity }),
|
|
2605
2615
|
"x"
|
|
2606
2616
|
] }) }),
|
|
2607
|
-
/* @__PURE__ */
|
|
2617
|
+
/* @__PURE__ */ jsx24("div", { className: "overflow-visible", children: isInventoryManaged && hasUnfulfilledItems && /* @__PURE__ */ jsx24(
|
|
2608
2618
|
StatusBadge4,
|
|
2609
2619
|
{
|
|
2610
2620
|
color: reservation ? "green" : "orange",
|
|
@@ -2613,13 +2623,13 @@ var Item = ({
|
|
|
2613
2623
|
}
|
|
2614
2624
|
) })
|
|
2615
2625
|
] }),
|
|
2616
|
-
/* @__PURE__ */
|
|
2626
|
+
/* @__PURE__ */ jsx24("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx24(Text21, { size: "small", className: "pt-[1px]", children: getLocaleAmount(item.original_total || 0, currencyCode) }) })
|
|
2617
2627
|
] })
|
|
2618
2628
|
]
|
|
2619
2629
|
},
|
|
2620
2630
|
item.id
|
|
2621
2631
|
),
|
|
2622
|
-
returns.map((r) => /* @__PURE__ */
|
|
2632
|
+
returns.map((r) => /* @__PURE__ */ jsx24(ReturnBreakdown, { orderReturn: r, itemId: item.id }, r.id))
|
|
2623
2633
|
] });
|
|
2624
2634
|
};
|
|
2625
2635
|
var ItemBreakdown = ({
|
|
@@ -2630,16 +2640,16 @@ var ItemBreakdown = ({
|
|
|
2630
2640
|
order_id: order.id,
|
|
2631
2641
|
fields: "*items,*items.reason"
|
|
2632
2642
|
});
|
|
2633
|
-
const returns =
|
|
2643
|
+
const returns = useMemo4(
|
|
2634
2644
|
() => returnsList.filter((r) => !r.canceled_at),
|
|
2635
2645
|
[returnsList]
|
|
2636
2646
|
);
|
|
2637
|
-
const reservationsMap =
|
|
2647
|
+
const reservationsMap = useMemo4(
|
|
2638
2648
|
() => new Map(reservations.map((r) => [r.line_item_id, r])),
|
|
2639
2649
|
[reservations]
|
|
2640
2650
|
);
|
|
2641
|
-
return /* @__PURE__ */
|
|
2642
|
-
return /* @__PURE__ */
|
|
2651
|
+
return /* @__PURE__ */ jsx24("div", { children: order.items?.map((item) => {
|
|
2652
|
+
return /* @__PURE__ */ jsx24(
|
|
2643
2653
|
Item,
|
|
2644
2654
|
{
|
|
2645
2655
|
item,
|
|
@@ -2655,24 +2665,24 @@ var ReturnBreakdownWithDamages = ({
|
|
|
2655
2665
|
orderReturn,
|
|
2656
2666
|
itemId
|
|
2657
2667
|
}) => {
|
|
2658
|
-
const { t } =
|
|
2668
|
+
const { t } = useTranslation23();
|
|
2659
2669
|
const item = orderReturn.items?.find((ri) => ri.item_id === itemId);
|
|
2660
2670
|
const damagedQuantity = item?.damaged_quantity || 0;
|
|
2661
2671
|
if (!item || damagedQuantity <= 0) {
|
|
2662
2672
|
return null;
|
|
2663
2673
|
}
|
|
2664
|
-
return /* @__PURE__ */
|
|
2674
|
+
return /* @__PURE__ */ jsxs25(
|
|
2665
2675
|
"div",
|
|
2666
2676
|
{
|
|
2667
2677
|
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",
|
|
2668
2678
|
children: [
|
|
2669
|
-
/* @__PURE__ */
|
|
2670
|
-
/* @__PURE__ */
|
|
2671
|
-
/* @__PURE__ */
|
|
2679
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
|
|
2680
|
+
/* @__PURE__ */ jsx24(ArrowDownRightMini2, { className: "text-ui-fg-muted" }),
|
|
2681
|
+
/* @__PURE__ */ jsx24(Text21, { size: "small", children: t("orders.returns.damagedItemsReturned", {
|
|
2672
2682
|
quantity: damagedQuantity
|
|
2673
2683
|
}) }),
|
|
2674
|
-
item.note && /* @__PURE__ */
|
|
2675
|
-
item.reason && /* @__PURE__ */
|
|
2684
|
+
item.note && /* @__PURE__ */ jsx24(Tooltip5, { content: item.note, children: /* @__PURE__ */ jsx24(DocumentText2, { className: "text-ui-tag-neutral-icon ml-1 inline" }) }),
|
|
2685
|
+
item.reason && /* @__PURE__ */ jsx24(
|
|
2676
2686
|
Badge4,
|
|
2677
2687
|
{
|
|
2678
2688
|
size: "2xsmall",
|
|
@@ -2682,9 +2692,9 @@ var ReturnBreakdownWithDamages = ({
|
|
|
2682
2692
|
}
|
|
2683
2693
|
)
|
|
2684
2694
|
] }),
|
|
2685
|
-
/* @__PURE__ */
|
|
2695
|
+
/* @__PURE__ */ jsxs25(Text21, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: [
|
|
2686
2696
|
t("orders.returns.damagedItemReceived"),
|
|
2687
|
-
/* @__PURE__ */
|
|
2697
|
+
/* @__PURE__ */ jsx24("span", { className: "ml-2", children: /* @__PURE__ */ jsx24(return_info_popover_default, { orderReturn }) })
|
|
2688
2698
|
] })
|
|
2689
2699
|
]
|
|
2690
2700
|
},
|
|
@@ -2695,7 +2705,7 @@ var ReturnBreakdown = ({
|
|
|
2695
2705
|
orderReturn,
|
|
2696
2706
|
itemId
|
|
2697
2707
|
}) => {
|
|
2698
|
-
const { t } =
|
|
2708
|
+
const { t } = useTranslation23();
|
|
2699
2709
|
const { getRelativeDate } = useDate();
|
|
2700
2710
|
if (!["requested", "received", "partially_received"].includes(
|
|
2701
2711
|
orderReturn.status || ""
|
|
@@ -2708,29 +2718,29 @@ var ReturnBreakdown = ({
|
|
|
2708
2718
|
return null;
|
|
2709
2719
|
}
|
|
2710
2720
|
const damagedQuantity = item.damaged_quantity || 0;
|
|
2711
|
-
return /* @__PURE__ */
|
|
2712
|
-
damagedQuantity > 0 && /* @__PURE__ */
|
|
2721
|
+
return /* @__PURE__ */ jsxs25(Fragment3, { children: [
|
|
2722
|
+
damagedQuantity > 0 && /* @__PURE__ */ jsx24(
|
|
2713
2723
|
ReturnBreakdownWithDamages,
|
|
2714
2724
|
{
|
|
2715
2725
|
orderReturn,
|
|
2716
2726
|
itemId
|
|
2717
2727
|
}
|
|
2718
2728
|
),
|
|
2719
|
-
/* @__PURE__ */
|
|
2729
|
+
/* @__PURE__ */ jsxs25(
|
|
2720
2730
|
"div",
|
|
2721
2731
|
{
|
|
2722
2732
|
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",
|
|
2723
2733
|
children: [
|
|
2724
|
-
/* @__PURE__ */
|
|
2725
|
-
/* @__PURE__ */
|
|
2726
|
-
/* @__PURE__ */
|
|
2734
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
|
|
2735
|
+
/* @__PURE__ */ jsx24(ArrowDownRightMini2, { className: "text-ui-fg-muted" }),
|
|
2736
|
+
/* @__PURE__ */ jsx24(Text21, { size: "small", children: t(
|
|
2727
2737
|
`orders.returns.${isRequested ? "returnRequestedInfo" : "returnReceivedInfo"}`,
|
|
2728
2738
|
{
|
|
2729
2739
|
requestedItemsCount: isRequested ? item.quantity : item.received_quantity
|
|
2730
2740
|
}
|
|
2731
2741
|
) }),
|
|
2732
|
-
item.note && /* @__PURE__ */
|
|
2733
|
-
item.reason && /* @__PURE__ */
|
|
2742
|
+
item.note && /* @__PURE__ */ jsx24(Tooltip5, { content: item.note, children: /* @__PURE__ */ jsx24(DocumentText2, { className: "text-ui-tag-neutral-icon ml-1 inline" }) }),
|
|
2743
|
+
item.reason && /* @__PURE__ */ jsx24(
|
|
2734
2744
|
Badge4,
|
|
2735
2745
|
{
|
|
2736
2746
|
size: "2xsmall",
|
|
@@ -2740,12 +2750,12 @@ var ReturnBreakdown = ({
|
|
|
2740
2750
|
}
|
|
2741
2751
|
)
|
|
2742
2752
|
] }),
|
|
2743
|
-
isRequested ? /* @__PURE__ */
|
|
2753
|
+
isRequested ? /* @__PURE__ */ jsxs25(Text21, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: [
|
|
2744
2754
|
getRelativeDate(orderReturn.created_at),
|
|
2745
|
-
/* @__PURE__ */
|
|
2746
|
-
] }) : /* @__PURE__ */
|
|
2755
|
+
/* @__PURE__ */ jsx24("span", { className: "ml-2", children: /* @__PURE__ */ jsx24(return_info_popover_default, { orderReturn }) })
|
|
2756
|
+
] }) : /* @__PURE__ */ jsxs25(Text21, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: [
|
|
2747
2757
|
t("orders.returns.itemReceived"),
|
|
2748
|
-
/* @__PURE__ */
|
|
2758
|
+
/* @__PURE__ */ jsx24("span", { className: "ml-2", children: /* @__PURE__ */ jsx24(return_info_popover_default, { orderReturn }) })
|
|
2749
2759
|
] })
|
|
2750
2760
|
]
|
|
2751
2761
|
},
|
|
@@ -2758,22 +2768,36 @@ var Cost = ({
|
|
|
2758
2768
|
value,
|
|
2759
2769
|
secondaryValue,
|
|
2760
2770
|
tooltip
|
|
2761
|
-
}) => /* @__PURE__ */
|
|
2762
|
-
/* @__PURE__ */
|
|
2771
|
+
}) => /* @__PURE__ */ jsxs25("div", { className: "grid grid-cols-3 items-center", children: [
|
|
2772
|
+
/* @__PURE__ */ jsxs25(Text21, { size: "small", leading: "compact", children: [
|
|
2763
2773
|
label,
|
|
2764
2774
|
" ",
|
|
2765
2775
|
tooltip
|
|
2766
2776
|
] }),
|
|
2767
|
-
/* @__PURE__ */
|
|
2768
|
-
/* @__PURE__ */
|
|
2777
|
+
/* @__PURE__ */ jsx24("div", { className: "text-right", children: /* @__PURE__ */ jsx24(Text21, { size: "small", leading: "compact", children: secondaryValue }) }),
|
|
2778
|
+
/* @__PURE__ */ jsx24("div", { className: "text-right", children: /* @__PURE__ */ jsx24(Text21, { size: "small", leading: "compact", children: value }) })
|
|
2769
2779
|
] });
|
|
2770
2780
|
var CostBreakdown = ({
|
|
2771
2781
|
order
|
|
2772
2782
|
}) => {
|
|
2773
|
-
const { t } =
|
|
2783
|
+
const { t } = useTranslation23();
|
|
2774
2784
|
const [isTaxOpen, setIsTaxOpen] = useState5(false);
|
|
2775
2785
|
const [isShippingOpen, setIsShippingOpen] = useState5(false);
|
|
2776
|
-
const
|
|
2786
|
+
const [isCommissionOpen, setIsCommissionOpen] = useState5(false);
|
|
2787
|
+
const { commission_lines } = useOrderCommissionLines(order.id);
|
|
2788
|
+
const hasCommission = commission_lines.length > 0;
|
|
2789
|
+
const commissionTotal = commission_lines.reduce(
|
|
2790
|
+
(acc, line) => acc + (line.amount ?? 0),
|
|
2791
|
+
0
|
|
2792
|
+
);
|
|
2793
|
+
const commissionItemTitleById = useMemo4(() => {
|
|
2794
|
+
const map = /* @__PURE__ */ new Map();
|
|
2795
|
+
order.items?.forEach((item) => {
|
|
2796
|
+
map.set(item.id, item.product_title ?? item.title);
|
|
2797
|
+
});
|
|
2798
|
+
return map;
|
|
2799
|
+
}, [order.items]);
|
|
2800
|
+
const discountCodes = useMemo4(() => {
|
|
2777
2801
|
const codes = /* @__PURE__ */ new Set();
|
|
2778
2802
|
order.items.forEach(
|
|
2779
2803
|
(item) => item.adjustments?.forEach((adj) => {
|
|
@@ -2782,7 +2806,7 @@ var CostBreakdown = ({
|
|
|
2782
2806
|
);
|
|
2783
2807
|
return Array.from(codes).sort();
|
|
2784
2808
|
}, [order]);
|
|
2785
|
-
const taxCodes =
|
|
2809
|
+
const taxCodes = useMemo4(() => {
|
|
2786
2810
|
const taxCodeMap = {};
|
|
2787
2811
|
order.items.forEach((item) => {
|
|
2788
2812
|
item.tax_lines?.forEach((line) => {
|
|
@@ -2799,8 +2823,8 @@ var CostBreakdown = ({
|
|
|
2799
2823
|
const automaticTaxesOn = !!order.region?.automatic_taxes;
|
|
2800
2824
|
const hasTaxLines = !!Object.keys(taxCodes).length;
|
|
2801
2825
|
const discountTotal = automaticTaxesOn ? order.discount_total : order.discount_subtotal;
|
|
2802
|
-
return /* @__PURE__ */
|
|
2803
|
-
/* @__PURE__ */
|
|
2826
|
+
return /* @__PURE__ */ jsxs25("div", { className: "text-ui-fg-subtle flex flex-col gap-y-2 px-6 py-4", children: [
|
|
2827
|
+
/* @__PURE__ */ jsx24(
|
|
2804
2828
|
Cost,
|
|
2805
2829
|
{
|
|
2806
2830
|
label: t(
|
|
@@ -2809,21 +2833,21 @@ var CostBreakdown = ({
|
|
|
2809
2833
|
value: getLocaleAmount(order.item_total, order.currency_code)
|
|
2810
2834
|
}
|
|
2811
2835
|
),
|
|
2812
|
-
/* @__PURE__ */
|
|
2836
|
+
/* @__PURE__ */ jsx24(
|
|
2813
2837
|
Cost,
|
|
2814
2838
|
{
|
|
2815
2839
|
label: (
|
|
2816
2840
|
// oxlint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions
|
|
2817
|
-
/* @__PURE__ */
|
|
2841
|
+
/* @__PURE__ */ jsxs25(
|
|
2818
2842
|
"span",
|
|
2819
2843
|
{
|
|
2820
2844
|
onClick: () => setIsShippingOpen((o) => !o),
|
|
2821
2845
|
className: "flex cursor-pointer items-center gap-1",
|
|
2822
2846
|
children: [
|
|
2823
|
-
/* @__PURE__ */
|
|
2847
|
+
/* @__PURE__ */ jsx24("span", { children: t(
|
|
2824
2848
|
automaticTaxesOn ? "orders.summary.shippingTotal" : "orders.summary.shippingSubtotal"
|
|
2825
2849
|
) }),
|
|
2826
|
-
/* @__PURE__ */
|
|
2850
|
+
/* @__PURE__ */ jsx24(
|
|
2827
2851
|
TriangleDownMini,
|
|
2828
2852
|
{
|
|
2829
2853
|
style: {
|
|
@@ -2841,22 +2865,22 @@ var CostBreakdown = ({
|
|
|
2841
2865
|
)
|
|
2842
2866
|
}
|
|
2843
2867
|
),
|
|
2844
|
-
isShippingOpen && /* @__PURE__ */
|
|
2868
|
+
isShippingOpen && /* @__PURE__ */ jsx24("div", { className: "flex flex-col gap-1 pl-5", children: (order.shipping_methods || []).sort(
|
|
2845
2869
|
(m1, m2) => m1.created_at.localeCompare(m2.created_at)
|
|
2846
2870
|
).map((sm, i) => {
|
|
2847
|
-
return /* @__PURE__ */
|
|
2871
|
+
return /* @__PURE__ */ jsxs25(
|
|
2848
2872
|
"div",
|
|
2849
2873
|
{
|
|
2850
2874
|
className: "flex items-center justify-between gap-x-2",
|
|
2851
2875
|
children: [
|
|
2852
|
-
/* @__PURE__ */
|
|
2876
|
+
/* @__PURE__ */ jsx24("div", { children: /* @__PURE__ */ jsxs25("span", { className: "txt-small text-ui-fg-subtle font-medium", children: [
|
|
2853
2877
|
sm.name,
|
|
2854
2878
|
sm.detail?.return_id && ` (${t("fields.returnShipping")})`,
|
|
2855
2879
|
" ",
|
|
2856
|
-
/* @__PURE__ */
|
|
2880
|
+
/* @__PURE__ */ jsx24(shipping_info_popover_default, { shippingMethod: sm }, i)
|
|
2857
2881
|
] }) }),
|
|
2858
|
-
/* @__PURE__ */
|
|
2859
|
-
/* @__PURE__ */
|
|
2882
|
+
/* @__PURE__ */ jsx24("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx24("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
2883
|
+
/* @__PURE__ */ jsx24("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(
|
|
2860
2884
|
automaticTaxesOn ? sm.total : sm.subtotal,
|
|
2861
2885
|
order.currency_code
|
|
2862
2886
|
) })
|
|
@@ -2865,7 +2889,7 @@ var CostBreakdown = ({
|
|
|
2865
2889
|
sm.id
|
|
2866
2890
|
);
|
|
2867
2891
|
}) }),
|
|
2868
|
-
/* @__PURE__ */
|
|
2892
|
+
/* @__PURE__ */ jsx24(
|
|
2869
2893
|
Cost,
|
|
2870
2894
|
{
|
|
2871
2895
|
label: t(
|
|
@@ -2875,9 +2899,9 @@ var CostBreakdown = ({
|
|
|
2875
2899
|
value: discountTotal > 0 ? `- ${getLocaleAmount(discountTotal, order.currency_code)}` : "-"
|
|
2876
2900
|
}
|
|
2877
2901
|
),
|
|
2878
|
-
/* @__PURE__ */
|
|
2879
|
-
/* @__PURE__ */
|
|
2880
|
-
/* @__PURE__ */
|
|
2902
|
+
/* @__PURE__ */ jsxs25(Fragment3, { children: [
|
|
2903
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex justify-between", children: [
|
|
2904
|
+
/* @__PURE__ */ jsxs25(
|
|
2881
2905
|
"div",
|
|
2882
2906
|
{
|
|
2883
2907
|
onClick: () => hasTaxLines && setIsTaxOpen((o) => !o),
|
|
@@ -2885,10 +2909,10 @@ var CostBreakdown = ({
|
|
|
2885
2909
|
"cursor-pointer": hasTaxLines
|
|
2886
2910
|
}),
|
|
2887
2911
|
children: [
|
|
2888
|
-
/* @__PURE__ */
|
|
2912
|
+
/* @__PURE__ */ jsx24("span", { className: "txt-small select-none", children: t(
|
|
2889
2913
|
automaticTaxesOn ? "orders.summary.taxTotalIncl" : "orders.summary.taxTotal"
|
|
2890
2914
|
) }),
|
|
2891
|
-
hasTaxLines && /* @__PURE__ */
|
|
2915
|
+
hasTaxLines && /* @__PURE__ */ jsx24(
|
|
2892
2916
|
TriangleDownMini,
|
|
2893
2917
|
{
|
|
2894
2918
|
style: {
|
|
@@ -2899,33 +2923,71 @@ var CostBreakdown = ({
|
|
|
2899
2923
|
]
|
|
2900
2924
|
}
|
|
2901
2925
|
),
|
|
2902
|
-
/* @__PURE__ */
|
|
2926
|
+
/* @__PURE__ */ jsx24("div", { className: "text-right", children: /* @__PURE__ */ jsx24(Text21, { size: "small", leading: "compact", children: getLocaleAmount(order.tax_total, order.currency_code) }) })
|
|
2903
2927
|
] }),
|
|
2904
|
-
isTaxOpen && /* @__PURE__ */
|
|
2905
|
-
return /* @__PURE__ */
|
|
2928
|
+
isTaxOpen && /* @__PURE__ */ jsx24("div", { className: "flex flex-col gap-1 pl-5", children: Object.entries(taxCodes).map(([code, total]) => {
|
|
2929
|
+
return /* @__PURE__ */ jsxs25(
|
|
2906
2930
|
"div",
|
|
2907
2931
|
{
|
|
2908
2932
|
className: "flex items-center justify-between gap-x-2",
|
|
2909
2933
|
children: [
|
|
2910
|
-
/* @__PURE__ */
|
|
2911
|
-
/* @__PURE__ */
|
|
2912
|
-
/* @__PURE__ */
|
|
2934
|
+
/* @__PURE__ */ jsx24("div", { children: /* @__PURE__ */ jsx24("span", { className: "txt-small text-ui-fg-subtle font-medium", children: code }) }),
|
|
2935
|
+
/* @__PURE__ */ jsx24("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx24("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
2936
|
+
/* @__PURE__ */ jsx24("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(total, order.currency_code) })
|
|
2913
2937
|
]
|
|
2914
2938
|
},
|
|
2915
2939
|
code
|
|
2916
2940
|
);
|
|
2917
2941
|
}) })
|
|
2942
|
+
] }),
|
|
2943
|
+
hasCommission && /* @__PURE__ */ jsxs25(Fragment3, { children: [
|
|
2944
|
+
/* @__PURE__ */ jsxs25("div", { className: "flex justify-between", children: [
|
|
2945
|
+
/* @__PURE__ */ jsxs25(
|
|
2946
|
+
"div",
|
|
2947
|
+
{
|
|
2948
|
+
onClick: () => setIsCommissionOpen((o) => !o),
|
|
2949
|
+
className: "flex cursor-pointer items-center gap-1",
|
|
2950
|
+
children: [
|
|
2951
|
+
/* @__PURE__ */ jsx24("span", { className: "txt-small select-none", children: t("fields.commission") }),
|
|
2952
|
+
/* @__PURE__ */ jsx24(
|
|
2953
|
+
TriangleDownMini,
|
|
2954
|
+
{
|
|
2955
|
+
style: {
|
|
2956
|
+
transform: `rotate(${isCommissionOpen ? 0 : -90}deg)`
|
|
2957
|
+
}
|
|
2958
|
+
}
|
|
2959
|
+
)
|
|
2960
|
+
]
|
|
2961
|
+
}
|
|
2962
|
+
),
|
|
2963
|
+
/* @__PURE__ */ jsx24("div", { className: "text-right", children: /* @__PURE__ */ jsx24(Text21, { size: "small", leading: "compact", children: getLocaleAmount(commissionTotal, order.currency_code) }) })
|
|
2964
|
+
] }),
|
|
2965
|
+
isCommissionOpen && /* @__PURE__ */ jsx24("div", { className: "flex flex-col gap-1 pl-5", children: commission_lines.map((line) => {
|
|
2966
|
+
const label = line.shipping_method_id ? t("fields.shipping") : commissionItemTitleById.get(line.item_id ?? "") ?? line.code;
|
|
2967
|
+
return /* @__PURE__ */ jsxs25(
|
|
2968
|
+
"div",
|
|
2969
|
+
{
|
|
2970
|
+
className: "flex items-center justify-between gap-x-2",
|
|
2971
|
+
children: [
|
|
2972
|
+
/* @__PURE__ */ jsx24("div", { children: /* @__PURE__ */ jsx24("span", { className: "txt-small text-ui-fg-subtle font-medium", children: label }) }),
|
|
2973
|
+
/* @__PURE__ */ jsx24("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx24("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
2974
|
+
/* @__PURE__ */ jsx24("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(line.amount, order.currency_code) })
|
|
2975
|
+
]
|
|
2976
|
+
},
|
|
2977
|
+
line.id
|
|
2978
|
+
);
|
|
2979
|
+
}) })
|
|
2918
2980
|
] })
|
|
2919
2981
|
] });
|
|
2920
2982
|
};
|
|
2921
2983
|
var Total2 = ({ order }) => {
|
|
2922
|
-
const { t } =
|
|
2984
|
+
const { t } = useTranslation23();
|
|
2923
2985
|
const totalCaptured = getTotalCaptured(order.payment_collections || []);
|
|
2924
2986
|
const outstanding = Math.max(0, order.total - totalCaptured);
|
|
2925
|
-
return /* @__PURE__ */
|
|
2926
|
-
/* @__PURE__ */
|
|
2927
|
-
/* @__PURE__ */
|
|
2928
|
-
|
|
2987
|
+
return /* @__PURE__ */ jsxs25("div", { className: " flex flex-col gap-y-2 px-6 py-4", children: [
|
|
2988
|
+
/* @__PURE__ */ jsxs25("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
2989
|
+
/* @__PURE__ */ jsx24(
|
|
2990
|
+
Text21,
|
|
2929
2991
|
{
|
|
2930
2992
|
weight: "plus",
|
|
2931
2993
|
className: "text-ui-fg-subtle",
|
|
@@ -2934,8 +2996,8 @@ var Total2 = ({ order }) => {
|
|
|
2934
2996
|
children: t("fields.total")
|
|
2935
2997
|
}
|
|
2936
2998
|
),
|
|
2937
|
-
/* @__PURE__ */
|
|
2938
|
-
|
|
2999
|
+
/* @__PURE__ */ jsx24(
|
|
3000
|
+
Text21,
|
|
2939
3001
|
{
|
|
2940
3002
|
weight: "plus",
|
|
2941
3003
|
className: "text-ui-fg-subtle",
|
|
@@ -2945,9 +3007,9 @@ var Total2 = ({ order }) => {
|
|
|
2945
3007
|
}
|
|
2946
3008
|
)
|
|
2947
3009
|
] }),
|
|
2948
|
-
/* @__PURE__ */
|
|
2949
|
-
/* @__PURE__ */
|
|
2950
|
-
|
|
3010
|
+
/* @__PURE__ */ jsxs25("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
3011
|
+
/* @__PURE__ */ jsx24(
|
|
3012
|
+
Text21,
|
|
2951
3013
|
{
|
|
2952
3014
|
weight: "plus",
|
|
2953
3015
|
className: "text-ui-fg-subtle",
|
|
@@ -2956,8 +3018,8 @@ var Total2 = ({ order }) => {
|
|
|
2956
3018
|
children: t("fields.paidTotal")
|
|
2957
3019
|
}
|
|
2958
3020
|
),
|
|
2959
|
-
/* @__PURE__ */
|
|
2960
|
-
|
|
3021
|
+
/* @__PURE__ */ jsx24(
|
|
3022
|
+
Text21,
|
|
2961
3023
|
{
|
|
2962
3024
|
weight: "plus",
|
|
2963
3025
|
className: "text-ui-fg-subtle",
|
|
@@ -2967,49 +3029,22 @@ var Total2 = ({ order }) => {
|
|
|
2967
3029
|
}
|
|
2968
3030
|
)
|
|
2969
3031
|
] }),
|
|
2970
|
-
/* @__PURE__ */
|
|
2971
|
-
/* @__PURE__ */
|
|
2972
|
-
/* @__PURE__ */
|
|
3032
|
+
/* @__PURE__ */ jsxs25("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
3033
|
+
/* @__PURE__ */ jsx24(Text21, { weight: "plus", size: "small", leading: "compact", children: t("orders.payment.outstandingAmount") }),
|
|
3034
|
+
/* @__PURE__ */ jsx24(Text21, { weight: "plus", size: "small", leading: "compact", children: getStylizedAmount(outstanding, order.currency_code) })
|
|
2973
3035
|
] })
|
|
2974
3036
|
] });
|
|
2975
3037
|
};
|
|
2976
|
-
var OutstandingActions = ({ order }) => {
|
|
2977
|
-
const { t } = useTranslation24();
|
|
2978
|
-
const unpaidCollection = order.payment_collections?.find(
|
|
2979
|
-
(pc) => pc.status !== "captured" && pc.status !== "canceled"
|
|
2980
|
-
);
|
|
2981
|
-
const pendingDifference = order.summary?.pending_difference || 0;
|
|
2982
|
-
const isOutstanding = pendingDifference > 5e-3 && order.status !== "canceled" && !!unpaidCollection;
|
|
2983
|
-
if (!isOutstanding || !unpaidCollection) {
|
|
2984
|
-
return null;
|
|
2985
|
-
}
|
|
2986
|
-
const paymentLink = unpaidCollection.payment_sessions?.[0]?.data?.url ?? null;
|
|
2987
|
-
if (!paymentLink) {
|
|
2988
|
-
return null;
|
|
2989
|
-
}
|
|
2990
|
-
const handleCopyLink = async () => {
|
|
2991
|
-
try {
|
|
2992
|
-
await navigator.clipboard.writeText(paymentLink);
|
|
2993
|
-
toast7.success(t("orders.payment.copyLinkSuccess"));
|
|
2994
|
-
} catch {
|
|
2995
|
-
toast7.error(t("orders.payment.copyLinkError"));
|
|
2996
|
-
}
|
|
2997
|
-
};
|
|
2998
|
-
return /* @__PURE__ */ jsx25("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: /* @__PURE__ */ jsx25(Button7, { size: "small", variant: "secondary", onClick: handleCopyLink, children: t("orders.payment.copyPaymentLink", {
|
|
2999
|
-
amount: getStylizedAmount(pendingDifference, order.currency_code)
|
|
3000
|
-
}) }) });
|
|
3001
|
-
};
|
|
3002
3038
|
|
|
3003
3039
|
// src/pages/orders/[id]/order-detail-page.tsx
|
|
3004
|
-
import { Fragment as Fragment4, jsx as
|
|
3040
|
+
import { Fragment as Fragment4, jsx as jsx25, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3005
3041
|
var Root = ({ children }) => {
|
|
3006
3042
|
const initialData = useLoaderData();
|
|
3007
3043
|
const { id } = useParams();
|
|
3044
|
+
const query = useLinkQuery("order", DEFAULT_FIELDS);
|
|
3008
3045
|
const { order, isLoading, isError, error } = useOrder(
|
|
3009
3046
|
id,
|
|
3010
|
-
|
|
3011
|
-
fields: DEFAULT_FIELDS
|
|
3012
|
-
},
|
|
3047
|
+
query,
|
|
3013
3048
|
{
|
|
3014
3049
|
initialData
|
|
3015
3050
|
}
|
|
@@ -3029,29 +3064,28 @@ var Root = ({ children }) => {
|
|
|
3029
3064
|
});
|
|
3030
3065
|
}
|
|
3031
3066
|
if (isLoading || !order || isPreviewLoading) {
|
|
3032
|
-
return /* @__PURE__ */
|
|
3067
|
+
return /* @__PURE__ */ jsx25(TwoColumnPageSkeleton, { mainSections: 4, sidebarSections: 2, showJSON: true });
|
|
3033
3068
|
}
|
|
3034
3069
|
if (isError) {
|
|
3035
3070
|
throw error;
|
|
3036
3071
|
}
|
|
3037
|
-
return /* @__PURE__ */
|
|
3038
|
-
/* @__PURE__ */
|
|
3039
|
-
/* @__PURE__ */
|
|
3040
|
-
orderPreview && /* @__PURE__ */
|
|
3041
|
-
/* @__PURE__ */
|
|
3042
|
-
/* @__PURE__ */
|
|
3043
|
-
/* @__PURE__ */
|
|
3072
|
+
return /* @__PURE__ */ jsx25(Fragment4, { children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs26(TwoColumnPage, { data: order, hasOutlet: true, showMetadata: true, showJSON: true, children: [
|
|
3073
|
+
/* @__PURE__ */ jsx25(TwoColumnPage.Main, { children: /* @__PURE__ */ jsxs26(WidgetZone2, { id: "orders.detail.main", data: order, children: [
|
|
3074
|
+
/* @__PURE__ */ jsx25(OrderActiveEditSection, { order }),
|
|
3075
|
+
orderPreview && /* @__PURE__ */ jsxs26(Fragment4, { children: [
|
|
3076
|
+
/* @__PURE__ */ jsx25(ActiveOrderClaimSection, { orderPreview }),
|
|
3077
|
+
/* @__PURE__ */ jsx25(ActiveOrderExchangeSection, { orderPreview }),
|
|
3078
|
+
/* @__PURE__ */ jsx25(ActiveOrderReturnSection, { orderPreview })
|
|
3044
3079
|
] }),
|
|
3045
|
-
/* @__PURE__ */
|
|
3046
|
-
/* @__PURE__ */
|
|
3047
|
-
/* @__PURE__ */
|
|
3048
|
-
/* @__PURE__ */
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
/* @__PURE__ */
|
|
3053
|
-
|
|
3054
|
-
] })
|
|
3080
|
+
/* @__PURE__ */ jsx25(OrderGeneralSection, { order }),
|
|
3081
|
+
/* @__PURE__ */ jsx25(OrderSummarySection, { order }),
|
|
3082
|
+
/* @__PURE__ */ jsx25(OrderPaymentSection, { order }),
|
|
3083
|
+
/* @__PURE__ */ jsx25(OrderFulfillmentSection, { order })
|
|
3084
|
+
] }) }),
|
|
3085
|
+
/* @__PURE__ */ jsx25(TwoColumnPage.Sidebar, { children: /* @__PURE__ */ jsxs26(WidgetZone2, { id: "orders.detail.side", data: order, children: [
|
|
3086
|
+
/* @__PURE__ */ jsx25(OrderCustomerSection, { order }),
|
|
3087
|
+
/* @__PURE__ */ jsx25(OrderActivitySection, { order })
|
|
3088
|
+
] }) })
|
|
3055
3089
|
] }) });
|
|
3056
3090
|
};
|
|
3057
3091
|
var OrderDetailPage = Object.assign(Root, {
|