@bjsdistribution/dms-client-return 0.1.99-prod → 0.2.0-prod

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/components/client-portal/OutstandingTable.js +118 -112
  2. package/dist/components/client-portal/OutstandingTable.js.map +1 -1
  3. package/dist/components/fakeData.js.map +1 -1
  4. package/dist/components/order-daily-overview/common/fakedata.js.map +1 -1
  5. package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js +33 -31
  6. package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js.map +1 -1
  7. package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js +82 -79
  8. package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js.map +1 -1
  9. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js +157 -151
  10. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js.map +1 -1
  11. package/dist/components/order-view/order-actions/Dropdown.js +3 -3
  12. package/dist/components/order-view/order-actions/Dropdown.js.map +1 -1
  13. package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.js +47 -45
  14. package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.js.map +1 -1
  15. package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js +36 -23
  16. package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js.map +1 -1
  17. package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js +25 -23
  18. package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js.map +1 -1
  19. package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.js +89 -88
  20. package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.js.map +1 -1
  21. package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.js +16 -16
  22. package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.js.map +1 -1
  23. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.js +23 -22
  24. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.js.map +1 -1
  25. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js +56 -52
  26. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js.map +1 -1
  27. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js +27 -26
  28. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js.map +1 -1
  29. package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.js +29 -29
  30. package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.js.map +1 -1
  31. package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js +72 -71
  32. package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js.map +1 -1
  33. package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js +37 -35
  34. package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js.map +1 -1
  35. package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js +20 -18
  36. package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js.map +1 -1
  37. package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js +26 -22
  38. package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js.map +1 -1
  39. package/dist/components/order-view/order-details/helper.js.map +1 -1
  40. package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js +53 -53
  41. package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js.map +1 -1
  42. package/dist/components/order-view/toolbox-resources/expanded-content/index.js +6 -7
  43. package/dist/components/order-view/toolbox-resources/expanded-content/index.js.map +1 -1
  44. package/dist/components/utils.js +4 -5
  45. package/dist/components/utils.js.map +1 -1
  46. package/dist/types/components/order-view/order-actions/Dropdown.d.ts +1 -0
  47. package/dist/types/components/utils.d.ts +0 -1
  48. package/package.json +2 -2
@@ -1,38 +1,40 @@
1
- import { jsxs as e, jsx as t } from "react/jsx-runtime";
2
- import i from "styled-components";
1
+ import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
+ import n from "styled-components";
3
3
  import { useProductDetails as d } from "../../../../store.js";
