@bjsdistribution/dms-client-return 0.1.77-prod → 0.1.78-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 (68) hide show
  1. package/dist/common/utils.js +8 -7
  2. package/dist/common/utils.js.map +1 -1
  3. package/dist/components/client-portal/OutstandingTable.js +122 -116
  4. package/dist/components/client-portal/OutstandingTable.js.map +1 -1
  5. package/dist/components/fakeData.js.map +1 -1
  6. package/dist/components/order-daily-overview/common/fakedata.js.map +1 -1
  7. package/dist/components/order-daily-overview/header-filters/overViewFilter.js +7 -11
  8. package/dist/components/order-daily-overview/header-filters/overViewFilter.js.map +1 -1
  9. package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js +32 -30
  10. package/dist/components/order-daily-overview/return-after-table/table/OrderTable.js.map +1 -1
  11. package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js +58 -54
  12. package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.js.map +1 -1
  13. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js +157 -151
  14. package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.js.map +1 -1
  15. package/dist/components/order-view/details-filters/left-side-filters/dropdowns/OptionsDropDown.js.map +1 -1
  16. package/dist/components/order-view/fakedata.js.map +1 -1
  17. package/dist/components/order-view/general-information/dropdowns/Print.js +11 -11
  18. package/dist/components/order-view/general-information/dropdowns/Print.js.map +1 -1
  19. package/dist/components/order-view/index.js +154 -133
  20. package/dist/components/order-view/index.js.map +1 -1
  21. package/dist/components/order-view/order-actions/Dropdown.js +3 -3
  22. package/dist/components/order-view/order-actions/Dropdown.js.map +1 -1
  23. package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.js +47 -45
  24. package/dist/components/order-view/order-actions/actions/cancel-order/CancelOrderTable.js.map +1 -1
  25. package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js +36 -23
  26. package/dist/components/order-view/order-actions/actions/cancel-order/ReturnReason.js.map +1 -1
  27. package/dist/components/order-view/order-actions/actions/cancel-order/index.js.map +1 -1
  28. package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js +25 -23
  29. package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.js.map +1 -1
  30. package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.js +90 -88
  31. package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.js.map +1 -1
  32. package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.js +16 -16
  33. package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.js.map +1 -1
  34. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.js +24 -22
  35. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.js.map +1 -1
  36. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js +56 -51
  37. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.js.map +1 -1
  38. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.js.map +1 -1
  39. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js +26 -24
  40. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.js.map +1 -1
  41. package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.js +30 -29
  42. package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.js.map +1 -1
  43. package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js +25 -23
  44. package/dist/components/order-view/order-actions/actions/split-order/SplitOrderTable.js.map +1 -1
  45. package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js +37 -35
  46. package/dist/components/order-view/order-actions/actions/uncancel-order/UncancelOrderTable.js.map +1 -1
  47. package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js +20 -18
  48. package/dist/components/order-view/order-details/expanded-content/services-section/OrderServices.js.map +1 -1
  49. package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js +27 -22
  50. package/dist/components/order-view/order-details/expanded-content/services-section/ServiceType.js.map +1 -1
  51. package/dist/components/order-view/order-details/helper.js.map +1 -1
  52. package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js +179 -151
  53. package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.js.map +1 -1
  54. package/dist/components/order-view/store.js +160 -144
  55. package/dist/components/order-view/store.js.map +1 -1
  56. package/dist/components/order-view/toolbox-resources/collapsed-content/index.js +16 -0
  57. package/dist/components/order-view/toolbox-resources/collapsed-content/index.js.map +1 -0
  58. package/dist/components/order-view/toolbox-resources/expanded-content/index.js +534 -0
  59. package/dist/components/order-view/toolbox-resources/expanded-content/index.js.map +1 -0
  60. package/dist/components/utils.js +5 -4
  61. package/dist/components/utils.js.map +1 -1
  62. package/dist/types/common/utils.d.ts +1 -0
  63. package/dist/types/components/order-view/order-actions/Dropdown.d.ts +1 -0
  64. package/dist/types/components/order-view/store.d.ts +6 -0
  65. package/dist/types/components/order-view/toolbox-resources/collapsed-content/index.d.ts +2 -0
  66. package/dist/types/components/order-view/toolbox-resources/expanded-content/index.d.ts +2 -0
  67. package/dist/types/components/utils.d.ts +1 -0
  68. package/package.json +2 -3
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceType.js","sources":["../../../../../../src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx"],"sourcesContent":["import React from 'react';\nimport { Label, SelectDropdown } from '@bjsdistribution/dms-component-library';\nimport { useOrderDetails, useOrderStaticData } from '../../../store';\nimport styled from 'styled-components';\nimport { capitalize } from '../../../utils';\n\nfunction ServiceTypeDropdown() {\n const [orderStaticData] = useOrderStaticData();\n const [orderData, setOrderData] = useOrderDetails();\n\n const orderTypeId = orderData?.order_type_id;\n\n const serviceTypeOptions = orderStaticData?.order_type?.map(\n (option: any) => ({\n label: capitalize(option.type.replaceAll('_', ' ')),\n value: option.id,\n })\n );\n\n const onChange = (event: any) => {\n const newData = { ...orderData, order_type_id: event.value };\n setOrderData(newData);\n };\n const isDisabled = true;\n\n return (\n <Container>\n <Label label=\"Service Type\" htmlFor=\"serviceTypeDropdown\" />\n <StyledSelectDropdown\n placeholder=\"Select Service Type\"\n options={serviceTypeOptions || []}\n value={serviceTypeOptions?.filter((f: any) => f.value === orderTypeId)}\n inputId=\"serviceTypeDropdown\"\n openMenuOnFocus\n onChange={onChange}\n isDisabled={true}\n className={isDisabled ? 'disabled' : ''}\n />\n </Container>\n );\n}\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n // flex: 1;\n min-width: 250px;\n`;\n\nconst StyledSelectDropdown = styled(SelectDropdown)`\n &.disabled {\n cursor: not-allowed !important;\n opacity: 0.7;\n }\n`;\n\nexport default ServiceTypeDropdown;\n"],"names":["ServiceTypeDropdown","orderStaticData","useOrderStaticData","orderData","setOrderData","useOrderDetails","orderTypeId","serviceTypeOptions","option","capitalize","onChange","event","newData","Container","jsx","Label","StyledSelectDropdown","f","styled","SelectDropdown"],"mappings":";;;;;AAMA,SAASA,IAAsB;AAC7B,QAAM,CAACC,CAAe,IAAIC,EAAA,GACpB,CAACC,GAAWC,CAAY,IAAIC,EAAA,GAE5BC,IAAcH,GAAW,eAEzBI,IAAqBN,GAAiB,YAAY;AAAA,IACtD,CAACO,OAAiB;AAAA,MAChB,OAAOC,EAAWD,EAAO,KAAK,WAAW,KAAK,GAAG,CAAC;AAAA,MAClD,OAAOA,EAAO;AAAA,IAAA;AAAA,EAChB,GAGIE,IAAW,CAACC,MAAe;AAC/B,UAAMC,IAAU,EAAE,GAAGT,GAAW,eAAeQ,EAAM,MAAA;AACrD,IAAAP,EAAaQ,CAAO;AAAA,EACtB;AAGA,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAM,OAAM,gBAAe,SAAQ,uBAAsB;AAAA,IAC1D,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,aAAY;AAAA,QACZ,SAAST,KAAsB,CAAA;AAAA,QAC/B,OAAOA,GAAoB,OAAO,CAACU,MAAWA,EAAE,UAAUX,CAAW;AAAA,QACrE,SAAQ;AAAA,QACR,iBAAe;AAAA,QACf,UAAAI;AAAA,QACA,YAAY;AAAA,QACZ,WAAwB;AAAA,MAAa;AAAA,IAAA;AAAA,EACvC,GACF;AAEJ;AAEA,MAAMG,IAAYK,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQnBF,IAAuBE,EAAOC,CAAc;AAAA;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"ServiceType.js","sources":["../../../../../../src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx"],"sourcesContent":["import React from 'react';\nimport { Label, SelectDropdown } from '@bjsdistribution/dms-component-library';\nimport { useOrderDetails, useOrderStaticData } from '../../../store';\nimport styled from 'styled-components';\nimport { capitalize } from '../../../utils';\nimport { toReverseDeliveryLabel } from '../../../../../common/utils';\nimport { useClientPortal } from '../../../../store';\n\nfunction ServiceTypeDropdown() {\n const [orderStaticData] = useOrderStaticData();\n const [orderData, setOrderData] = useOrderDetails();\n const [isClientPortal] = useClientPortal();\n\n const orderTypeId = orderData?.order_type_id;\n\n const serviceTypeOptions = orderStaticData?.order_type?.map(\n (option: any) => {\n const rawLabel = capitalize(option.type.replaceAll('_', ' '));\n return {\n label: isClientPortal ? rawLabel : toReverseDeliveryLabel(rawLabel),\n value: option.id,\n };\n }\n );\n\n const onChange = (event: any) => {\n const newData = { ...orderData, order_type_id: event.value };\n setOrderData(newData);\n };\n const isDisabled = true;\n\n return (\n <Container>\n <Label label=\"Service Type\" htmlFor=\"serviceTypeDropdown\" />\n <StyledSelectDropdown\n placeholder=\"Select Service Type\"\n options={serviceTypeOptions || []}\n value={serviceTypeOptions?.filter((f: any) => f.value === orderTypeId)}\n inputId=\"serviceTypeDropdown\"\n openMenuOnFocus\n onChange={onChange}\n isDisabled={true}\n className={isDisabled ? 'disabled' : ''}\n />\n </Container>\n );\n}\n\nconst Container = styled.div`\n display: flex;\n flex-direction: column;\n gap: 6px;\n // flex: 1;\n min-width: 250px;\n`;\n\nconst StyledSelectDropdown = styled(SelectDropdown)`\n &.disabled {\n cursor: not-allowed !important;\n opacity: 0.7;\n }\n`;\n\nexport default ServiceTypeDropdown;\n"],"names":["ServiceTypeDropdown","orderStaticData","useOrderStaticData","orderData","setOrderData","useOrderDetails","isClientPortal","useClientPortal","orderTypeId","serviceTypeOptions","option","rawLabel","capitalize","toReverseDeliveryLabel","onChange","event","newData","Container","jsx","Label","StyledSelectDropdown","f","styled","SelectDropdown"],"mappings":";;;;;;;AAQA,SAASA,IAAsB;AAC7B,QAAM,CAACC,CAAe,IAAIC,EAAA,GACpB,CAACC,GAAWC,CAAY,IAAIC,EAAA,GAC5B,CAACC,CAAc,IAAIC,EAAA,GAEnBC,IAAcL,GAAW,eAEzBM,IAAqBR,GAAiB,YAAY;AAAA,IACtD,CAACS,MAAgB;AACf,YAAMC,IAAWC,EAAWF,EAAO,KAAK,WAAW,KAAK,GAAG,CAAC;AAC5D,aAAO;AAAA,QACL,OAAOJ,IAAiBK,IAAWE,EAAuBF,CAAQ;AAAA,QAClE,OAAOD,EAAO;AAAA,MAAA;AAAA,IAElB;AAAA,EAAA,GAGII,IAAW,CAACC,MAAe;AAC/B,UAAMC,IAAU,EAAE,GAAGb,GAAW,eAAeY,EAAM,MAAA;AACrD,IAAAX,EAAaY,CAAO;AAAA,EACtB;AAGA,2BACGC,GAAA,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAM,OAAM,gBAAe,SAAQ,uBAAsB;AAAA,IAC1D,gBAAAD;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,aAAY;AAAA,QACZ,SAASX,KAAsB,CAAA;AAAA,QAC/B,OAAOA,GAAoB,OAAO,CAACY,MAAWA,EAAE,UAAUb,CAAW;AAAA,QACrE,SAAQ;AAAA,QACR,iBAAe;AAAA,QACf,UAAAM;AAAA,QACA,YAAY;AAAA,QACZ,WAAwB;AAAA,MAAa;AAAA,IAAA;AAAA,EACvC,GACF;AAEJ;AAEA,MAAMG,IAAYK,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQnBF,IAAuBE,EAAOC,CAAc;AAAA;AAAA;AAAA;AAAA;AAAA;"}
@@ -1 +1 @@
1
- {"version":3,"file":"helper.js","sources":["../../../../src/components/order-view/order-details/helper.ts"],"sourcesContent":["export const depotOptions = [\n {\n label: 'BJS COURIERS',\n value: 'bjs_couriers',\n },\n {\n label: 'BRD 01',\n value: 'brd_01',\n },\n {\n label: 'EXE 01',\n value: 'exe_01',\n },\n];\n\nexport const timedServiceOptions = [\n {\n label: 'All Day',\n value: 'all_day',\n },\n {\n label: 'Business Hours',\n value: 'business_hours',\n },\n {\n label: 'AM (07:00 - 12:00)',\n value: 'am',\n },\n {\n label: 'PM (12:00 - 17:00)',\n value: 'pm',\n },\n {\n label: 'Evening (17:00 - 21:00)',\n value: 'evening',\n },\n {\n label: 'Daytime (11:00 - 16:00)',\n value: 'daytime',\n },\n {\n label: 'Morning (07:00 - 12:00)',\n value: 'morning',\n },\n {\n label: 'Late AM (09:00 - 12:00)',\n value: 'late_am',\n },\n {\n label: 'Late PM (15:00 - 20:00)',\n value: 'late_pm',\n },\n];\n\nexport const serviceTypeOptions = [\n {\n label: 'Delivery',\n value: 'delivery',\n },\n {\n label: 'Collection',\n value: 'collection',\n },\n {\n label: 'Exchange',\n value: 'exchange',\n },\n {\n label: 'Service Order',\n value: 'service_order',\n },\n];\n\nexport const deliveryPointOptions = [\n {\n label: 'Room of Choice',\n value: 'roc',\n },\n {\n label: 'Hallway',\n value: 'hallway',\n },\n {\n label: 'Front Door',\n value: 'front_door',\n },\n {\n label: 'Garden',\n value: 'garden',\n },\n];\n\nexport const serviceLevelOptions = [\n {\n label: '1 Man',\n value: '1man',\n },\n {\n label: '1.5 Man',\n value: '1.5man',\n },\n {\n label: '2 Man',\n value: '2man',\n },\n];\n\nexport const assemblyTypeOptions = [\n {\n label: 'Small',\n value: 'small',\n },\n {\n label: 'Medium',\n value: 'medium',\n },\n {\n label: 'Large',\n value: 'large',\n },\n];\n\nexport const vehicleTypeOptions = [\n {\n label: 'LGV',\n value: '1',\n },\n {\n label: 'HGV',\n value: '2',\n },\n];\n"],"names":["vehicleTypeOptions"],"mappings":"AA0HO,MAAMA,IAAqB;AAAA,EAChC;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAEX;"}
1
+ {"version":3,"file":"helper.js","sources":["../../../../src/components/order-view/order-details/helper.ts"],"sourcesContent":["export const depotOptions = [\n {\n label: 'BJS COURIERS',\n value: 'bjs_couriers',\n },\n {\n label: 'BRD 01',\n value: 'brd_01',\n },\n {\n label: 'EXE 01',\n value: 'exe_01',\n },\n];\n\nexport const timedServiceOptions = [\n {\n label: 'All Day',\n value: 'all_day',\n },\n {\n label: 'Business Hours',\n value: 'business_hours',\n },\n {\n label: 'AM (07:00 - 12:00)',\n value: 'am',\n },\n {\n label: 'PM (12:00 - 17:00)',\n value: 'pm',\n },\n {\n label: 'Evening (17:00 - 21:00)',\n value: 'evening',\n },\n {\n label: 'Daytime (11:00 - 16:00)',\n value: 'daytime',\n },\n {\n label: 'Morning (07:00 - 12:00)',\n value: 'morning',\n },\n {\n label: 'Late AM (09:00 - 12:00)',\n value: 'late_am',\n },\n {\n label: 'Late PM (15:00 - 20:00)',\n value: 'late_pm',\n },\n];\n\nexport const serviceTypeOptions = [\n {\n label: 'Delivery',\n value: 'delivery',\n },\n {\n label: 'Reverse Delivery',\n value: 'collection',\n },\n {\n label: 'Exchange',\n value: 'exchange',\n },\n {\n label: 'Service Order',\n value: 'service_order',\n },\n];\n\nexport const deliveryPointOptions = [\n {\n label: 'Room of Choice',\n value: 'roc',\n },\n {\n label: 'Hallway',\n value: 'hallway',\n },\n {\n label: 'Front Door',\n value: 'front_door',\n },\n {\n label: 'Garden',\n value: 'garden',\n },\n];\n\nexport const serviceLevelOptions = [\n {\n label: '1 Man',\n value: '1man',\n },\n {\n label: '1.5 Man',\n value: '1.5man',\n },\n {\n label: '2 Man',\n value: '2man',\n },\n];\n\nexport const assemblyTypeOptions = [\n {\n label: 'Small',\n value: 'small',\n },\n {\n label: 'Medium',\n value: 'medium',\n },\n {\n label: 'Large',\n value: 'large',\n },\n];\n\nexport const vehicleTypeOptions = [\n {\n label: 'LGV',\n value: '1',\n },\n {\n label: 'HGV',\n value: '2',\n },\n];\n"],"names":["vehicleTypeOptions"],"mappings":"AA0HO,MAAMA,IAAqB;AAAA,EAChC;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAAA,EAET;AAAA,IACE,OAAO;AAAA,IACP,OAAO;AAAA,EAAA;AAEX;"}
@@ -1,176 +1,192 @@
1
- import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
- import R, { useState as f, useEffect as E } from "react";
3
- import { StyledTableWrapper as O, StyledTable as T } from "../../../order-daily-overview/return-order-table/return-orders-filters/returnstyles.js";
4
- import { Checkbox as j, useAxios as W, displayValueOrNA as g } from "@bjsdistribution/dms-component-library";
5
- import B from "../../../../assets/icons/ActionIcon.js";
6
- import { useProductDetails as F, useOrderId as L } from "../../store.js";
7
- import { notification as d, Skeleton as z, Empty as V } from "antd";
8
- import { useSelectedProducts as $, useNewReturnOrderData as q, useIsShowNorthSouth as G, useClientPortal as H } from "../../../store.js";
9
- import y from "styled-components";
10
- import { NavLink as J } from "react-router-dom";
11
- import { EmptyDataContainer as K } from "../../order-actions/actions/charge-log/index.js";
12
- import n from "../../northern-southern-info/CustomInput.js";
13
- const le = (l) => {
14
- const [x, s] = $(), [c, b] = f(!1), [i, v] = F(), [a, S] = f(null), [u] = L(), [A] = q(), [C] = G(), [h] = H(), { data: m, fetchData: N } = W({
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
+ import E, { useState as u } from "react";
3
+ import { StyledTableWrapper as T, StyledTable as j } from "../../../order-daily-overview/return-order-table/return-orders-filters/returnstyles.js";
4
+ import { Checkbox as L, CancelationModal as M, CancelAndCompleteAction as W, useAxios as B, displayValueOrNA as _ } from "@bjsdistribution/dms-component-library";
5
+ import F from "../../../../assets/icons/ActionIcon.js";
6
+ import { toReverseDeliveryLabel as V } from "../../../../common/utils.js";
7
+ import { useProductDetails as z, useOrderId as G } from "../../store.js";
8
+ import { Skeleton as $, Empty as q, Spin as H, notification as f } from "antd";
9
+ import { useSelectedProducts as J, useNewReturnOrderData as K, useIsShowNorthSouth as Q, useClientPortal as U } from "../../../store.js";
10
+ import a from "styled-components";
11
+ import { NavLink as X } from "react-router-dom";
12
+ import { EmptyDataContainer as Y } from "../../order-actions/actions/charge-log/index.js";
13
+ import d from "../../northern-southern-info/CustomInput.js";
14
+ const fe = (s) => {
15
+ const [b, c] = J(), [h, v] = u(!1), [i] = z(), [C] = G(), [A] = K(), [S] = Q(), [l] = U(), [g, p] = u(null), [N, m] = u(!1), { loading: n, fetchData: D } = B({
15
16
  endpoint: "v1/return/product/remove/",
16
- method: "POST",
17
- body: { return_order_product_id: a, return_order_id: +u }
18
- });
19
- E(() => {
20
- m && m.data && (d.success({
21
- message: "Success",
22
- description: "Successfully Delete Order Product."
23
- }), P(), S(null));
24
- }, [m]);
25
- const P = () => {
26
- a !== null && v(
27
- (t) => t.filter((r) => r.id !== a)
28
- );
29
- }, I = () => {
30
- if (c)
31
- s([]);
32
- else {
33
- const t = i?.map((r) => r.id);
34
- s(t);
35
- }
36
- b(!c);
37
- }, w = (t) => {
38
- s(
39
- (r) => r.includes(t) ? r.filter((D) => D !== t) : [...r, t]
40
- );
41
- }, k = async (t) => {
17
+ method: "POST"
18
+ }), I = (t) => {
19
+ p(t), m(!0);
20
+ }, P = async () => {
21
+ if (g === null || n) return;
22
+ const t = g;
42
23
  try {
43
- const r = await N({
24
+ const r = await D({
44
25
  payload: {
45
26
  return_order_product_id: t,
46
- return_order_id: +u
27
+ return_order_id: +C
47
28
  }
48
29
  });
49
- r?.code === 200 ? (d.success({
30
+ r?.code === 200 ? (f.success({
50
31
  message: "Success",
51
32
  description: r?.message || "Product deleted successfully."
52
- }), l?.callReturnProducts()) : d.error({
33
+ }), s?.callReturnProducts(), p(null), m(!1)) : f.error({
53
34
  message: "Deletion Failed",
54
35
  description: r?.message || "Could not delete the product."
55
36
  });
56
37
  } catch (r) {
57
- console.error("Error deleting product:", r), d.error({
38
+ console.error("Error deleting product:", r), f.error({
58
39
  message: "Error",
59
40
  //@ts-ignore
60
41
  description: r?.message || "An unexpected error occurred."
61
42
  });
62
43
  }
63
- }, p = i?.length == 0 || A?.length == 0;
64
- return /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(O, { id: "tableScrolling", className: "orderProductTable", children: /* @__PURE__ */ o(T, { children: [
65
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { children: [
66
- /* @__PURE__ */ e("th", { className: "emailproductsCheckbox", children: /* @__PURE__ */ e(
67
- _,
68
- {
69
- disabled: p,
70
- checked: c,
71
- onChange: I
72
- }
73
- ) }),
74
- /* @__PURE__ */ e("th", { children: "Location" }),
75
- /* @__PURE__ */ e("th", { children: "Sender" }),
76
- /* @__PURE__ */ e("th", { children: "Code" }),
77
- /* @__PURE__ */ e("th", { children: "Description" }),
78
- /* @__PURE__ */ e("th", { children: "Return Reason" }),
79
- !h && /* @__PURE__ */ e("th", { children: "Additional Services" }),
80
- /* @__PURE__ */ e("th", { children: "Part" }),
81
- /* @__PURE__ */ e("th", { children: "Action" })
82
- ] }) }),
83
- /* @__PURE__ */ e("tbody", { children: l?.loading || l?.locationloading ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 14, children: /* @__PURE__ */ e(z, { active: !0 }) }) }) : i?.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 14, children: /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(V, {}) }) }) }) : i?.map((t) => /* @__PURE__ */ o(R.Fragment, { children: [
84
- /* @__PURE__ */ o("tr", { className: "product-row", children: [
85
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
86
- _,
44
+ }, w = () => {
45
+ n || (p(null), m(!1));
46
+ }, k = () => {
47
+ if (h)
48
+ c([]);
49
+ else {
50
+ const t = i?.map((r) => r.id);
51
+ c(t);
52
+ }
53
+ v(!h);
54
+ }, O = (t) => {
55
+ c(
56
+ (r) => r.includes(t) ? r.filter((R) => R !== t) : [...r, t]
57
+ );
58
+ }, y = i?.length == 0 || A?.length == 0;
59
+ return /* @__PURE__ */ o("div", { children: [
60
+ /* @__PURE__ */ e(T, { id: "tableScrolling", className: "orderProductTable", children: /* @__PURE__ */ o(j, { children: [
61
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { children: [
62
+ /* @__PURE__ */ e("th", { className: "emailproductsCheckbox", children: /* @__PURE__ */ e(
63
+ x,
87
64
  {
88
- checked: x?.includes(t?.id),
89
- onChange: () => w(t?.id),
90
- disabled: p
65
+ disabled: y,
66
+ checked: h,
67
+ onChange: k
91
68
  }
92
69
  ) }),
93
- /* @__PURE__ */ e("td", { children: t?.location || "N/A" }),
94
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ o("ul", { style: { listStyleType: "none", padding: 0 }, children: [
95
- /* @__PURE__ */ e(
96
- "li",
70
+ /* @__PURE__ */ e("th", { children: "Location" }),
71
+ /* @__PURE__ */ e("th", { children: "Sender" }),
72
+ /* @__PURE__ */ e("th", { children: "Code" }),
73
+ /* @__PURE__ */ e("th", { children: "Description" }),
74
+ /* @__PURE__ */ e("th", { children: "Return Reason" }),
75
+ !l && /* @__PURE__ */ e("th", { children: "Additional Services" }),
76
+ /* @__PURE__ */ e("th", { children: "Part" }),
77
+ /* @__PURE__ */ e("th", { children: "Action" })
78
+ ] }) }),
79
+ /* @__PURE__ */ e("tbody", { children: s?.loading || s?.locationloading ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 14, children: /* @__PURE__ */ e($, { active: !0 }) }) }) : i?.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: 14, children: /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(q, {}) }) }) }) : i?.map((t) => /* @__PURE__ */ o(E.Fragment, { children: [
80
+ /* @__PURE__ */ o("tr", { className: "product-row", children: [
81
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
82
+ x,
83
+ {
84
+ checked: b?.includes(t?.id),
85
+ onChange: () => O(t?.id),
86
+ disabled: y
87
+ }
88
+ ) }),
89
+ /* @__PURE__ */ e("td", { children: t?.location || "N/A" }),
90
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ o("ul", { style: { listStyleType: "none", padding: 0 }, children: [
91
+ /* @__PURE__ */ e(
92
+ "li",
93
+ {
94
+ style: {
95
+ color: "#0099ff",
96
+ fontWeight: 600
97
+ },
98
+ children: /* @__PURE__ */ e(X, { to: `/orders/view/${t?.order_id}`, children: _(t?.recipient_name) })
99
+ }
100
+ ),
101
+ /* @__PURE__ */ e("li", { style: { color: "#888075" }, children: _(t?.postcode) })
102
+ ] }) }),
103
+ /* @__PURE__ */ e("td", { children: t?.code }),
104
+ /* @__PURE__ */ e("td", { children: t?.description }),
105
+ /* @__PURE__ */ e("td", { children: l ? t?.return_reason : V(t?.return_reason) }),
106
+ !l && /* @__PURE__ */ e("td", { children: Array.isArray(t?.product_addon_services) && t?.product_addon_services?.length > 0 ? t.product_addon_services.map((r) => r?.service_code || r?.name || r).filter(Boolean).join(", ") : Array.isArray(t?.addon_services) && t?.addon_services?.length > 0 ? t.addon_services.map((r) => r?.service_code || r?.name || r).filter(Boolean).join(", ") : Array.isArray(t?.addon_services_list) && t?.addon_services_list?.length > 0 ? t.addon_services_list.join(", ") : typeof t?.addon_services == "string" && t?.addon_services.trim() !== "" ? t.addon_services : "NA" }),
107
+ /* @__PURE__ */ e("td", { children: t?.part }),
108
+ /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
109
+ "div",
97
110
  {
98
- style: {
99
- color: "#0099ff",
100
- fontWeight: 600
111
+ onClick: (r) => {
112
+ r.stopPropagation(), r.preventDefault(), I(t?.id);
101
113
  },
102
- children: /* @__PURE__ */ e(J, { to: `/orders/view/${t?.order_id}`, children: g(t?.recipient_name) })
114
+ style: { cursor: "pointer" },
115
+ children: /* @__PURE__ */ e(F, {})
103
116
  }
104
- ),
105
- /* @__PURE__ */ e("li", { style: { color: "#888075" }, children: g(t?.postcode) })
106
- ] }) }),
107
- /* @__PURE__ */ e("td", { children: t?.code }),
108
- /* @__PURE__ */ e("td", { children: t?.description }),
109
- /* @__PURE__ */ e("td", { children: t?.return_reason }),
110
- !h && /* @__PURE__ */ e("td", { children: Array.isArray(t?.product_addon_services) && t?.product_addon_services?.length > 0 ? t.product_addon_services.map((r) => r?.service_code || r?.name || r).filter(Boolean).join(", ") : Array.isArray(t?.addon_services) && t?.addon_services?.length > 0 ? t.addon_services.map((r) => r?.service_code || r?.name || r).filter(Boolean).join(", ") : Array.isArray(t?.addon_services_list) && t?.addon_services_list?.length > 0 ? t.addon_services_list.join(", ") : typeof t?.addon_services == "string" && t?.addon_services.trim() !== "" ? t.addon_services : "NA" }),
111
- /* @__PURE__ */ e("td", { children: t?.part }),
112
- /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
113
- "div",
117
+ ) })
118
+ ] }),
119
+ S === !0 && /* @__PURE__ */ e("td", { colSpan: l ? 8 : 9, children: /* @__PURE__ */ o(Z, { children: [
120
+ /* @__PURE__ */ e("div", { className: "left", children: "Northern/Southern Ireland" }),
121
+ /* @__PURE__ */ e("div", { className: "left-end" }),
122
+ /* @__PURE__ */ o("div", { className: "section", children: [
123
+ /* @__PURE__ */ e(
124
+ d,
125
+ {
126
+ label: "Commodity Code",
127
+ type: "text",
128
+ direction: "row",
129
+ placeholder: "Enter Commodity Code",
130
+ value: t?.product_customs_details?.commodity_code || "NA",
131
+ disabled: !0
132
+ }
133
+ ),
134
+ /* @__PURE__ */ e(
135
+ d,
136
+ {
137
+ label: "Country of Origin",
138
+ type: "text",
139
+ direction: "row",
140
+ placeholder: "Enter Country of Origin",
141
+ value: t?.product_customs_details?.country_of_origin || "NA",
142
+ disabled: !0
143
+ }
144
+ ),
145
+ /* @__PURE__ */ e(
146
+ d,
147
+ {
148
+ label: "Item Invoice Amount",
149
+ type: "number",
150
+ direction: "row",
151
+ placeholder: "Enter Item Invoice Amount",
152
+ value: t?.product_customs_details?.item_invoice_amount || 0,
153
+ disabled: !0
154
+ }
155
+ ),
156
+ /* @__PURE__ */ e(
157
+ d,
158
+ {
159
+ label: "NI Additional Info Codes",
160
+ type: "text",
161
+ direction: "row",
162
+ placeholder: "Enter NI Add Info Codes",
163
+ value: t?.product_customs_details?.ni_additional_information_codes || "NA",
164
+ disabled: !0
165
+ }
166
+ )
167
+ ] })
168
+ ] }) })
169
+ ] }, t.id)) })
170
+ ] }) }),
171
+ N && /* @__PURE__ */ e(H, { spinning: n, children: /* @__PURE__ */ e(
172
+ ee,
173
+ {
174
+ title: "Remove Product",
175
+ description: "Are you sure, you want to remove this order product for returns?",
176
+ actions: /* @__PURE__ */ e(
177
+ te,
114
178
  {
115
- onClick: () => k(t?.id),
116
- style: { cursor: "pointer" },
117
- children: /* @__PURE__ */ e(B, {})
179
+ cancelLabel: "Cancel",
180
+ onCancel: w,
181
+ completeLabel: n ? "REMOVING..." : "Confirm",
182
+ isDisabled: n,
183
+ onComplete: P
118
184
  }
119
- ) })
120
- ] }),
121
- C === !0 && /* @__PURE__ */ e("td", { colSpan: h ? 8 : 9, children: /* @__PURE__ */ o(M, { children: [
122
- /* @__PURE__ */ e("div", { className: "left", children: "Northern/Southern Ireland" }),
123
- /* @__PURE__ */ e("div", { className: "left-end" }),
124
- /* @__PURE__ */ o("div", { className: "section", children: [
125
- /* @__PURE__ */ e(
126
- n,
127
- {
128
- label: "Commodity Code",
129
- type: "text",
130
- direction: "row",
131
- placeholder: "Enter Commodity Code",
132
- value: t?.product_customs_details?.commodity_code || "NA",
133
- disabled: !0
134
- }
135
- ),
136
- /* @__PURE__ */ e(
137
- n,
138
- {
139
- label: "Country of Origin",
140
- type: "text",
141
- direction: "row",
142
- placeholder: "Enter Country of Origin",
143
- value: t?.product_customs_details?.country_of_origin || "NA",
144
- disabled: !0
145
- }
146
- ),
147
- /* @__PURE__ */ e(
148
- n,
149
- {
150
- label: "Item Invoice Amount",
151
- type: "number",
152
- direction: "row",
153
- placeholder: "Enter Item Invoice Amount",
154
- value: t?.product_customs_details?.item_invoice_amount || 0,
155
- disabled: !0
156
- }
157
- ),
158
- /* @__PURE__ */ e(
159
- n,
160
- {
161
- label: "NI Additional Info Codes",
162
- type: "text",
163
- direction: "row",
164
- placeholder: "Enter NI Add Info Codes",
165
- value: t?.product_customs_details?.ni_additional_information_codes || "NA",
166
- disabled: !0
167
- }
168
- )
169
- ] })
170
- ] }) })
171
- ] }, t.id)) })
172
- ] }) }) });
173
- }, M = y.div`
185
+ )
186
+ }
187
+ ) })
188
+ ] });
189
+ }, Z = a.div`
174
190
  display: flex;
175
191
  width: 100%;
176
192
  padding: 5px 10px;
@@ -227,15 +243,27 @@ const le = (l) => {
227
243
  background: #fff;
228
244
  }
229
245
  }
230
- `, _ = y(j)`
246
+ `, x = a(L)`
231
247
  &:disabled {
232
248
  background-color: gray;
233
249
  cursor: not-allowed;
234
250
  opacity: -0.4;
235
251
  }
252
+ `, ee = a(M)`
253
+ div {
254
+ & > div > div:first-child {
255
+ padding: 8px !important;
256
+ }
257
+ }
258
+ svg {
259
+ width: 28px !important;
260
+ height: 28px !important;
261
+ }
262
+ `, te = a(W)`
263
+ justify-content: center;
236
264
  `;
237
265
  export {
238
- M as NSWrapper,
239
- le as default
266
+ Z as NSWrapper,
267
+ fe as default
240
268
  };
241
269
  //# sourceMappingURL=ReturnProductTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReturnProductTable.js","sources":["../../../../../src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport {\n StyledTable,\n StyledTableWrapper,\n} from '../../../order-daily-overview/return-order-table/return-orders-filters/returnstyles';\nimport {\n Checkbox,\n displayValueOrNA,\n useAxios,\n} from '@bjsdistribution/dms-component-library';\nimport ActionIcon from '../../../../assets/icons/ActionIcon';\nimport { useOrderId, useProductDetails } from '../../store';\nimport { ApiResponse } from '../../types';\nimport { Empty, notification, Skeleton } from 'antd';\nimport {\n useIsShowNorthSouth,\n useNewReturnOrderData,\n useSelectedProducts,\n useClientPortal,\n} from '../../../store';\nimport styled from 'styled-components';\nimport { NavLink } from 'react-router-dom';\nimport { EmptyDataContainer } from '../../order-actions/actions/charge-log';\nimport CustomInput from '../../northern-southern-info/CustomInput';\n\ninterface IPROS {\n callReturnProducts: any;\n loading: boolean;\n locationloading: boolean;\n}\n\nconst ReturnProductTable = (props: IPROS) => {\n const [selectedProducts, setSelectedProducts] = useSelectedProducts();\n const [selectAll, setSelectAll] = useState(false);\n const [productData, setProductData] = useProductDetails();\n const [selectedRowId, setSelectedRowId] = useState<number | null>(null);\n const [orderId] = useOrderId();\n const [returnOrderData] = useNewReturnOrderData();\n const [isNorthSouth] = useIsShowNorthSouth();\n const [isClientPortal] = useClientPortal();\n\n // const handleActionClick = (id: number) => {\n // setSelectedRowId(id);\n // };\n\n const { data: isresponse, fetchData: callDeleteProduct } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: `v1/return/product/remove/`,\n method: 'POST',\n body: { return_order_product_id: selectedRowId, return_order_id: +orderId },\n });\n\n useEffect(() => {\n if (isresponse && isresponse.data) {\n notification.success({\n message: 'Success',\n description: 'Successfully Delete Order Product.',\n });\n handleRemoveRow();\n setSelectedRowId(null);\n }\n }, [isresponse]);\n\n const handleRemoveRow = () => {\n if (selectedRowId !== null) {\n setProductData((prevData: any) =>\n prevData.filter((item: any) => item.id !== selectedRowId)\n );\n }\n };\n\n // const onDeleteProducts = () => {\n // callDeleteProduct();\n // };\n\n const handleSelectAll = () => {\n if (selectAll) {\n setSelectedProducts([]);\n } else {\n const allProductIds = productData?.map((product: any) => product.id);\n setSelectedProducts(allProductIds);\n }\n setSelectAll(!selectAll);\n };\n\n const handleSelectProduct = (id: number) => {\n setSelectedProducts((prevSelected: any) =>\n prevSelected.includes(id)\n ? prevSelected.filter((selectedId: any) => selectedId !== id)\n : [...prevSelected, id]\n );\n };\n\n //delete product API\n const deleteProduct = async (selectedProductId: any) => {\n try {\n const response = (await callDeleteProduct({\n payload: {\n return_order_product_id: selectedProductId,\n return_order_id: +orderId,\n },\n })) as {\n code: number | null;\n error?: string | null;\n data?: any[];\n message?: string;\n };\n\n if (response?.code === 200) {\n notification.success({\n message: 'Success',\n description: response?.message || 'Product deleted successfully.',\n });\n props?.callReturnProducts();\n } else {\n notification.error({\n message: 'Deletion Failed',\n description: response?.message || 'Could not delete the product.',\n });\n }\n } catch (error) {\n console.error('Error deleting product:', error);\n notification.error({\n message: 'Error',\n //@ts-ignore\n description: error?.message || 'An unexpected error occurred.',\n });\n }\n };\n\n const disableCheckbox =\n productData?.length == 0 || returnOrderData?.length == 0;\n return (\n <div>\n <StyledTableWrapper id=\"tableScrolling\" className=\"orderProductTable\">\n <StyledTable>\n <thead>\n <tr>\n <th className=\"emailproductsCheckbox\">\n <StyleCheckbox\n disabled={disableCheckbox}\n checked={selectAll}\n onChange={handleSelectAll}\n />\n </th>\n <th>Location</th>\n <th>Sender</th>\n <th>Code</th>\n <th>Description</th>\n <th>Return Reason</th>\n {!isClientPortal && <th>Additional Services</th>}\n <th>Part</th>\n <th>Action</th>\n </tr>\n </thead>\n <tbody>\n {props?.loading || props?.locationloading ? (\n <tr>\n <td colSpan={14}>\n <Skeleton active />\n </td>\n </tr>\n ) : productData?.length === 0 ? (\n <tr>\n <td colSpan={14}>\n <EmptyDataContainer>\n <Empty />\n </EmptyDataContainer>\n </td>\n </tr>\n ) : (\n productData?.map((product: any) => (\n <React.Fragment key={product.id}>\n {/* MAIN ROW */}\n <tr className=\"product-row\">\n <td>\n <StyleCheckbox\n checked={selectedProducts?.includes(product?.id)}\n onChange={() => handleSelectProduct(product?.id)}\n disabled={disableCheckbox}\n />\n </td>\n <td>{product?.location || 'N/A'}</td>\n <td>\n <ul style={{ listStyleType: 'none', padding: 0 }}>\n <li\n style={{\n color: '#0099ff',\n fontWeight: 600,\n }}\n >\n <NavLink to={`/orders/view/${product?.order_id}`}>\n {displayValueOrNA(product?.recipient_name)}\n </NavLink>\n </li>\n <li style={{ color: '#888075' }}>\n {displayValueOrNA(product?.postcode)}\n </li>\n </ul>\n </td>\n <td>{product?.code}</td>\n <td>{product?.description}</td>\n <td>{product?.return_reason}</td>\n {!isClientPortal && (\n <td>\n {Array.isArray(product?.product_addon_services) && product?.product_addon_services?.length > 0\n ? product.product_addon_services\n .map((service: any) => service?.service_code || service?.name || service)\n .filter(Boolean)\n .join(', ')\n : Array.isArray(product?.addon_services) && product?.addon_services?.length > 0\n ? product.addon_services\n .map((service: any) => service?.service_code || service?.name || service)\n .filter(Boolean)\n .join(', ')\n : Array.isArray(product?.addon_services_list) && product?.addon_services_list?.length > 0\n ? product.addon_services_list.join(', ')\n : typeof product?.addon_services === 'string' && product?.addon_services.trim() !== ''\n ? product.addon_services\n : 'NA'}\n </td>\n )}\n <td>{product?.part}</td>\n <td>\n <div\n onClick={() => deleteProduct(product?.id)}\n style={{ cursor: 'pointer' }}\n >\n <ActionIcon />\n </div>\n </td>\n </tr>\n\n {/* EXPANDED ROW */}\n {isNorthSouth === true && (\n <td colSpan={isClientPortal ? 8 : 9}>\n <NSWrapper>\n <div className=\"left\">Northern/Southern Ireland</div>\n <div className=\"left-end\"></div>\n\n <div className=\"section\">\n <CustomInput\n label=\"Commodity Code\"\n type=\"text\"\n direction=\"row\"\n placeholder=\"Enter Commodity Code\"\n value={\n product?.product_customs_details\n ?.commodity_code || 'NA'\n }\n disabled\n />\n\n <CustomInput\n label=\"Country of Origin\"\n type=\"text\"\n direction=\"row\"\n placeholder=\"Enter Country of Origin\"\n value={\n product?.product_customs_details\n ?.country_of_origin || 'NA'\n }\n disabled\n />\n\n <CustomInput\n label=\"Item Invoice Amount\"\n type=\"number\"\n direction=\"row\"\n placeholder=\"Enter Item Invoice Amount\"\n value={\n product?.product_customs_details\n ?.item_invoice_amount || 0\n }\n disabled\n />\n\n <CustomInput\n label=\"NI Additional Info Codes\"\n type=\"text\"\n direction=\"row\"\n placeholder=\"Enter NI Add Info Codes\"\n value={\n product?.product_customs_details\n ?.ni_additional_information_codes || 'NA'\n }\n disabled\n />\n </div>\n </NSWrapper>\n </td>\n )}\n </React.Fragment>\n ))\n )}\n </tbody>\n </StyledTable>\n </StyledTableWrapper>\n </div>\n );\n};\n\nexport const NSWrapper = styled.div`\n display: flex;\n width: 100%;\n padding: 5px 10px;\n align-items: center;\n gap: 10px;\n // position: absolute;\n // right: 84px;\n // top: 181px;\n border-radius: 6px;\n border: 1px solid rgb(237, 235, 232);\n background: rgb(248, 250, 252);\n margin-bottom: 14px;\n\n .left {\n display: flex;\n padding-right: 10px;\n align-items: center;\n gap: 5px;\n align-self: stretch;\n color: #3a3630;\n font-feature-settings: 'liga' off, 'clig' off;\n font-family: Roboto;\n font-size: 13px;\n font-style: normal;\n font-weight: 500;\n line-height: normal;\n text-transform: uppercase;\n }\n\n .left-end {\n display: flex;\n padding-right: 10px;\n align-items: center;\n gap: 5px;\n align-self: stretch;\n border-right: 1px solid #e2e0db;\n }\n\n .section {\n display: flex;\n align-items: center;\n gap: 30px;\n flex: 1 0 0;\n\n input {\n display: flex;\n height: 28px;\n padding: 3px 10px;\n align-items: center;\n gap: 8px;\n flex: 1 0 0;\n border-radius: 30px;\n border: 1px solid #ccc;\n background: #fff;\n }\n }\n`;\nconst StyleCheckbox = styled(Checkbox)`\n &:disabled {\n background-color: gray;\n cursor: not-allowed;\n opacity: -0.4;\n }\n`;\n\nexport default ReturnProductTable;\n"],"names":["ReturnProductTable","props","selectedProducts","setSelectedProducts","useSelectedProducts","selectAll","setSelectAll","useState","productData","setProductData","useProductDetails","selectedRowId","setSelectedRowId","orderId","useOrderId","returnOrderData","useNewReturnOrderData","isNorthSouth","useIsShowNorthSouth","isClientPortal","useClientPortal","isresponse","callDeleteProduct","useAxios","useEffect","notification","handleRemoveRow","prevData","item","handleSelectAll","allProductIds","product","handleSelectProduct","id","prevSelected","selectedId","deleteProduct","selectedProductId","response","error","disableCheckbox","jsx","StyledTableWrapper","jsxs","StyledTable","StyleCheckbox","Skeleton","EmptyDataContainer","Empty","React","NavLink","displayValueOrNA","service","ActionIcon","NSWrapper","CustomInput","styled","Checkbox"],"mappings":";;;;;;;;;;;;AA+BA,MAAMA,KAAqB,CAACC,MAAiB;AAC3C,QAAM,CAACC,GAAkBC,CAAmB,IAAIC,EAAA,GAC1C,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAaC,CAAc,IAAIC,EAAA,GAChC,CAACC,GAAeC,CAAgB,IAAIL,EAAwB,IAAI,GAChE,CAACM,CAAO,IAAIC,EAAA,GACZ,CAACC,CAAe,IAAIC,EAAA,GACpB,CAACC,CAAY,IAAIC,EAAA,GACjB,CAACC,CAAc,IAAIC,EAAA,GAMnB,EAAE,MAAMC,GAAY,WAAWC,EAAA,IAAsBC,EAExD;AAAA,IACD,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,MAAM,EAAE,yBAAyBZ,GAAe,iBAAiB,CAACE,EAAA;AAAA,EAAQ,CAC3E;AAED,EAAAW,EAAU,MAAM;AACd,IAAIH,KAAcA,EAAW,SAC3BI,EAAa,QAAQ;AAAA,MACnB,SAAS;AAAA,MACT,aAAa;AAAA,IAAA,CACd,GACDC,EAAA,GACAd,EAAiB,IAAI;AAAA,EAEzB,GAAG,CAACS,CAAU,CAAC;AAEf,QAAMK,IAAk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AA,cACZ,OACExB,GAAS,yBACL,qBAAqB;AAAA,cAE3B,UAAQ;AAAA,YAAA;AAAA,UAAA;AAAA,UAGV,gBAAAU;AAAA,YAACc;AAAA,YAAA;AAAA,cACC,OAAM;AAAA,cACN,MAAK;AAAA,cACL,WAAU;AAAA,cACV,aAAY;AAAA,cACZ,OACExB,GAAS,yBACL,uBAAuB;AAAA,cAE7B,UAAQ;AAAA,YAAA;AAAA,UAAA;AAAA,UAGV,gBAAAU;AAAA,YAACc;AAAA,YAAA;AAAA,cACC,OAAM;AAAA,cACN,MAAK;AAAA,cACL,WAAU;AAAA,cACV,aAAY;AAAA,cACZ,OACExB,GAAS,yBACL,mCAAmC;AAAA,cAEzC,UAAQ;AAAA,YAAA;AAAA,UAAA;AAAA,QACV,EAAA,CACF;AAAA,MAAA,EAAA,CACF,EAAA,CACF;AAAA,IAAA,KAtHiBA,EAAQ,EAwH7B,CACD,EAAA,CAEL;AAAA,EAAA,EAAA,CACF,GACF,GACF;AAEJ,GAEauB,IAAYE,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GA0D1BX,IAAgBW,EAAOC,CAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