4
- import { Skeleton as o, Empty as c } from "antd";
5
- import { useLoading as a } from "../../../../../order-daily-overview/store/store.js";
6
- import { StyledTableWrapper as s, StyledTable as h, EmptyDataContainer as p } from "./ReminderStyles.js";
7
- function P() {
8
- const [n] = d(), [l] = a();
9
- return n ? /* @__PURE__ */ e(f, { children: [
10
- /* @__PURE__ */ e(m, { children: [
4
+ import { Skeleton as c, Empty as a } from "antd";
5
+ import { useLoading as s } from "../../../../../order-daily-overview/store/store.js";
6
+ import { StyledTableWrapper as p, StyledTable as h, EmptyDataContainer as m } from "./ReminderStyles.js";
7
+ import { useClientPortal as f } from "../../../../../store.js";
8
+ import { toReverseDeliveryLabel as u } from "@bjsdistribution/dms-component-library";
9
+ function _() {
10
+ const [i] = d(), [l] = s(), [o] = f();
11
+ return i ? /* @__PURE__ */ r(g, { children: [
12
+ /* @__PURE__ */ r(y, { children: [
11
13
  "Products (",
12
- n?.length,
14
+ i?.length,
13
15
  ")"
14
16
  ] }),
15
- /* @__PURE__ */ t(s, { children: /* @__PURE__ */ e(h, { className: "scrollClass", children: [
16
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ e("tr", { children: [
17
+ /* @__PURE__ */ t(p, { children: /* @__PURE__ */ r(h, { className: "scrollClass", children: [
18
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ r("tr", { children: [
17
19
  /* @__PURE__ */ t("th", { children: "Action" }),
18
20
  /* @__PURE__ */ t("th", { children: "Code" }),
19
21
  /* @__PURE__ */ t("th", { children: "Description" }),
20
22
  /* @__PURE__ */ t("th", { children: "Parts" })
21
23
  ] }) }),
22
- /* @__PURE__ */ t("tbody", { children: l ? /* @__PURE__ */ e("tr", { children: [
23
- /* @__PURE__ */ t("td", { colSpan: 6, children: /* @__PURE__ */ t(o, { active: !0 }) }),
24
+ /* @__PURE__ */ t("tbody", { children: l ? /* @__PURE__ */ r("tr", { children: [
25
+ /* @__PURE__ */ t("td", { colSpan: 6, children: /* @__PURE__ */ t(c, { active: !0 }) }),
24
26
  /* @__PURE__ */ t("td", { colSpan: 6 })
25
- ] }) : n?.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { className: "emptyTd", colSpan: 7, children: /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t(c, {}) }) }) }) : n?.map((r) => /* @__PURE__ */ e("tr", { children: [
26
- /* @__PURE__ */ t("td", { children: r?.order_product_type?.type }),
27
+ ] }) : i?.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { className: "emptyTd", colSpan: 7, children: /* @__PURE__ */ t(m, { children: /* @__PURE__ */ t(a, {}) }) }) }) : i?.map((e) => /* @__PURE__ */ r("tr", { children: [
28
+ /* @__PURE__ */ t("td", { children: o ? e?.order_product_type?.type : u(e?.order_product_type?.type) }),
27
29
  " ",
28
- /* @__PURE__ */ t("td", { children: r?.code }),
29
- /* @__PURE__ */ t("td", { children: r?.description }),
30
- /* @__PURE__ */ t("td", { children: r?.sku })
31
- ] }, r.id)) })
30
+ /* @__PURE__ */ t("td", { children: e?.code }),
31
+ /* @__PURE__ */ t("td", { children: e?.description }),
32
+ /* @__PURE__ */ t("td", { children: e?.sku })
33
+ ] }, e.id)) })
32
34
  ] }) })
33
35
  ] }) : null;
34
36
  }
35
- const m = i.h2`
37
+ const y = n.h2`
36
38
  color: #3a3630;
37
39
  font-family: 'Roboto', sans-serif;
38
40
  font-size: 16px;
@@ -41,7 +43,7 @@ const m = i.h2`
41
43
  text-transform: uppercase;
42
44
  padding: 0;
43
45
  margin: 0;
44
- `, f = i.div`
46
+ `, g = n.div`
45
47
  display: flex;
46
48
  flex-direction: column;
47
49
  gap: 8px;
@@ -50,6 +52,6 @@ const m = i.h2`
50
52
  }
51
53
  `;
52
54
  export {
53
- P as default
55
+ _ as default
54
56
  };
55
57
  //# sourceMappingURL=ProductTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductTable.js","sources":["../../../../../../../src/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { useProductDetails } from '../../../../store';\n\nimport { Empty, Skeleton } from 'antd';\nimport { useLoading } from '../../../../../order-daily-overview/store/store';\nimport {\n EmptyDataContainer,\n StyledTable,\n StyledTableWrapper,\n} from './ReminderStyles';\n\nfunction ProductTable() {\n const [orderProductDetails] = useProductDetails();\n const [loading] = useLoading();\n\n if (!orderProductDetails) {\n return null;\n }\n\n return (\n <Container>\n <Title>Products ({orderProductDetails?.length})</Title>\n <StyledTableWrapper>\n <StyledTable className=\"scrollClass\">\n <thead>\n <tr>\n <th>Action</th>\n <th>Code</th>\n <th>Description</th>\n <th>Parts</th>\n </tr>\n </thead>\n <tbody>\n {loading ? (\n <tr>\n <td colSpan={6}>\n <Skeleton active />\n </td>\n <td colSpan={6}></td>\n </tr>\n ) : orderProductDetails?.length === 0 ? (\n <tr>\n <td className=\"emptyTd\" colSpan={7}>\n <EmptyDataContainer>\n <Empty />\n </EmptyDataContainer>\n </td>\n </tr>\n ) : (\n orderProductDetails?.map((order: any) => (\n <tr key={order.id}>\n <td>{order?.order_product_type?.type}</td>{' '}\n <td>{order?.code}</td>\n <td>{order?.description}</td>\n <td>{order?.sku}</td>\n </tr>\n ))\n )}\n </tbody>\n </StyledTable>\n </StyledTableWrapper>\n </Container>\n );\n}\n\nconst Title = styled.h2`\n color: #3a3630;\n font-family: 'Roboto', sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n text-transform: uppercase;\n padding: 0;\n margin: 0;\n`;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 8px;\n > div {\n min-height: 165px;\n }\n`;\n\nexport default ProductTable;\n"],"names":["ProductTable","orderProductDetails","useProductDetails","loading","useLoading","Container","jsxs","Title","jsx","StyledTableWrapper","StyledTable","Skeleton","EmptyDataContainer","Empty","order","styled"],"mappings":";;;;;;AAYA,SAASA,IAAe;AACtB,QAAM,CAACC,CAAmB,IAAIC,EAAA,GACxB,CAACC,CAAO,IAAIC,EAAA;AAElB,SAAKH,sBAKFI,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAM,UAAA;AAAA,MAAA;AAAA,MAAWN,GAAqB;AAAA,MAAO;AAAA,IAAA,GAAC;AAAA,IAC/C,gBAAAO,EAACC,GAAA,EACC,UAAA,gBAAAH,EAACI,GAAA,EAAY,WAAU,eACrB,UAAA;AAAA,MAAA,gBAAAF,EAAC,SAAA,EACC,4BAAC,MAAA,EACC,UAAA;AAAA,QAAA,gBAAAA,EAAC,QAAG,UAAA,SAAA,CAAM;AAAA,QACV,gBAAAA,EAAC,QAAG,UAAA,OAAA,CAAI;AAAA,QACR,gBAAAA,EAAC,QAAG,UAAA,cAAA,CAAW;AAAA,QACf,gBAAAA,EAAC,QAAG,UAAA,QAAA,CAAK;AAAA,MAAA,EAAA,CACX,EAAA,CACF;AAAA,MACA,gBAAAA,EAAC,SAAA,EACE,UAAAL,IACC,gBAAAG,EAAC,MAAA,EACC,UAAA;AAAA,QAAA,gBAAAE,EAAC,QAAG,SAAS,GACX,4BAACG,GAAA,EAAS,QAAM,IAAC,EAAA,CACnB;AAAA,QACA,gBAAAH,EAAC,MAAA,EAAG,SAAS,EAAA,CAAG;AAAA,MAAA,EAAA,CAClB,IACEP,GAAqB,WAAW,IAClC,gBAAAO,EAAC,QACC,UAAA,gBAAAA,EAAC,MAAA,EAAG,WAAU,WAAU,SAAS,GAC/B,4BAACI,GAAA,EACC,UAAA,gBAAAJ,EAACK,GAAA,CAAA,CAAM,EAAA,CACT,GACF,EAAA,CACF,IAEAZ,GAAqB,IAAI,CAACa,MACxB,gBAAAR,EAAC,MAAA,EACC,UAAA;AAAA,QAAA,gBAAAE,EAAC,MAAA,EAAI,UAAAM,GAAO,oBAAoB,MAAK;AAAA,QAAM;AAAA,QAC3C,gBAAAN,EAAC,MAAA,EAAI,UAAAM,GAAO,KAAA,CAAK;AAAA,QACjB,gBAAAN,EAAC,MAAA,EAAI,UAAAM,GAAO,YAAA,CAAY;AAAA,QACxB,gBAAAN,EAAC,MAAA,EAAI,UAAAM,GAAO,IAAA,CAAI;AAAA,MAAA,KAJTA,EAAM,EAKf,CACD,EAAA,CAEL;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAAA,GACF,IA7CO;AA+CX;AAEA,MAAMP,IAAQQ,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAWfV,IAAYU,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"ProductTable.js","sources":["../../../../../../../src/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport { useProductDetails } from '../../../../store';\n\nimport { Empty, Skeleton } from 'antd';\nimport { useLoading } from '../../../../../order-daily-overview/store/store';\nimport {\n EmptyDataContainer,\n StyledTable,\n StyledTableWrapper,\n} from './ReminderStyles';\nimport { useClientPortal } from '../../../../../store';\nimport { toReverseDeliveryLabel } from '@bjsdistribution/dms-component-library';\n\nfunction ProductTable() {\n const [orderProductDetails] = useProductDetails();\n const [loading] = useLoading();\n const [isClientPortal] = useClientPortal();\n\n if (!orderProductDetails) {\n return null;\n }\n\n return (\n <Container>\n <Title>Products ({orderProductDetails?.length})</Title>\n <StyledTableWrapper>\n <StyledTable className=\"scrollClass\">\n <thead>\n <tr>\n <th>Action</th>\n <th>Code</th>\n <th>Description</th>\n <th>Parts</th>\n </tr>\n </thead>\n <tbody>\n {loading ? (\n <tr>\n <td colSpan={6}>\n <Skeleton active />\n </td>\n <td colSpan={6}></td>\n </tr>\n ) : orderProductDetails?.length === 0 ? (\n <tr>\n <td className=\"emptyTd\" colSpan={7}>\n <EmptyDataContainer>\n <Empty />\n </EmptyDataContainer>\n </td>\n </tr>\n ) : (\n orderProductDetails?.map((order: any) => (\n <tr key={order.id}>\n <td>\n {isClientPortal\n ? order?.order_product_type?.type\n : toReverseDeliveryLabel(order?.order_product_type?.type)}\n </td>{' '}\n <td>{order?.code}</td>\n <td>{order?.description}</td>\n <td>{order?.sku}</td>\n </tr>\n ))\n )}\n </tbody>\n </StyledTable>\n </StyledTableWrapper>\n </Container>\n );\n}\n\nconst Title = styled.h2`\n color: #3a3630;\n font-family: 'Roboto', sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n text-transform: uppercase;\n padding: 0;\n margin: 0;\n`;\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 8px;\n > div {\n min-height: 165px;\n }\n`;\n\nexport default ProductTable;\n"],"names":["ProductTable","orderProductDetails","useProductDetails","loading","useLoading","isClientPortal","useClientPortal","Container","jsxs","Title","jsx","StyledTableWrapper","StyledTable","Skeleton","EmptyDataContainer","Empty","order","toReverseDeliveryLabel","styled"],"mappings":";;;;;;;;AAcA,SAASA,IAAe;AACtB,QAAM,CAACC,CAAmB,IAAIC,EAAA,GACxB,CAACC,CAAO,IAAIC,EAAA,GACZ,CAACC,CAAc,IAAIC,EAAA;AAEzB,SAAKL,sBAKFM,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAM,UAAA;AAAA,MAAA;AAAA,MAAWR,GAAqB;AAAA,MAAO;AAAA,IAAA,GAAC;AAAA,IAC/C,gBAAAS,EAACC,GAAA,EACC,UAAA,gBAAAH,EAACI,GAAA,EAAY,WAAU,eACrB,UAAA;AAAA,MAAA,gBAAAF,EAAC,SAAA,EACC,4BAAC,MAAA,EACC,UAAA;AAAA,QAAA,gBAAAA,EAAC,QAAG,UAAA,SAAA,CAAM;AAAA,QACV,gBAAAA,EAAC,QAAG,UAAA,OAAA,CAAI;AAAA,QACR,gBAAAA,EAAC,QAAG,UAAA,cAAA,CAAW;AAAA,QACf,gBAAAA,EAAC,QAAG,UAAA,QAAA,CAAK;AAAA,MAAA,EAAA,CACX,EAAA,CACF;AAAA,MACA,gBAAAA,EAAC,SAAA,EACE,UAAAP,IACC,gBAAAK,EAAC,MAAA,EACC,UAAA;AAAA,QAAA,gBAAAE,EAAC,QAAG,SAAS,GACX,4BAACG,GAAA,EAAS,QAAM,IAAC,EAAA,CACnB;AAAA,QACA,gBAAAH,EAAC,MAAA,EAAG,SAAS,EAAA,CAAG;AAAA,MAAA,EAAA,CAClB,IACET,GAAqB,WAAW,IAClC,gBAAAS,EAAC,QACC,UAAA,gBAAAA,EAAC,MAAA,EAAG,WAAU,WAAU,SAAS,GAC/B,4BAACI,GAAA,EACC,UAAA,gBAAAJ,EAACK,GAAA,CAAA,CAAM,EAAA,CACT,GACF,EAAA,CACF,IAEAd,GAAqB,IAAI,CAACe,MACxB,gBAAAR,EAAC,MAAA,EACC,UAAA;AAAA,QAAA,gBAAAE,EAAC,MAAA,EACE,cACGM,GAAO,oBAAoB,OAC3BC,EAAuBD,GAAO,oBAAoB,IAAI,EAAA,CAC5D;AAAA,QAAM;AAAA,QACN,gBAAAN,EAAC,MAAA,EAAI,UAAAM,GAAO,KAAA,CAAK;AAAA,QACjB,gBAAAN,EAAC,MAAA,EAAI,UAAAM,GAAO,YAAA,CAAY;AAAA,QACxB,gBAAAN,EAAC,MAAA,EAAI,UAAAM,GAAO,IAAA,CAAI;AAAA,MAAA,KARTA,EAAM,EASf,CACD,EAAA,CAEL;AAAA,IAAA,EAAA,CACF,EAAA,CACF;AAAA,EAAA,GACF,IAjDO;AAmDX;AAEA,MAAMP,IAAQS,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAWfX,IAAYW,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -1,30 +1,31 @@
1
1
  import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
- import Le, { useState as b, useEffect as f } from "react";
3
- import Me from "../../../../../common/modals/order-action-modal/OrderActionModal.js";
4
- import { useCustomerInfo as Ge, useOrderCustomersList as $e, useCurrentAction as je, useActiveTab as ze, useChargesState as Be, useOrderDetails as V, usePrevOrderDetails as Ue, useNewStatus as Ve, useOrderCancelReason as Je, useOrderHoldReason as We, useFailureReason as qe, useEscalationCategory as Ke, useEscalationLevel as Qe, useEscalationReason as Xe, useGlobalStateHitOrder as Ye, useGlobalStateHitAuditLog as Ze, useGlobalEscData as et, useProductDetails as tt, useCustomerDetails as at } from "../../../store.js";
5
- import rt from "./charges/order-charges/index.js";
6
- import ot from "./charges/collection-add-ons/index.js";
7
- import st from "./charges/disposal-charges/index.js";
2
+ import Me, { useState as b, useEffect as f } from "react";
3
+ import Ge from "../../../../../common/modals/order-action-modal/OrderActionModal.js";
4
+ import { useCustomerInfo as $e, useOrderCustomersList as je, useCurrentAction as ze, useActiveTab as Be, useChargesState as Ue, useOrderDetails as V, usePrevOrderDetails as Ve, useNewStatus as Je, useOrderCancelReason as We, useOrderHoldReason as qe, useFailureReason as Ke, useEscalationCategory as Qe, useEscalationLevel as Xe, useEscalationReason as Ye, useGlobalStateHitOrder as Ze, useGlobalStateHitAuditLog as et, useGlobalEscData as tt, useProductDetails as at, useCustomerDetails as rt } from "../../../store.js";
5
+ import ot from "./charges/order-charges/index.js";
6
+ import st from "./charges/collection-add-ons/index.js";
7
+ import it from "./charges/disposal-charges/index.js";
8
8
  import c from "styled-components";
9
- import it from "./charges/base-charge/index.js";
10
- import nt from "./charges/delivery-add-ons/index.js";
11
- import ct from "./charges/adhoc/index.js";
12
- import dt from "./order-info/index.js";
13
- import lt from "./Selector.js";
14
- import { useAxios as h, useApiHook as ut, Label as J, Checkbox as ft } from "@bjsdistribution/dms-component-library";
15
- import pt from "./escalation/index.js";
16
- import mt from "./notifications/index.js";
17
- import { filterObject as W, compareOrderDetailsStates as ht } from "../../../utils.js";
9
+ import nt from "./charges/base-charge/index.js";
10
+ import ct from "./charges/delivery-add-ons/index.js";
11
+ import dt from "./charges/adhoc/index.js";
12
+ import { useClientPortal as lt } from "../../../../store.js";
13
+ import ut from "./order-info/index.js";
14
+ import ft from "./Selector.js";
15
+ import { useAxios as h, useApiHook as pt, Label as J, toReverseDeliveryLabel as mt, Checkbox as ht } from "@bjsdistribution/dms-component-library";
16
+ import gt from "./escalation/index.js";
17
+ import _t from "./notifications/index.js";
18
+ import { filterObject as W, compareOrderDetailsStates as yt } from "../../../utils.js";
18
19
  import { notification as n } from "antd";
19
- import gt from "./BaseChargeConfirmationModal.js";
20
- import { v4 as _t } from "uuid";
21
- function yt(v) {
22
- const [R, Q] = Ge(), [X, Y] = $e(), Z = `${R?.recipient_name}, ${R?.postcode}`, [, ee] = je(), [s, k] = ze(), te = (e) => k(e), [x, ae] = Be(), [p, m] = b({}), [re, oe] = b([]), [o, A] = V(), [g, se] = Ue(), [w, ie] = b(!0), [d, ne] = Ve(), [F, ce] = Je(), [T, de] = We(), [N, le] = qe(), [I, ue] = Ke(), [H, fe] = Qe(), [L, pe] = Xe(), [, M] = Ye(), [, me] = Ze(), [, he] = et(), [ge, G] = b(
20
+ import Dt from "./BaseChargeConfirmationModal.js";
21
+ import { v4 as bt } from "uuid";
22
+ function Ct(v) {
23
+ const [Q] = lt(), [R, X] = $e(), [Y, Z] = je(), ee = `${R?.recipient_name}, ${R?.postcode}`, [, te] = ze(), [s, k] = Be(), ae = (e) => k(e), [x, re] = Ue(), [p, m] = b({}), [oe, se] = b([]), [o, A] = V(), [g, ie] = Ve(), [w, ne] = b(!0), [d, ce] = Je(), [F, de] = We(), [T, le] = qe(), [N, ue] = Ke(), [I, fe] = Qe(), [L, pe] = Xe(), [H, me] = Ye(), [, M] = Ze(), [, he] = et(), [, ge] = tt(), [_e, G] = b(
23
24
  !1
24
- ), [_e] = tt(), $ = _e?.sort((e, r) => e?.status === r?.status ? 0 : e?.status ? -1 : 1), j = Array.isArray($) ? $?.filter((e) => e?.status === !0) : [], [ye] = V(), O = ye?.customer_id, {
25
+ ), [ye] = at(), $ = ye?.sort((e, r) => e?.status === r?.status ? 0 : e?.status ? -1 : 1), j = Array.isArray($) ? $?.filter((e) => e?.status === !0) : [], [De] = V(), O = De?.customer_id, {
25
26
  data: _,
26
- loading: De,
27
- fetchData: be
27
+ loading: be,
28
+ fetchData: Ce
28
29
  } = h({
29
30
  endpoint: "/v1/customer/list",
30
31
  method: "GET",
@@ -34,60 +35,60 @@ function yt(v) {
34
35
  f(() => {
35
36
  if (_ && _?.data) {
36
37
  const e = _?.data;
37
- Y(e);
38
+ Z(e);
38
39
  }
39
- }, [_, De]), f(() => {
40
- be();
40
+ }, [_, be]), f(() => {
41
+ Ce();
41
42
  }, []);
42
- const [S, Ce] = at(), { data: y, loading: ve, setShouldPerformAction: xe } = ut({
43
+ const [S, ve] = rt(), { data: y, loading: xe, setShouldPerformAction: Ae } = pt({
43
44
  endpoint: `customers/${O}`,
44
45
  method: "GET",
45
46
  performAction: !1
46
47
  });
47
48
  f(() => {
48
- O && xe(!0);
49
+ O && Ae(!0);
49
50
  }, [O]), f(() => {
50
51
  if (y && y?.data) {
51
52
  const e = y?.data;
52
- Ce(e);
53
+ ve(e);
53
54
  }
54
- }, [y, ve]);
55
- const Ae = X?.find(
55
+ }, [y, xe]);
56
+ const we = Y?.find(
56
57
  (e) => e?.id === S?.id
57
- ), we = Array.from({ length: 9 }, () => ({
58
- id: _t(),
58
+ ), Oe = Array.from({ length: 9 }, () => ({
59
+ id: bt(),
59
60
  adhoc_charges_description: "",
60
61
  adhoc_charges: 0
61
62
  })), {
62
- fetchData: Oe,
63
+ fetchData: Se,
63
64
  data: z,
64
- loading: Se
65
+ loading: Ee
65
66
  } = h({
66
67
  endpoint: "/finance/debrief/getData/all/",
67
68
  method: "GET"
68
69
  });
69
70
  f(() => {
70
- ae((e) => ({
71
+ re((e) => ({
71
72
  ...e,
72
- adhoc_charges: we
73
- })), Oe();
73
+ adhoc_charges: Oe
74
+ })), Se();
74
75
  }, []), f(() => {
75
- z?.data && oe(z?.data[0]);
76
- }, [Se]);
77
- const { fetchData: Ee } = h({
76
+ z?.data && se(z?.data[0]);
77
+ }, [Ee]);
78
+ const { fetchData: Pe } = h({
78
79
  endpoint: "/orders/update/",
79
80
  method: "PUT"
80
- }), { fetchData: Pe } = h({
81
+ }), { fetchData: Re } = h({
81
82
  endpoint: "/invoices/force-debrief/",
82
83
  method: "POST"
83
- }), { fetchData: Re } = h({
84
+ }), { fetchData: ke } = h({
84
85
  endpoint: "/orders/escalations/create/",
85
86
  method: "POST"
86
87
  }), B = () => {
87
- A(g), ne(""), ce(""), de(""), le(""), ue(""), fe(""), pe(""), k("success");
88
- }, ke = () => {
89
- B(), ee(void 0);
88
+ A(g), ce(""), de(""), le(""), ue(""), fe(""), pe(""), me(""), k("success");
90
89
  }, Fe = () => {
90
+ B(), te(void 0);
91
+ }, Te = () => {
91
92
  const e = [
92
93
  "order_locked",
93
94
  "order_communications",
@@ -101,9 +102,9 @@ function yt(v) {
101
102
  e
102
103
  ), D = JSON.stringify(r), E = JSON.stringify(t);
103
104
  return !(D === E);
104
- }, Te = async (e, r) => {
105
+ }, Ne = async (e, r) => {
105
106
  try {
106
- const t = await Pe({
107
+ const t = await Re({
107
108
  payload: {
108
109
  debrief_data: e,
109
110
  ...s === "failure" ? { failure_data: r } : { failure_data: {} }
@@ -115,8 +116,8 @@ function yt(v) {
115
116
  });
116
117
  } catch {
117
118
  }
118
- }, Ne = async () => {
119
- const e = ht(
119
+ }, Ie = async () => {
120
+ const e = yt(
120
121
  g,
121
122
  o
122
123
  ), r = [
@@ -131,28 +132,28 @@ function yt(v) {
131
132
  t in e ? e[t] = e[t] : t in o && (e[t] = o[t]);
132
133
  e?.assemble === !1 && e?.disassemble === !1 && (e.assembly_type = null);
133
134
  try {
134
- let t = await Ee({
135
+ let t = await Pe({
135
136
  payload: [e]
136
137
  });
137
138
  t.code === 200 && t?.data?.length > 0 && (n.success({
138
139
  message: "Success",
139
140
  description: `${t?.message}`
140
- }), A(t?.data[0]), se(t?.data[0]), Q({
141
+ }), A(t?.data[0]), ie(t?.data[0]), X({
141
142
  recipient_name: t?.data[0]?.order_recipient?.recipient_name,
142
143
  postcode: t?.data[0]?.order_recipient?.postcode
143
144
  }), await M(!0));
144
145
  } catch {
145
146
  A(g);
146
147
  }
147
- }, Ie = async (e) => {
148
+ }, Le = async (e) => {
148
149
  try {
149
- const r = await Re({
150
+ const r = await ke({
150
151
  payload: e
151
152
  });
152
153
  r?.code === 200 && (n.success({
153
154
  message: "Success",
154
155
  description: `${r?.message}`
155
- }), he(r?.data));
156
+ }), ge(r?.data));
156
157
  } catch {
157
158
  }
158
159
  }, U = async () => {
@@ -162,7 +163,7 @@ function yt(v) {
162
163
  order_number: o?.order_number,
163
164
  customer_id: S?.id,
164
165
  customer_name: S?.customer_name,
165
- client_name: Ae?.client_name,
166
+ client_name: we?.client_name,
166
167
  recipient_name: o?.order_recipient?.recipient_name,
167
168
  order_id: o?.id,
168
169
  order_type: o?.order_type?.type,
@@ -220,44 +221,44 @@ function yt(v) {
220
221
  return;
221
222
  }
222
223
  }
223
- if (s === "failure" && w && (!I?.value || !H?.value || !L?.value)) {
224
+ if (s === "failure" && w && (!I?.value || !L?.value || !H?.value)) {
224
225
  n.error({
225
226
  message: "Error",
226
227
  description: "Escalation Category, Level and Reason are all mandatory"
227
228
  });
228
229
  return;
229
230
  }
230
- if (Fe() && await Ne(), s === "failure" && w) {
231
+ if (Te() && await Ie(), s === "failure" && w) {
231
232
  const l = [
232
233
  {
233
234
  order_id: o?.id,
234
- escalation_reason_id: L?.value,
235
+ escalation_reason_id: H?.value,
235
236
  escalation_category_id: I?.value,
236
- escalation_level_id: H?.value,
237
+ escalation_level_id: L?.value,
237
238
  is_deleted: !1,
238
239
  route_id: o?.order_routes?.route_id
239
240
  }
240
241
  ];
241
- await Ie(l);
242
+ await Le(l);
242
243
  }
243
- await Te(E, D), await me(!0), B(), await v?.callOrderStatusApi(), await v?.callOrderAlertsApi(), await v?.callOrdersApi();
244
+ await Ne(E, D), await he(!0), B(), await v?.callOrderStatusApi(), await v?.callOrderAlertsApi(), await v?.callOrdersApi();
244
245
  };
245
246
  return /* @__PURE__ */ i(
246
- Me,
247
+ Ge,
247
248
  {
248
249
  headerTitle: "Order Debrief",
249
- onCloseHeader: ke,
250
- infoText: Z,
250
+ onCloseHeader: Fe,
251
+ infoText: ee,
251
252
  onSubmit: () => {
252
253
  x?.base_charge > 200 ? G(!0) : U();
253
254
  },
254
255
  submitBtnTitle: "Complete Order",
255
256
  maxWidth: "95vw",
256
- headerActions: /* @__PURE__ */ a(lt, { onSwitchChange: te }),
257
+ headerActions: /* @__PURE__ */ a(ft, { onSwitchChange: ae }),
257
258
  children: [
258
- /* @__PURE__ */ i(bt, { children: [
259
- /* @__PURE__ */ a(mt, {}),
260
- /* @__PURE__ */ a(C, { children: /* @__PURE__ */ a(dt, {}) }),
259
+ /* @__PURE__ */ i(xt, { children: [
260
+ /* @__PURE__ */ a(_t, {}),
261
+ /* @__PURE__ */ a(C, { children: /* @__PURE__ */ a(ut, {}) }),
261
262
  /* @__PURE__ */ i(C, { children: [
262
263
  /* @__PURE__ */ i(P, { children: [
263
264
  /* @__PURE__ */ a(
@@ -274,10 +275,10 @@ function yt(v) {
274
275
  /* @__PURE__ */ a(K, { children: o?.other_instructions || "N/A" })
275
276
  ] })
276
277
  ] }),
277
- j?.length > 0 && /* @__PURE__ */ a(Ct, { children: /* @__PURE__ */ a(P, { children: j?.map((e, r) => /* @__PURE__ */ i(Dt, { children: [
278
+ j?.length > 0 && /* @__PURE__ */ a(At, { children: /* @__PURE__ */ a(P, { children: j?.map((e, r) => /* @__PURE__ */ i(vt, { children: [
278
279
  /* @__PURE__ */ a(u, { children: "*" }),
279
280
  /* @__PURE__ */ a(u, { children: e?.status_value || "N/A" }),
280
- /* @__PURE__ */ a(u, { children: e?.order_product_type?.type || "N/A" }),
281
+ /* @__PURE__ */ a(u, { children: (Q ? e?.order_product_type?.type : mt(e?.order_product_type?.type)) || "N/A" }),
281
282
  /* @__PURE__ */ a(u, { children: e?.sku || "N/A" }),
282
283
  /* @__PURE__ */ a(u, { children: "Part 1 of 1" }),
283
284
  /* @__PURE__ */ a(u, { children: "Weight:" + e?.weight || "N/A" }),
@@ -286,15 +287,15 @@ function yt(v) {
286
287
  /* @__PURE__ */ i(C, { children: [
287
288
  /* @__PURE__ */ i(q, { children: [
288
289
  /* @__PURE__ */ a(
289
- it,
290
+ nt,
290
291
  {
291
292
  inputValue: p,
292
293
  setInputValue: m,
293
- staticData: re
294
+ staticData: oe
294
295
  }
295
296
  ),
296
297
  /* @__PURE__ */ a(
297
- nt,
298
+ ct,
298
299
  {
299
300
  inputValue: p,
300
301
  setInputValue: m
@@ -303,39 +304,39 @@ function yt(v) {
303
304
  ] }),
304
305
  /* @__PURE__ */ i(q, { children: [
305
306
  /* @__PURE__ */ a(
306
- ot,
307
+ st,
307
308
  {
308
309
  inputValue: p,
309
310
  setInputValue: m
310
311
  }
311
312
  ),
312
313
  /* @__PURE__ */ a(
313
- st,
314
+ it,
314
315
  {
315
316
  inputValue: p,
316
317
  setInputValue: m
317
318
  }
318
319
  )
319
320
  ] }),
320
- /* @__PURE__ */ a(rt, { inputValue: p, setInputValue: m }),
321
- /* @__PURE__ */ a(ct, {})
321
+ /* @__PURE__ */ a(ot, { inputValue: p, setInputValue: m }),
322
+ /* @__PURE__ */ a(dt, {})
322
323
  ] }),
323
324
  s === "failure" && /* @__PURE__ */ i(C, { style: { flexDirection: "column", gap: "10px" }, children: [
324
325
  /* @__PURE__ */ i("div", { style: { display: "flex", gap: "10px" }, children: [
325
326
  "Escalation",
326
327
  /* @__PURE__ */ a(
327
- ft,
328
+ ht,
328
329
  {
329
330
  checked: w,
330
- onChange: (e) => ie(e.target.checked)
331
+ onChange: (e) => ne(e.target.checked)
331
332
  }
332
333
  )
333
334
  ] }),
334
- /* @__PURE__ */ a(pt, {})
335
+ /* @__PURE__ */ a(gt, {})
335
336
  ] })
336
337
  ] }),
337
- ge && /* @__PURE__ */ a(
338
- gt,
338
+ _e && /* @__PURE__ */ a(
339
+ Dt,
339
340
  {
340
341
  setConfirmationModal: G,
341
342
  onProceed: U
@@ -351,11 +352,11 @@ const u = c.span`
351
352
  font-weight: 400;
352
353
  text-transform: capitalize;
353
354
  color: #3a3630;
354
- `, Dt = c.div`
355
+ `, vt = c.div`
355
356
  display: flex;
356
357
  flex-wrap: wrap;
357
358
  gap: 16px;
358
- `, bt = c.div`
359
+ `, xt = c.div`
359
360
  padding: 10px;
360
361
  display: flex;
361
362
  flex-direction: column;
@@ -381,7 +382,7 @@ const u = c.span`
381
382
  background: #f8fafc;
382
383
  width: 100%;
383
384
  white-space: nowrap;
384
- `, Ct = c.div`
385
+ `, At = c.div`
385
386
  display: flex;
386
387
  padding: 12px;
387
388
  flex-direction: row;
@@ -395,10 +396,10 @@ const u = c.span`
395
396
  min-height: 60px;
396
397
  overflow: scroll;
397
398
  max-height: 150px;
398
- `, Ut = Le.memo(yt);
399
+ `, qt = Me.memo(Ct);
399
400
  export {
400
401
  C as ContentContainer,
401
- Ct as ProductDiv,
402
- Ut as default
402
+ At as ProductDiv,
403
+ qt as default
403
404
  };
404
405
  //# sourceMappingURL=ForceDebriefModal.js.map