1
+ {"version":3,"file":"ReturnProductTable.js","sources":["../../../../../src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport {\n StyledTable,\n StyledTableWrapper,\n} from '../../../order-daily-overview/return-order-table/return-orders-filters/returnstyles';\nimport {\n CancelAndCompleteAction,\n CancelationModal,\n Checkbox,\n displayValueOrNA,\n useAxios,\n} from '@bjsdistribution/dms-component-library';\nimport ActionIcon from '../../../../assets/icons/ActionIcon';\nimport { toReverseDeliveryLabel } from '../../../../common/utils';\nimport { useOrderId, useProductDetails } from '../../store';\nimport { ApiResponse } from '../../types';\nimport { Empty, notification, Skeleton, Spin } from 'antd';\nimport {\n useIsShowNorthSouth,\n useNewReturnOrderData,\n useSelectedProducts,\n useClientPortal,\n} from '../../../store';\nimport styled from 'styled-components';\nimport { NavLink } from 'react-router-dom';\nimport { EmptyDataContainer } from '../../order-actions/actions/charge-log';\nimport CustomInput from '../../northern-southern-info/CustomInput';\n\ninterface IPROS {\n callReturnProducts: any;\n loading: boolean;\n locationloading: boolean;\n}\n\nconst ReturnProductTable = (props: IPROS) => {\n const [selectedProducts, setSelectedProducts] = useSelectedProducts();\n const [selectAll, setSelectAll] = useState(false);\n const [productData] = useProductDetails();\n const [orderId] = useOrderId();\n const [returnOrderData] = useNewReturnOrderData();\n const [isNorthSouth] = useIsShowNorthSouth();\n const [isClientPortal] = useClientPortal();\n\n const [productToDelete, setProductToDelete] = useState<number | null>(null);\n const [isDeleteModalOpen, setIsDeleteModalOpen] = useState<boolean>(false);\n\n const { loading: deleteLoading, fetchData: callDeleteProduct } = useAxios<{\n data: ApiResponse[];\n }>({\n endpoint: `v1/return/product/remove/`,\n method: 'POST',\n });\n\n const handleOpenDeleteModal = (id: number) => {\n setProductToDelete(id);\n setIsDeleteModalOpen(true);\n };\n\n const handleConfirmDelete = async () => {\n if (productToDelete === null || deleteLoading) return;\n const targetId = productToDelete;\n try {\n const response = (await callDeleteProduct({\n payload: {\n return_order_product_id: targetId,\n return_order_id: +orderId,\n },\n })) as {\n code: number | null;\n error?: string | null;\n data?: any[];\n message?: string;\n };\n\n if (response?.code === 200) {\n notification.success({\n message: 'Success',\n description: response?.message || 'Product deleted successfully.',\n });\n props?.callReturnProducts();\n setProductToDelete(null);\n setIsDeleteModalOpen(false);\n } else {\n notification.error({\n message: 'Deletion Failed',\n description: response?.message || 'Could not delete the product.',\n });\n }\n } catch (error) {\n console.error('Error deleting product:', error);\n notification.error({\n message: 'Error',\n //@ts-ignore\n description: error?.message || 'An unexpected error occurred.',\n });\n }\n };\n\n const handleCancelDelete = () => {\n if (deleteLoading) return;\n setProductToDelete(null);\n setIsDeleteModalOpen(false);\n };\n\n const handleSelectAll = () => {\n if (selectAll) {\n setSelectedProducts([]);\n } else {\n const allProductIds = productData?.map((product: any) => product.id);\n setSelectedProducts(allProductIds);\n }\n setSelectAll(!selectAll);\n };\n\n const handleSelectProduct = (id: number) => {\n setSelectedProducts((prevSelected: any) =>\n prevSelected.includes(id)\n ? prevSelected.filter((selectedId: any) => selectedId !== id)\n : [...prevSelected, id]\n );\n };\n\n const disableCheckbox =\n productData?.length == 0 || returnOrderData?.length == 0;\n return (\n <div>\n <StyledTableWrapper id=\"tableScrolling\" className=\"orderProductTable\">\n <StyledTable>\n <thead>\n <tr>\n <th className=\"emailproductsCheckbox\">\n <StyleCheckbox\n disabled={disableCheckbox}\n checked={selectAll}\n onChange={handleSelectAll}\n />\n </th>\n <th>Location</th>\n <th>Sender</th>\n <th>Code</th>\n <th>Description</th>\n <th>Return Reason</th>\n {!isClientPortal && <th>Additional Services</th>}\n <th>Part</th>\n <th>Action</th>\n </tr>\n </thead>\n <tbody>\n {props?.loading || props?.locationloading ? (\n <tr>\n <td colSpan={14}>\n <Skeleton active />\n </td>\n </tr>\n ) : productData?.length === 0 ? (\n <tr>\n <td colSpan={14}>\n <EmptyDataContainer>\n <Empty />\n </EmptyDataContainer>\n </td>\n </tr>\n ) : (\n productData?.map((product: any) => (\n <React.Fragment key={product.id}>\n {/* MAIN ROW */}\n <tr className=\"product-row\">\n <td>\n <StyleCheckbox\n checked={selectedProducts?.includes(product?.id)}\n onChange={() => handleSelectProduct(product?.id)}\n disabled={disableCheckbox}\n />\n </td>\n <td>{product?.location || 'N/A'}</td>\n <td>\n <ul style={{ listStyleType: 'none', padding: 0 }}>\n <li\n style={{\n color: '#0099ff',\n fontWeight: 600,\n }}\n >\n <NavLink to={`/orders/view/${product?.order_id}`}>\n {displayValueOrNA(product?.recipient_name)}\n </NavLink>\n </li>\n <li style={{ color: '#888075' }}>\n {displayValueOrNA(product?.postcode)}\n </li>\n </ul>\n </td>\n <td>{product?.code}</td>\n <td>{product?.description}</td>\n <td>\n {isClientPortal\n ? product?.return_reason\n : toReverseDeliveryLabel(product?.return_reason)}\n </td>\n {!isClientPortal && (\n <td>\n {Array.isArray(product?.product_addon_services) && product?.product_addon_services?.length > 0\n ? product.product_addon_services\n .map((service: any) => service?.service_code || service?.name || service)\n .filter(Boolean)\n .join(', ')\n : Array.isArray(product?.addon_services) && product?.addon_services?.length > 0\n ? product.addon_services\n .map((service: any) => service?.service_code || service?.name || service)\n .filter(Boolean)\n .join(', ')\n : Array.isArray(product?.addon_services_list) && product?.addon_services_list?.length > 0\n ? product.addon_services_list.join(', ')\n : typeof product?.addon_services === 'string' && product?.addon_services.trim() !== ''\n ? product.addon_services\n : 'NA'}\n </td>\n )}\n <td>{product?.part}</td>\n <td>\n <div\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n handleOpenDeleteModal(product?.id);\n }}\n style={{ cursor: 'pointer' }}\n >\n <ActionIcon />\n </div>\n </td>\n </tr>\n\n {/* EXPANDED ROW */}\n {isNorthSouth === true && (\n <td colSpan={isClientPortal ? 8 : 9}>\n <NSWrapper>\n <div className=\"left\">Northern/Southern Ireland</div>\n <div className=\"left-end\"></div>\n\n <div className=\"section\">\n <CustomInput\n label=\"Commodity Code\"\n type=\"text\"\n direction=\"row\"\n placeholder=\"Enter Commodity Code\"\n value={\n product?.product_customs_details\n ?.commodity_code || 'NA'\n }\n disabled\n />\n\n <CustomInput\n label=\"Country of Origin\"\n type=\"text\"\n direction=\"row\"\n placeholder=\"Enter Country of Origin\"\n value={\n product?.product_customs_details\n ?.country_of_origin || 'NA'\n }\n disabled\n />\n\n <CustomInput\n label=\"Item Invoice Amount\"\n type=\"number\"\n direction=\"row\"\n placeholder=\"Enter Item Invoice Amount\"\n value={\n product?.product_customs_details\n ?.item_invoice_amount || 0\n }\n disabled\n />\n\n <CustomInput\n label=\"NI Additional Info Codes\"\n type=\"text\"\n direction=\"row\"\n placeholder=\"Enter NI Add Info Codes\"\n value={\n product?.product_customs_details\n ?.ni_additional_information_codes || 'NA'\n }\n disabled\n />\n </div>\n </NSWrapper>\n </td>\n )}\n </React.Fragment>\n ))\n )}\n </tbody>\n </StyledTable>\n </StyledTableWrapper>\n\n {isDeleteModalOpen && (\n <Spin spinning={deleteLoading}>\n <StyledCancelationModal\n title=\"Remove Product\"\n description=\"Are you sure, you want to remove this order product for returns?\"\n actions={\n <CustomCancelAndCompleteAction\n cancelLabel=\"Cancel\"\n onCancel={handleCancelDelete}\n completeLabel={deleteLoading ? 'REMOVING...' : 'Confirm'}\n isDisabled={deleteLoading}\n onComplete={handleConfirmDelete}\n />\n }\n />\n </Spin>\n )}\n </div>\n );\n};\n\nexport const NSWrapper = styled.div`\n display: flex;\n width: 100%;\n padding: 5px 10px;\n align-items: center;\n gap: 10px;\n // position: absolute;\n // right: 84px;\n // top: 181px;\n border-radius: 6px;\n border: 1px solid rgb(237, 235, 232);\n background: rgb(248, 250, 252);\n margin-bottom: 14px;\n\n .left {\n display: flex;\n padding-right: 10px;\n align-items: center;\n gap: 5px;\n align-self: stretch;\n color: #3a3630;\n font-feature-settings: 'liga' off, 'clig' off;\n font-family: Roboto;\n font-size: 13px;\n font-style: normal;\n font-weight: 500;\n line-height: normal;\n text-transform: uppercase;\n }\n\n .left-end {\n display: flex;\n padding-right: 10px;\n align-items: center;\n gap: 5px;\n align-self: stretch;\n border-right: 1px solid #e2e0db;\n }\n\n .section {\n display: flex;\n align-items: center;\n gap: 30px;\n flex: 1 0 0;\n\n input {\n display: flex;\n height: 28px;\n padding: 3px 10px;\n align-items: center;\n gap: 8px;\n flex: 1 0 0;\n border-radius: 30px;\n border: 1px solid #ccc;\n background: #fff;\n }\n }\n`;\nconst StyleCheckbox = styled(Checkbox)`\n &:disabled {\n background-color: gray;\n cursor: not-allowed;\n opacity: -0.4;\n }\n`;\n\nconst StyledCancelationModal = styled(CancelationModal)`\n div {\n & > div > div:first-child {\n padding: 8px !important;\n }\n }\n svg {\n width: 28px !important;\n height: 28px !important;\n }\n`;\n\nconst CustomCancelAndCompleteAction = styled(CancelAndCompleteAction)`\n justify-content: center;\n`;\n\nexport default ReturnProductTable;\n"],"names":["ReturnProductTable","props","selectedProducts","setSelectedProducts","useSelectedProducts","selectAll","setSelectAll","useState","productData","useProductDetails","orderId","useOrderId","returnOrderData","useNewReturnOrderData","isNorthSouth","useIsShowNorthSouth","isClientPortal","useClientPortal","productToDelete","setProductToDelete","isDeleteModalOpen","setIsDeleteModalOpen","deleteLoading","callDeleteProduct","useAxios","handleOpenDeleteModal","id","handleConfirmDelete","targetId","response","notification","error","handleCancelDelete","handleSelectAll","allProductIds","product","handleSelectProduct","prevSelected","selectedId","disableCheckbox","jsx","StyledTableWrapper","StyledTable","StyleCheckbox","Skeleton","EmptyDataContainer","Empty","jsxs","React","NavLink","displayValueOrNA","toReverseDeliveryLabel","service","e","ActionIcon","NSWrapper","CustomInput","Spin","StyledCancelationModal","CustomCancelAndCompleteAction","styled","Checkbox","CancelationModal","CancelAndCompleteAction"],"mappings":";;;;;;;;;;;;;AAkCA,MAAMA,KAAqB,CAACC,MAAiB;AAC3C,QAAM,CAACC,GAAkBC,CAAmB,IAAIC,EAAA,GAC1C,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,CAAW,IAAIC,EAAA,GAChB,CAACC,CAAO,IAAIC,EAAA,GACZ,CAACC,CAAe,IAAIC,EAAA,GACpB,CAACC,CAAY,IAAIC,EAAA,GACjB,CAACC,CAAc,IAAIC,EAAA,GAEnB,CAACC,GAAiBC,CAAkB,IAAIZ,EAAwB,IAAI,GACpE,CAACa,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