@bjsdistribution/dms-client-return 0.0.9 → 0.0.10

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 (47) hide show
  1. package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.d.ts +16 -0
  2. package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.d.ts +1 -0
  3. package/dist/components/store.d.ts +12 -2
  4. package/dist/components/types.d.ts +7 -0
  5. package/dist/dms-client-return.cjs.development.js +692 -425
  6. package/dist/dms-client-return.cjs.development.js.map +1 -1
  7. package/dist/dms-client-return.cjs.production.min.js +1 -1
  8. package/dist/dms-client-return.cjs.production.min.js.map +1 -1
  9. package/dist/dms-client-return.esm.js +693 -426
  10. package/dist/dms-client-return.esm.js.map +1 -1
  11. package/package.json +1 -1
  12. package/src/common/custom-switch/index.tsx +12 -4
  13. package/src/components/order-daily-overview/filters/FilterStyle.tsx +2 -13
  14. package/src/components/order-daily-overview/filters/Filters.tsx +7 -1
  15. package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +1 -1
  16. package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +46 -1
  17. package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +6 -5
  18. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +130 -0
  19. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +143 -63
  20. package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +3 -2
  21. package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +123 -14
  22. package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +1 -1
  23. package/src/components/order-daily-overview/table/ReturnTable.tsx +12 -0
  24. package/src/components/order-view/hooks/useGetEventNotes.tsx +15 -2
  25. package/src/components/order-view/hooks/useGetSystemLogs.tsx +14 -2
  26. package/src/components/order-view/hooks/useUpdateOrder.ts +13 -2
  27. package/src/components/order-view/modalsPopup/CreateReturnModal.tsx +14 -17
  28. package/src/components/order-view/modalsPopup/ModalManager.tsx +90 -62
  29. package/src/components/order-view/notes/AddNote.tsx +7 -2
  30. package/src/components/order-view/order-actions/actions/change-customer-account/ChangeCustomerAccModal.tsx +6 -2
  31. package/src/components/order-view/order-actions/actions/escalation/Dropdowns.tsx +5 -0
  32. package/src/components/order-view/order-actions/actions/escalation/upgrade/index.tsx +7 -1
  33. package/src/components/order-view/order-actions/hooks/useAllReminderData.ts +13 -2
  34. package/src/components/order-view/order-actions/hooks/useAllTaskData.ts +15 -5
  35. package/src/components/order-view/order-actions/hooks/useCreateReminder.ts +20 -4
  36. package/src/components/order-view/order-actions/hooks/useCreateTask.ts +14 -3
  37. package/src/components/order-view/order-actions/hooks/useFetchSingleFlagData.ts +15 -3
  38. package/src/components/order-view/order-actions/hooks/useFetchSingleReminder.ts +13 -2
  39. package/src/components/order-view/order-actions/hooks/useUpdateFlag.ts +12 -2
  40. package/src/components/order-view/order-actions/hooks/useUpdateReminder.ts +12 -2
  41. package/src/components/order-view/products-info/expanded-content/index.tsx +6 -1
  42. package/src/components/order-view/return-client-products/product-table-footer/ProductDetailsFooter.tsx +6 -1
  43. package/src/components/order-view/system-event-logs/expanded-content/index.tsx +7 -1
  44. package/src/components/order-view/view-reminder/AssigneeDropdown.tsx +6 -1
  45. package/src/components/store.ts +30 -1
  46. package/src/components/types.ts +8 -0
  47. package/src/index.tsx +8 -4
@@ -2338,14 +2338,18 @@ function AddNote() {
2338
2338
  description: error || 'Something went wrong. Please try again.'
2339
2339
  });
2340
2340
  }
2341
- _context.next = 18;
2341
+ _context.next = 17;
2342
2342
  break;
2343
2343
  case 14:
2344
2344
  _context.prev = 14;
2345
2345
  _context.t0 = _context["catch"](6);
2346
- console.error('Error saving note:', _context.t0);
2347
- alert('Failed to save note');
2348
- case 18:
2346
+ // console.error('Error saving note:', error);
2347
+ // alert('Failed to save note');
2348
+ antd.notification.error({
2349
+ message: 'Error',
2350
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
2351
+ });
2352
+ case 17:
2349
2353
  case "end":
2350
2354
  return _context.stop();
2351
2355
  }
@@ -2827,8 +2831,11 @@ function useGetEventNotes() {
2827
2831
  case 9:
2828
2832
  _json = _context.sent;
2829
2833
  detail = _json == null ? void 0 : _json.detail;
2830
- msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
2831
- console.error('Error response:', msg);
2834
+ msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // console.error('Error response:', msg);
2835
+ antd.notification.error({
2836
+ message: 'Error',
2837
+ description: "" + msg || 'An error has occurred. Please try again later.'
2838
+ });
2832
2839
  // setLoading(false);
2833
2840
  return _context.abrupt("return", []);
2834
2841
  case 14:
@@ -2846,7 +2853,11 @@ function useGetEventNotes() {
2846
2853
  case 22:
2847
2854
  _context.prev = 22;
2848
2855
  _context.t0 = _context["catch"](1);
2849
- console.error('Error fetching data:', _context.t0);
2856
+ // console.error('Error fetching data:', err);
2857
+ antd.notification.error({
2858
+ message: 'Error',
2859
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
2860
+ });
2850
2861
  return _context.abrupt("return", []);
2851
2862
  case 26:
2852
2863
  _context.prev = 26;
@@ -2893,7 +2904,11 @@ function SystemLogs() {
2893
2904
  case 7:
2894
2905
  _context.prev = 7;
2895
2906
  _context.t0 = _context["catch"](0);
2896
- console.error('Error fetching event notes:', _context.t0);
2907
+ // console.error('Error fetching event notes:', error);
2908
+ antd.notification.error({
2909
+ message: 'Error',
2910
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
2911
+ });
2897
2912
  case 10:
2898
2913
  case "end":
2899
2914
  return _context.stop();
@@ -3138,7 +3153,7 @@ var Section = /*#__PURE__*/styled__default.div(_templateObject$V || (_templateOb
3138
3153
  var _templateObject19, _templateObject20, _templateObject21;
3139
3154
  var StyledTable = /*#__PURE__*/styled__default.table(_templateObject19 || (_templateObject19 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-spacing: 0 10px;\n width: 100%;\n /* min-width: 1600px; */\n thead {\n white-space: nowrap;\n tr {\n border-radius: 40px;\n border-spacing: 0 10px;\n .emailInvoiceCheckbox {\n padding-right: 0px;\n width: 0;\n > div {\n width: fit-content;\n }\n }\n .emailInvoiceNo {\n padding-left: 0px;\n }\n .emailInvoiceShare {\n width: 100px;\n }\n th {\n color: #3a3630;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: normal;\n padding: 11px 15px;\n background: #f0f2f2;\n border-right: none;\n border-left: none;\n text-align: left;\n border: 1px solid rgba(0, 0, 0, 0.08);\n border-width: 1px 0;\n &:first-child {\n border-radius: 100px 0 0 100px;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n }\n &:last-child {\n border-radius: 0px 100px 100px 0;\n border-right: 1px solid rgba(0, 0, 0, 0.08);\n }\n }\n }\n }\n tbody {\n tr {\n td {\n color: #3a3630;\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n padding: 12px 15px;\n background: #fff;\n border: 1px solid rgba(0, 0, 0, 0.08);\n border-right: none;\n border-left: none;\n .actionbox {\n display: flex;\n gap: 5px;\n }\n .shareIconContainer {\n display: flex;\n padding: 2px 12px;\n align-items: center;\n gap: 8px;\n border-radius: 20px;\n border: 1px solid var(--tonal-brown-101, #e2e0db);\n background: #fff;\n list-style-type: none;\n /* padding-left: 0; */\n /* fontWeight: 600,\n paddingLeft: 0, */\n cursor: pointer;\n position: relative;\n }\n .statusCancelled {\n color: #e95252;\n /* background: rgba(233, 82, 82, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusOnHold {\n color: #f4a503;\n /* background: #fff1d6; */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusSubContracted {\n color: #845adf;\n /* background: rgba(132, 90, 223, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusAwaiting {\n color: #845adf;\n /* background: rgba(132, 90, 223, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusCompleted {\n color: #1f9254;\n /* background: rgba(41, 204, 106, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusOutstanding {\n color: #f4a503;\n /* background: #fff1d6; */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusUnknown {\n color: #000;\n /* background: #fff; */\n padding: 4px 8px;\n border-radius: 4px;\n }\n .statustext {\n color: #1f9254;\n font-family: 'Open Sans';\n font-size: 12px;\n font-style: normal;\n font-weight: 600;\n line-height: normal;\n }\n .downloadcontainer {\n display: flex;\n padding: 2px 12px;\n align-items: center;\n\n width: 28px;\n height: 28px;\n flex-direction: column;\n\n border-radius: 14px;\n border: 1px solid #e2e0db;\n background: #fff;\n }\n .statuscontainer {\n display: flex;\n padding: 5px 30px 5px 30px;\n justify-content: center;\n align-items: center;\n gap: 5px;\n flex: 1 0 0;\n border-radius: 22px;\n background: rgba(41, 204, 106, 0.15);\n }\n ul > li > a {\n text-decoration: none !important;\n color: #0099ff;\n }\n }\n &:nth-child(even) td {\n background: #f6fbff;\n }\n td:first-child {\n border-radius: 100px 0 0 100px;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n }\n td:last-child {\n border-radius: 0px 100px 100px 0;\n border-right: 1px solid rgba(0, 0, 0, 0.08);\n }\n .flex {\n display: flex;\n flex-direction: row;\n gap: 5px;\n height: 29px;\n align-items: center;\n }\n\n &.insideTable {\n td {\n border-radius: 0;\n border: none;\n &:last-child {\n border-radius: 0;\n border-right: none;\n }\n }\n table {\n border-spacing: 0;\n width: 100%;\n border-radius: 5px;\n border: 1px solid rgba(0, 0, 0, 0.08);\n overflow: hidden;\n border-top-left-radius: 15px;\n border-top-right-radius: 15px;\n thead {\n tr {\n border-bottom: none;\n th {\n padding: 14px 20px;\n text-align: left;\n border-top: 0;\n border-right: 0;\n border-left: 0;\n background: #f8fafc;\n\n &:first-child {\n border-radius: 0;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n border-top-left-radius: 15px;\n }\n &:last-child {\n border-radius: 0;\n }\n }\n }\n }\n tbody {\n tr {\n td {\n padding: 14px 20px;\n text-align: left;\n border-bottom: 1px solid rgba(58, 54, 48, 0.15);\n background: #fff;\n > svg {\n transform: scale(1.5);\n background-color: #edebe8;\n border-radius: 20px;\n padding: 5px;\n }\n &:last-child {\n border-radius: 0;\n border-right: none;\n }\n }\n }\n }\n }\n }\n }\n }\n .actions {\n display: flex;\n align-items: center;\n gap: 20px;\n > svg {\n transform: scale(1.5);\n background-color: #edebe8;\n border-radius: 20px;\n padding: 5px;\n }\n\n .close-icon {\n transform: scale(1.3);\n background-color: transparent;\n border-radius: 0;\n padding: 0;\n }\n }\n"])));
3140
3155
  // Styled components
3141
- var StyledTableWrapper = /*#__PURE__*/styled__default.div(_templateObject20 || (_templateObject20 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n overflow-x: auto;\n max-height: calc(100vh - 396px);\n scrollbar-width: none;\n height: 400px;\n /* box-shadow: 0px 0px 30px 6px rgba(46, 45, 116, 0.05); */\n &::-webkit-scrollbar {\n width: 5px;\n border-radius: 100px;\n height: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background: #777;\n border-radius: 100px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: #7b61ff;\n border-radius: 100px;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: #7b61ff;\n }\n"])));
3156
+ var StyledTableWrapper = /*#__PURE__*/styled__default.div(_templateObject20 || (_templateObject20 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n overflow-x: auto;\n max-height: calc(100vh - 396px);\n scrollbar-width: none;\n height: 600px;\n /* box-shadow: 0px 0px 30px 6px rgba(46, 45, 116, 0.05); */\n &::-webkit-scrollbar {\n width: 5px;\n border-radius: 100px;\n height: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background: #777;\n border-radius: 100px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: #7b61ff;\n border-radius: 100px;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: #7b61ff;\n }\n"])));
3142
3157
  var CustomDrop = /*#__PURE__*/styled__default.div(_templateObject21 || (_templateObject21 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* border-radius: 20px;\n border: 1px solid #e2e0db;\n background: #fff;\n display: flex;\n padding: 4px 8px;\n gap: 8px;\n align-items: center; */\n cursor: pointer;\n &.active .drop {\n transform: rotate(180deg);\n }\n"])));
3143
3158
 
3144
3159
  var ActionIcon = function ActionIcon() {
@@ -3158,9 +3173,19 @@ var ActionIcon = function ActionIcon() {
3158
3173
  }));
3159
3174
  };
3160
3175
 
3176
+ var CreateReturnInitial = {
3177
+ customer_id: 0,
3178
+ account_number: '',
3179
+ return_location_token: '',
3180
+ products: [],
3181
+ return_action: []
3182
+ };
3161
3183
  var customerData = /*#__PURE__*/jotai.atom([]);
3162
3184
  var actionTypeData = /*#__PURE__*/jotai.atom([]);
3163
3185
  var locationData = /*#__PURE__*/jotai.atom([]);
3186
+ var createReturnPayload = /*#__PURE__*/jotai.atom(CreateReturnInitial);
3187
+ var newPayload = /*#__PURE__*/jotai.atom([]);
3188
+ var grpPayload = /*#__PURE__*/jotai.atom([]);
3164
3189
  var selectedOrderlList = /*#__PURE__*/jotai.atom([]);
3165
3190
  function useSelectedOrders() {
3166
3191
  return jotai.useAtom(selectedOrderlList);
@@ -3179,6 +3204,15 @@ function useActionType() {
3179
3204
  function useLocationData() {
3180
3205
  return jotai.useAtom(locationData);
3181
3206
  }
3207
+ function useReturnPayload() {
3208
+ return jotai.useAtom(createReturnPayload);
3209
+ }
3210
+ function useNewReturnPayload() {
3211
+ return jotai.useAtom(newPayload);
3212
+ }
3213
+ function useGroupedPayload() {
3214
+ return jotai.useAtom(grpPayload);
3215
+ }
3182
3216
 
3183
3217
  var ReturnProductTable = function ReturnProductTable() {
3184
3218
  var _useSelectedOrders = useSelectedOrders(),
@@ -3227,7 +3261,11 @@ var Container$B = /*#__PURE__*/styled__default.div(_templateObject$W || (_templa
3227
3261
  var _templateObject$X, _templateObject2$C, _templateObject3$k;
3228
3262
  function ExpandedContent$2() {
3229
3263
  var SaveNote = function SaveNote() {
3230
- alert('saved');
3264
+ // alert('saved');
3265
+ antd.notification.success({
3266
+ message: 'Success',
3267
+ description: ' Saved successfully.'
3268
+ });
3231
3269
  };
3232
3270
  return React__default.createElement(Container$C, null, React__default.createElement(ProductTable, null), React__default.createElement(MidConatiner, null, React__default.createElement(SaveNoteContainer$1, null, React__default.createElement(dmsComponentLibrary.Button, {
3233
3271
  style: {
@@ -4778,7 +4816,11 @@ function ChangeCustomerAccModal() {
4778
4816
  setCurrentAction(undefined);
4779
4817
  };
4780
4818
  var handleSelectChange = function handleSelectChange() {
4781
- alert('hello');
4819
+ // alert('hello');
4820
+ antd.notification.success({
4821
+ message: 'Success',
4822
+ description: 'Saved successfully.'
4823
+ });
4782
4824
  };
4783
4825
  return React__default.createElement(OrderActionModal, {
4784
4826
  headerTitle: "Change customer account",
@@ -4908,6 +4950,10 @@ var StyledAntSelect = /*#__PURE__*/styled__default(dmsComponentLibrary.AntSelect
4908
4950
  var Dropdowns = function Dropdowns() {
4909
4951
  var handleSelectChange = function handleSelectChange() {
4910
4952
  // alert('hello');
4953
+ antd.notification.success({
4954
+ message: 'Success',
4955
+ description: 'Saved successfully.'
4956
+ });
4911
4957
  };
4912
4958
  return React__default.createElement(FlexContainer, null, React__default.createElement(InnerCont, null, React__default.createElement(dmsComponentLibrary.Label, {
4913
4959
  label: "Escalation Category",
@@ -4981,7 +5027,11 @@ var Notes$2 = function Notes() {
4981
5027
  var _templateObject$1w, _templateObject2$14, _templateObject3$z, _templateObject4$i, _templateObject5$a, _templateObject6$8, _templateObject7$7, _templateObject8$4, _templateObject9$2, _templateObject10$1;
4982
5028
  var Upgrade = function Upgrade() {
4983
5029
  var handleSelectChange = function handleSelectChange() {
4984
- alert('hello');
5030
+ // alert('hello');
5031
+ antd.notification.success({
5032
+ message: 'Success',
5033
+ description: 'Upgrade successfully.'
5034
+ });
4985
5035
  };
4986
5036
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(Wrapper$g, null, React__default.createElement(Heading$2, null, "Upgrade"), React__default.createElement(Container$_, null, React__default.createElement(Top$3, null, React__default.createElement(InnerCont$1, null, React__default.createElement(Toggle, {
4987
5037
  label: 'Timed Service',
@@ -5543,7 +5593,11 @@ var RestoreProducts = function RestoreProducts() {
5543
5593
  var _templateObject$1B, _templateObject2$17;
5544
5594
  function AssigneeDropdown() {
5545
5595
  var handleSelectChange = function handleSelectChange() {
5546
- alert('hello');
5596
+ // alert('hello');
5597
+ antd.notification.success({
5598
+ message: 'Success',
5599
+ description: 'Order has been saved successfully.'
5600
+ });
5547
5601
  };
5548
5602
  return React__default.createElement(FormContainer$2, null, React__default.createElement(dmsComponentLibrary.Label, {
5549
5603
  label: "Assigned To",
@@ -5763,8 +5817,11 @@ function useFetchSingleReminderData() {
5763
5817
  case 10:
5764
5818
  _json = _context.sent;
5765
5819
  detail = _json == null ? void 0 : _json.detail;
5766
- msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
5767
- alert("" + msg);
5820
+ msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // alert(`${msg}`);
5821
+ antd.notification.error({
5822
+ message: 'Error',
5823
+ description: "" + msg || 'An error has occurred. Please try again later.'
5824
+ });
5768
5825
  setLoading(false);
5769
5826
  return _context.abrupt("return", []);
5770
5827
  case 16:
@@ -5784,7 +5841,11 @@ function useFetchSingleReminderData() {
5784
5841
  _context.prev = 25;
5785
5842
  _context.t0 = _context["catch"](2);
5786
5843
  //setloading(false);
5787
- console.error('Error fetching data:', _context.t0);
5844
+ // console.error('Error fetching data:', err);
5845
+ antd.notification.error({
5846
+ message: 'Error',
5847
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
5848
+ });
5788
5849
  return _context.abrupt("return", []);
5789
5850
  case 29:
5790
5851
  case "end":
@@ -5871,12 +5932,20 @@ function useUpdateReminder() {
5871
5932
  return response.json();
5872
5933
  case 11:
5873
5934
  json = _context.sent;
5874
- alert('Reminder has been updated');
5935
+ // alert('Reminder has been updated');
5936
+ antd.notification.success({
5937
+ message: 'Success',
5938
+ description: 'Reminder has been updated'
5939
+ });
5875
5940
  return _context.abrupt("return", json);
5876
5941
  case 16:
5877
5942
  _context.prev = 16;
5878
5943
  _context.t0 = _context["catch"](2);
5879
- console.error('Error:', _context.t0);
5944
+ // console.error('Error:', err);
5945
+ antd.notification.error({
5946
+ message: 'Error',
5947
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
5948
+ });
5880
5949
  case 19:
5881
5950
  _context.prev = 19;
5882
5951
  setLoading(false);
@@ -5940,8 +6009,11 @@ function useFetchReminders() {
5940
6009
  case 9:
5941
6010
  _json = _context.sent;
5942
6011
  detail = _json == null ? void 0 : _json.detail;
5943
- msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
5944
- console.error('Error response:', msg);
6012
+ msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // console.error('Error response:', msg);
6013
+ antd.notification.error({
6014
+ message: 'Error',
6015
+ description: "" + msg || 'An error has occurred. Please try again later.'
6016
+ });
5945
6017
  // setLoading(false);
5946
6018
  return _context.abrupt("return", []);
5947
6019
  case 14:
@@ -5961,7 +6033,11 @@ function useFetchReminders() {
5961
6033
  case 23:
5962
6034
  _context.prev = 23;
5963
6035
  _context.t0 = _context["catch"](1);
5964
- console.error('Error fetching data:', _context.t0);
6036
+ // console.error('Error fetching data:', err);
6037
+ antd.notification.error({
6038
+ message: 'Error',
6039
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
6040
+ });
5965
6041
  return _context.abrupt("return", []);
5966
6042
  case 27:
5967
6043
  _context.prev = 27;
@@ -6224,7 +6300,14 @@ var CustomSwitchSelector = function CustomSwitchSelector(_ref) {
6224
6300
  if (typeof selectedOptionValue === 'string') {
6225
6301
  onSwitchChange(selectedOptionValue);
6226
6302
  } else {
6227
- console.error('Unexpected type for selectedOptionValue:', typeof selectedOptionValue);
6303
+ // console.error(
6304
+ // 'Unexpected type for selectedOptionValue:',
6305
+ // typeof selectedOptionValue
6306
+ // );
6307
+ antd.notification.error({
6308
+ message: 'Error',
6309
+ description: "" + typeof selectedOptionValue || 'Unexpected type for selectedOptionValue.'
6310
+ });
6228
6311
  }
6229
6312
  };
6230
6313
  return React__default.createElement(StyledSwitch, null, React__default.createElement(SwitchSelector, {
@@ -6674,7 +6757,11 @@ function useCreateTask() {
6674
6757
  setLoading(false);
6675
6758
  throw new Error('response is not ok');
6676
6759
  case 10:
6677
- alert('Task Created Successfully');
6760
+ // alert('Task Created Successfully');
6761
+ antd.notification.success({
6762
+ message: 'Success',
6763
+ description: 'Task Created Successfully'
6764
+ });
6678
6765
  _context.next = 13;
6679
6766
  return response.json();
6680
6767
  case 13:
@@ -6684,19 +6771,23 @@ function useCreateTask() {
6684
6771
  _context.prev = 17;
6685
6772
  _context.t0 = _context["catch"](2);
6686
6773
  setLoading(false);
6687
- alert(_context.t0);
6688
- console.error('Error:', _context.t0);
6689
- case 22:
6690
- _context.prev = 22;
6774
+ // alert(err);
6775
+ // console.error('Error:', err);
6776
+ antd.notification.error({
6777
+ message: 'Error',
6778
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
6779
+ });
6780
+ case 21:
6781
+ _context.prev = 21;
6691
6782
  setLoading(false);
6692
- return _context.finish(22);
6693
- case 25:
6783
+ return _context.finish(21);
6784
+ case 24:
6694
6785
  setLoading(false);
6695
- case 26:
6786
+ case 25:
6696
6787
  case "end":
6697
6788
  return _context.stop();
6698
6789
  }
6699
- }, _callee, null, [[2, 17, 22, 25]]);
6790
+ }, _callee, null, [[2, 17, 21, 24]]);
6700
6791
  }));
6701
6792
  return function create(_x) {
6702
6793
  return _ref.apply(this, arguments);
@@ -6734,9 +6825,17 @@ function useCreateReminder() {
6734
6825
  response = _context.sent;
6735
6826
  if (!response.ok) {
6736
6827
  setLoading(false);
6737
- alert('response is not ok');
6828
+ // alert('response is not ok');
6829
+ antd.notification.error({
6830
+ message: 'Error',
6831
+ description: 'response is not ok'
6832
+ });
6738
6833
  }
6739
- alert('Reminder Created Successfully');
6834
+ // alert('Reminder Created Successfully');
6835
+ antd.notification.success({
6836
+ message: 'Success',
6837
+ description: 'Reminder Created Successfully'
6838
+ });
6740
6839
  _context.next = 11;
6741
6840
  return response.json();
6742
6841
  case 11:
@@ -6746,19 +6845,23 @@ function useCreateReminder() {
6746
6845
  _context.prev = 15;
6747
6846
  _context.t0 = _context["catch"](2);
6748
6847
  setLoading(false);
6749
- alert(_context.t0);
6750
- console.error('Error:', _context.t0);
6751
- case 20:
6752
- _context.prev = 20;
6848
+ // alert(err);
6849
+ // console.error('Error:', err);
6850
+ antd.notification.error({
6851
+ message: 'Error',
6852
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
6853
+ });
6854
+ case 19:
6855
+ _context.prev = 19;
6753
6856
  setLoading(false);
6754
- return _context.finish(20);
6755
- case 23:
6857
+ return _context.finish(19);
6858
+ case 22:
6756
6859
  setLoading(false);
6757
- case 24:
6860
+ case 23:
6758
6861
  case "end":
6759
6862
  return _context.stop();
6760
6863
  }
6761
- }, _callee, null, [[2, 15, 20, 23]]);
6864
+ }, _callee, null, [[2, 15, 19, 22]]);
6762
6865
  }));
6763
6866
  return function create(_x) {
6764
6867
  return _ref.apply(this, arguments);
@@ -6813,8 +6916,11 @@ function useFetchUnresolvedTasks() {
6813
6916
  case 9:
6814
6917
  _json = _context.sent;
6815
6918
  detail = _json == null ? void 0 : _json.detail;
6816
- msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
6817
- console.error('Error response:', msg);
6919
+ msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // console.error('Error response:', msg);
6920
+ antd.notification.error({
6921
+ message: 'Error',
6922
+ description: "" + msg || 'An error has occurred. Please try again later.'
6923
+ });
6818
6924
  setLoading(false);
6819
6925
  return _context.abrupt("return", []);
6820
6926
  case 15:
@@ -6834,7 +6940,11 @@ function useFetchUnresolvedTasks() {
6834
6940
  case 25:
6835
6941
  _context.prev = 25;
6836
6942
  _context.t0 = _context["catch"](1);
6837
- console.error('Error fetching data:', _context.t0);
6943
+ // console.error('Error fetching data:', err);
6944
+ antd.notification.error({
6945
+ message: 'Error',
6946
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
6947
+ });
6838
6948
  setLoading(false);
6839
6949
  return _context.abrupt("return", []);
6840
6950
  case 30:
@@ -7066,13 +7176,21 @@ function useUpdateOrder() {
7066
7176
  return response.json();
7067
7177
  case 13:
7068
7178
  json = _context.sent;
7069
- alert('Order has been updated');
7179
+ // alert('Order has been updated');
7180
+ antd.notification.success({
7181
+ message: 'Success',
7182
+ description: 'Order has been updated.'
7183
+ });
7070
7184
  return _context.abrupt("return", json);
7071
7185
  case 18:
7072
7186
  _context.prev = 18;
7073
7187
  _context.t0 = _context["catch"](4);
7074
7188
  // setLoading(false);
7075
- console.log(_context.t0, 'error');
7189
+ // console.log(err, 'error');
7190
+ antd.notification.error({
7191
+ message: 'Error',
7192
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
7193
+ });
7076
7194
  case 21:
7077
7195
  _context.prev = 21;
7078
7196
  return _context.finish(21);
@@ -7180,12 +7298,20 @@ function useUpdateFlag() {
7180
7298
  return response.json();
7181
7299
  case 11:
7182
7300
  json = _context.sent;
7183
- alert('Flag has been updated');
7301
+ // alert('Flag has been updated');
7302
+ antd.notification.success({
7303
+ message: 'Success',
7304
+ description: 'Flag has been updated'
7305
+ });
7184
7306
  return _context.abrupt("return", json);
7185
7307
  case 16:
7186
7308
  _context.prev = 16;
7187
7309
  _context.t0 = _context["catch"](2);
7188
- console.error('Error:', _context.t0);
7310
+ // console.error('Error:', err);
7311
+ antd.notification.error({
7312
+ message: 'Error',
7313
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
7314
+ });
7189
7315
  case 19:
7190
7316
  _context.prev = 19;
7191
7317
  setLoading(false);
@@ -7517,7 +7643,7 @@ function useFetchSingleFlagsData() {
7517
7643
  loading = _useFlagsLoading[0],
7518
7644
  setLoading = _useFlagsLoading[1];
7519
7645
  var ssoToken = getCookie('id_token');
7520
- console.log(loading, "loading loading");
7646
+ console.log(loading, 'loading loading');
7521
7647
  var res = /*#__PURE__*/function () {
7522
7648
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
7523
7649
  var endpoint, headers, response, _detail$, _json, detail, msg, json;
@@ -7547,8 +7673,11 @@ function useFetchSingleFlagsData() {
7547
7673
  case 9:
7548
7674
  _json = _context.sent;
7549
7675
  detail = _json == null ? void 0 : _json.detail;
7550
- msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
7551
- alert("" + msg);
7676
+ msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // alert(`${msg}`);
7677
+ antd.notification.error({
7678
+ message: 'Error',
7679
+ description: "" + msg || 'An error has occurred. Please try again later.'
7680
+ });
7552
7681
  setLoading(false);
7553
7682
  return _context.abrupt("return", []);
7554
7683
  case 15:
@@ -7568,7 +7697,11 @@ function useFetchSingleFlagsData() {
7568
7697
  _context.prev = 24;
7569
7698
  _context.t0 = _context["catch"](1);
7570
7699
  setLoading(false);
7571
- console.error('Error fetching data:', _context.t0);
7700
+ // console.error('Error fetching data:', err);
7701
+ antd.notification.error({
7702
+ message: 'Error',
7703
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
7704
+ });
7572
7705
  return _context.abrupt("return", []);
7573
7706
  case 29:
7574
7707
  case "end":
@@ -7856,8 +7989,11 @@ function useSystemLogs() {
7856
7989
  case 9:
7857
7990
  _json = _context.sent;
7858
7991
  detail = _json == null ? void 0 : _json.detail;
7859
- msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
7860
- console.error('Error response:', msg);
7992
+ msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // console.error('Error response:', msg);
7993
+ antd.notification.error({
7994
+ message: 'Error',
7995
+ description: "" + msg || 'An error has occurred. Please try again later.'
7996
+ });
7861
7997
  // setLoading(false);
7862
7998
  return _context.abrupt("return", []);
7863
7999
  case 14:
@@ -7877,7 +8013,11 @@ function useSystemLogs() {
7877
8013
  case 23:
7878
8014
  _context.prev = 23;
7879
8015
  _context.t0 = _context["catch"](1);
7880
- console.error('Error fetching data:', _context.t0);
8016
+ // console.error('Error fetching data:', err);
8017
+ antd.notification.error({
8018
+ message: 'Error',
8019
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
8020
+ });
7881
8021
  return _context.abrupt("return", []);
7882
8022
  case 27:
7883
8023
  _context.prev = 27;
@@ -8193,6 +8333,16 @@ function SelectionFilter() {
8193
8333
  var _useState4 = React.useState(false),
8194
8334
  isButtonEnabled = _useState4[0],
8195
8335
  setIsButtonEnabled = _useState4[1];
8336
+ var _useReturnPayload = useReturnPayload(),
8337
+ setReturnPayload = _useReturnPayload[1];
8338
+ var _useState5 = React.useState(),
8339
+ storedAccNumber = _useState5[0],
8340
+ setStoredAccNumber = _useState5[1];
8341
+ var _useState6 = React.useState(),
8342
+ storedCustomerId = _useState6[0],
8343
+ setStoredCustomerId = _useState6[1];
8344
+ var _useNewReturnPayload = useNewReturnPayload(),
8345
+ setNewPayload = _useNewReturnPayload[1];
8196
8346
  //client options
8197
8347
  var clientOptions = customers == null ? void 0 : customers.map(function (option) {
8198
8348
  var _option$customer_name, _option$customer_name2;
@@ -8200,7 +8350,9 @@ function SelectionFilter() {
8200
8350
  label: (option == null || (_option$customer_name = option.customer_name) == null || (_option$customer_name = _option$customer_name.charAt(0)) == null ? void 0 : _option$customer_name.toUpperCase()) + (option == null || (_option$customer_name2 = option.customer_name) == null ? void 0 : _option$customer_name2.slice(1)),
8201
8351
  value: (option == null ? void 0 : option.id) + "_" + (option == null ? void 0 : option.uuid),
8202
8352
  id: option == null ? void 0 : option.id,
8203
- uuid: option == null ? void 0 : option.uuid
8353
+ uuid: option == null ? void 0 : option.uuid,
8354
+ account_number: option == null ? void 0 : option.account_number,
8355
+ gsit_customer_id: option == null ? void 0 : option.gsit_customer_id
8204
8356
  };
8205
8357
  });
8206
8358
  var actionTypeOptions = actionType == null ? void 0 : actionType.map(function (option) {
@@ -8218,14 +8370,28 @@ function SelectionFilter() {
8218
8370
  });
8219
8371
  //client change
8220
8372
  var handleSelectChange = function handleSelectChange(value, option) {
8373
+ setNewPayload([]);
8221
8374
  console.log(value, 'value');
8222
8375
  var selectedLabel = option == null ? void 0 : option.label;
8223
8376
  var selectedValue = option == null ? void 0 : option.id;
8224
8377
  var selectedUuids = option == null ? void 0 : option.uuid;
8378
+ var selectAccountNumber = option.account_number;
8379
+ var selectedCustomerId = option.gsit_customer_id;
8225
8380
  setSelectedClient(selectedValue);
8226
8381
  setName(selectedLabel);
8227
8382
  localStorage.setItem('clientName', selectedLabel);
8228
8383
  localStorage.setItem('clientId', selectedValue.toString());
8384
+ localStorage.setItem('account_number', selectAccountNumber);
8385
+ localStorage.setItem('customer_id', selectedCustomerId.toString());
8386
+ var storedAccNo = localStorage.getItem('account_number');
8387
+ var storedCustomerId = localStorage.getItem('customer_id');
8388
+ setReturnPayload(function (prevState) {
8389
+ return _extends({}, prevState, {
8390
+ account_number: storedAccNo,
8391
+ customer_id: storedCustomerId
8392
+ });
8393
+ });
8394
+ console.log(selectedUuids, 'selectedUuids');
8229
8395
  var filteredSubLocations = locationData == null ? void 0 : locationData.filter(function (subCat) {
8230
8396
  return (subCat == null ? void 0 : subCat.customer_id) === selectedUuids;
8231
8397
  }).map(function (subCat) {
@@ -8237,6 +8403,24 @@ function SelectionFilter() {
8237
8403
  setFilteredLocationOptions(filteredSubLocations);
8238
8404
  setUuid('');
8239
8405
  };
8406
+ React.useEffect(function () {
8407
+ var accountNumberFromStorage = localStorage.getItem('account_number');
8408
+ var customerIdFromStorage = localStorage.getItem('customer_id');
8409
+ if (accountNumberFromStorage) {
8410
+ setStoredAccNumber(accountNumberFromStorage);
8411
+ }
8412
+ if (customerIdFromStorage) {
8413
+ setStoredCustomerId(customerIdFromStorage);
8414
+ }
8415
+ if (storedAccNumber && storedCustomerId) {
8416
+ setReturnPayload(function (prevState) {
8417
+ return _extends({}, prevState, {
8418
+ account_number: storedAccNumber,
8419
+ customer_id: storedCustomerId
8420
+ });
8421
+ });
8422
+ }
8423
+ }, [storedAccNumber, storedCustomerId]);
8240
8424
  React.useEffect(function () {}, [getUuid, filteredLocationOptions]);
8241
8425
  //location change
8242
8426
  var handleLocationChange = function handleLocationChange(value, option) {
@@ -8301,6 +8485,7 @@ function SelectionFilter() {
8301
8485
  setIsButtonEnabled(false);
8302
8486
  }
8303
8487
  }, [storedName, selectedFilterValue, selectedLocationValue]);
8488
+ console.log(filteredLocationOptions, 'filteredLocationOptions');
8304
8489
  console.log('check', storedName, selectedFilterValue, selectedLocationValue);
8305
8490
  return React__default.createElement(Wrapper$k, null, React__default.createElement(FilterRow, null, React__default.createElement(LeftColumn, null, React__default.createElement(FilterColumn, null, React__default.createElement(Label$g, null, "Clients"), React__default.createElement(StyledAntSelect$5, {
8306
8491
  options: clientOptions,
@@ -8385,7 +8570,7 @@ function HeaderFilter() {
8385
8570
  if (fetchedStaticData && fetchedStaticData != null && fetchedStaticData.data) {
8386
8571
  var _fetchedStaticData$da;
8387
8572
  setActionType(fetchedStaticData == null || (_fetchedStaticData$da = fetchedStaticData.data) == null ? void 0 : _fetchedStaticData$da.flatMap(function (i) {
8388
- return i.order_contact_action_type;
8573
+ return i == null ? void 0 : i.order_product_return_action;
8389
8574
  }));
8390
8575
  }
8391
8576
  }, [actionLoading, fetchedStaticData]);
@@ -8399,7 +8584,7 @@ function HeaderFilter() {
8399
8584
 
8400
8585
  var _templateObject$1$, _templateObject4$v, _templateObject5$k, _templateObject7$d, _templateObject8$8;
8401
8586
  //Left side
8402
- var LeftSideConatiner = /*#__PURE__*/styled__default.div(_templateObject$1$ || (_templateObject$1$ = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 1px 5px 1px 1.1px;\n align-items: center;\n gap: 10px;\n border-radius: 40px;\n border: 1px solid rgba(0, 0, 0, 0.08);\n background: var(--Flowkit-White, #fff);\n\n .filtercontainer {\n display: flex;\n padding: 8px 8px 8px 4px;\n align-items: center;\n gap: 4px;\n align-self: stretch;\n border-radius: 20px 0px 0px 20px;\n border-right: 1px solid rgba(0, 0, 0, 0.04);\n background: var(--BjsColor-Bg-F0F2F2, #f0f2f2);\n\n .filtericon {\n display: flex;\n padding: 7px 0px 5px 5px;\n align-items: flex-start;\n gap: 10px;\n border-radius: 30px;\n }\n .textcont {\n color: #758588;\n text-align: center;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: normal;\n }\n }\n .datefilter {\n display: flex;\n height: 36px;\n padding: 6px 8px;\n justify-content: center;\n align-items: center;\n gap: 8px;\n border-radius: 20px;\n border: 1px solid var(--tonal-brown-10, #edebe8);\n\n .dateiconcontainer {\n display: flex;\n width: 24px;\n height: 24px;\n padding: 5px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n border-radius: 20px;\n border: 1px solid var(--tonal-brown-101, #e2e0db);\n background: #f1f5f6;\n }\n .datetext {\n color: #6a7378;\n\n /* body/captions */\n font-family: 'Lato';\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px; /* 123.077% */\n }\n .roundbox {\n display: flex;\n width: 18px;\n height: 18px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n border-radius: 18px;\n background: #fff;\n box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1);\n }\n }\n"])));
8587
+ var LeftSideConatiner = /*#__PURE__*/styled__default.div(_templateObject$1$ || (_templateObject$1$ = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 1px 5px 1px 1.1px;\n align-items: center;\n gap: 10px;\n border-radius: 40px;\n border: 1px solid rgba(0, 0, 0, 0.08);\n background: var(--Flowkit-White, #fff);\n\n .filtercontainer {\n display: flex;\n padding: 8px 8px 8px 4px;\n align-items: center;\n gap: 4px;\n align-self: stretch;\n border-radius: 20px 0px 0px 20px;\n border-right: 1px solid rgba(0, 0, 0, 0.04);\n background: var(--BjsColor-Bg-F0F2F2, #f0f2f2);\n\n .filtericon {\n display: flex;\n padding: 7px 0px 5px 5px;\n align-items: flex-start;\n gap: 10px;\n border-radius: 30px;\n }\n .textcont {\n color: #758588;\n text-align: center;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: normal;\n }\n }\n .datefilter {\n display: flex;\n height: 36px;\n padding: 6px 8px;\n justify-content: center;\n align-items: center;\n gap: 2px;\n border-radius: 20px;\n border: 1px solid #edebe8;\n\n .dateiconcontainer {\n display: flex;\n width: 24px;\n height: 24px;\n padding: 5px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n border-radius: 20px;\n border: 1px solid var(--tonal-brown-101, #e2e0db);\n background: #f1f5f6;\n }\n .datetext {\n color: #6a7378;\n\n /* body/captions */\n font-family: 'Lato';\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px; /* 123.077% */\n }\n }\n"])));
8403
8588
  //
8404
8589
  var StyledFiter = /*#__PURE__*/styled__default.div(_templateObject4$v || (_templateObject4$v = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
8405
8590
  var StyledFIlterELements = /*#__PURE__*/styled__default.div(_templateObject5$k || (_templateObject5$k = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 0;\n gap: 10px;\n align-items: center;\n"])));
@@ -8469,8 +8654,8 @@ var IconText = /*#__PURE__*/styled__default.div(_templateObject5$l || (_template
8469
8654
 
8470
8655
  var ReturnFilter = function ReturnFilter() {
8471
8656
  var _useParams = reactRouterDom.useParams(),
8472
- selectedClient = _useParams.selectedClient;
8473
- return React__default.createElement(React__default.Fragment, null, React__default.createElement(StyledFiter, null, React__default.createElement(Text$7, null, " ", selectedClient), React__default.createElement(StyledFIlterELements, null, React__default.createElement(StyledTableFilter, null)), React__default.createElement(RightFilters, null)));
8657
+ clientName = _useParams.clientName;
8658
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(StyledFiter, null, React__default.createElement(Text$7, null, " ", clientName), React__default.createElement(StyledFIlterELements, null, React__default.createElement(StyledTableFilter, null)), React__default.createElement(RightFilters, null)));
8474
8659
  };
8475
8660
 
8476
8661
  var _templateObject$22, _templateObject2$1s, _templateObject3$P, _templateObject4$x, _templateObject34;
@@ -8689,6 +8874,14 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
8689
8874
  var _usePrintOptionTOggle = usePrintOptionTOggle(),
8690
8875
  printToogle = _usePrintOptionTOggle[0],
8691
8876
  setPrintToggle = _usePrintOptionTOggle[1];
8877
+ var _useReturnPayload = useReturnPayload(),
8878
+ createReturn = _useReturnPayload[0],
8879
+ setReturnPayload = _useReturnPayload[1];
8880
+ var _useNewReturnPayload = useNewReturnPayload(),
8881
+ newpayload = _useNewReturnPayload[0],
8882
+ setNewPayload = _useNewReturnPayload[1];
8883
+ var _useGroupedPayload = useGroupedPayload(),
8884
+ setGrouped = _useGroupedPayload[1];
8692
8885
  var OpenDropDown = function OpenDropDown(index) {
8693
8886
  setPrintToggle(function (prevIndex) {
8694
8887
  return prevIndex === index ? null : index;
@@ -8723,36 +8916,104 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
8723
8916
  var handleSelectAll = function handleSelectAll(e) {
8724
8917
  setSelectAll(e.target.checked);
8725
8918
  if (e.target.checked) {
8726
- setSelectedReturnOrder(returnData.map(function (invoice) {
8919
+ setSelectedReturnOrder(returnData == null ? void 0 : returnData.map(function (loc) {
8920
+ var _loc$return_locations;
8727
8921
  return {
8728
- id: invoice.id,
8729
- status_id: 3
8922
+ id: loc.id,
8923
+ return_locations: loc == null ? void 0 : loc.return_locations,
8924
+ return_location: loc == null ? void 0 : loc.return_location,
8925
+ products: loc.id,
8926
+ order_product_return_action: loc == null ? void 0 : loc.order_product_return_action,
8927
+ return_location_token: loc == null || (_loc$return_locations = loc.return_locations) == null ? void 0 : _loc$return_locations.token
8928
+ };
8929
+ }));
8930
+ setNewPayload(returnData == null ? void 0 : returnData.map(function (loc) {
8931
+ var _loc$order_product_re, _loc$return_locations2;
8932
+ return {
8933
+ id: loc.id,
8934
+ account_number: createReturn == null ? void 0 : createReturn.account_number,
8935
+ customer_id: createReturn == null ? void 0 : createReturn.customer_id,
8936
+ products: loc.id,
8937
+ return_action: (loc == null || (_loc$order_product_re = loc.order_product_return_action) == null ? void 0 : _loc$order_product_re.type) || null,
8938
+ return_location_token: loc == null || (_loc$return_locations2 = loc.return_locations) == null ? void 0 : _loc$return_locations2.token
8730
8939
  };
8731
8940
  }));
8732
8941
  } else {
8733
8942
  setSelectedReturnOrder([]);
8734
8943
  }
8735
8944
  };
8736
- var handleSelectInvoice = function handleSelectInvoice(id) {
8737
- setSelectedReturnOrder(function (prevSelectedInvoices) {
8738
- var isSelected = prevSelectedInvoices == null ? void 0 : prevSelectedInvoices.some(function (invoice) {
8739
- return invoice.id === id;
8945
+ var handleSelectOrderReturn = function handleSelectOrderReturn(id, return_location, return_locations, order_product_return_action) {
8946
+ setSelectedReturnOrder(function (prevSelectedLocations) {
8947
+ var isSelected = prevSelectedLocations == null ? void 0 : prevSelectedLocations.some(function (loc) {
8948
+ return loc.id === id;
8740
8949
  });
8741
8950
  if (isSelected) {
8742
- return prevSelectedInvoices.filter(function (invoice) {
8743
- return invoice.id !== id;
8951
+ var updatedSelectedLocations = prevSelectedLocations.filter(function (loc) {
8952
+ return loc.id !== id;
8953
+ });
8954
+ setReturnPayload(function (prevState) {
8955
+ return _extends({}, prevState, {
8956
+ products: id,
8957
+ return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
8958
+ return_location_token: (return_locations == null ? void 0 : return_locations.token) || null
8959
+ });
8960
+ });
8961
+ setNewPayload(function (prevPayload) {
8962
+ return prevPayload.filter(function (item) {
8963
+ return item.id !== id;
8964
+ });
8744
8965
  });
8966
+ return updatedSelectedLocations;
8745
8967
  } else {
8746
- return [].concat(prevSelectedInvoices, [{
8968
+ var newReturnPayload = {
8747
8969
  id: id,
8748
- status_id: 3
8970
+ account_number: createReturn == null ? void 0 : createReturn.account_number,
8971
+ customer_id: createReturn == null ? void 0 : createReturn.customer_id,
8972
+ products: id,
8973
+ return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
8974
+ return_location_token: (return_locations == null ? void 0 : return_locations.token) || null
8975
+ };
8976
+ setNewPayload(function (prevPayload) {
8977
+ return [].concat(prevPayload, [newReturnPayload]);
8978
+ });
8979
+ setReturnPayload(function (prevState) {
8980
+ return _extends({}, prevState, {
8981
+ products: id,
8982
+ return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
8983
+ return_location_token: (return_locations == null ? void 0 : return_locations.token) || null
8984
+ });
8985
+ });
8986
+ return [].concat(prevSelectedLocations, [{
8987
+ id: id,
8988
+ return_location: return_location,
8989
+ return_locations: return_locations,
8990
+ order_product_return_action: order_product_return_action
8749
8991
  }]);
8750
8992
  }
8751
8993
  });
8752
8994
  };
8753
- return React__default.createElement(React__default.Fragment, null, React__default.createElement(StyledTableWrapper, {
8754
- id: "tableScrolling"
8755
- }, React__default.createElement(StyledTable, null, React__default.createElement("thead", null, React__default.createElement("tr", null, React__default.createElement("th", {
8995
+ React.useEffect(function () {
8996
+ if ((newpayload == null ? void 0 : newpayload.length) === 0) return;
8997
+ var groupedPayload = newpayload == null ? void 0 : newpayload.reduce(function (acc, item) {
8998
+ var return_location_token = item.return_location_token;
8999
+ if (!return_location_token) {
9000
+ acc.push(item);
9001
+ } else {
9002
+ if (!acc[return_location_token]) {
9003
+ acc[return_location_token] = _extends({}, item, {
9004
+ products: [],
9005
+ return_action: []
9006
+ });
9007
+ }
9008
+ acc[return_location_token].products = [].concat(acc[return_location_token].products, item.products);
9009
+ acc[return_location_token].return_action = [].concat(acc[return_location_token].return_action, item.return_action);
9010
+ }
9011
+ return acc;
9012
+ }, []);
9013
+ var mergedPayload = Object.values(groupedPayload);
9014
+ setGrouped(mergedPayload);
9015
+ }, [newpayload]);
9016
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(StyledTableWrapper, null, React__default.createElement(StyledTable, null, React__default.createElement("thead", null, React__default.createElement("tr", null, React__default.createElement("th", {
8756
9017
  className: "emailInvoiceCheckbox"
8757
9018
  }, React__default.createElement(dmsComponentLibrary.Checkbox, {
8758
9019
  checked: selectAll,
@@ -8776,7 +9037,7 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
8776
9037
  return (selectedInvoice == null ? void 0 : selectedInvoice.id) === item.id;
8777
9038
  }),
8778
9039
  onChange: function onChange() {
8779
- return handleSelectInvoice(item.id);
9040
+ return handleSelectOrderReturn(item.id, item.return_location, item.return_locations, item.order_product_return_action);
8780
9041
  }
8781
9042
  })), React__default.createElement("td", null, dmsComponentLibrary.displayValueOrNA(item == null || (_item$orders_products = item.orders_products_stock) == null ? void 0 : _item$orders_products.location)), React__default.createElement("td", null, " ", dmsComponentLibrary.displayValueOrNA(item == null ? void 0 : item.return_location)), React__default.createElement("td", null, React__default.createElement("ul", {
8782
9043
  style: {
@@ -9311,161 +9572,7 @@ var ProductAction = function ProductAction() {
9311
9572
  var GLobalPopupContent$4 = /*#__PURE__*/styled__default.div(_templateObject$2c || (_templateObject$2c = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9312
9573
  var Container$1a = /*#__PURE__*/styled__default.div(_templateObject2$1B || (_templateObject2$1B = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n height: 50vh;\n padding-bottom: 30px;\n flex-direction: column;\n align-items: flex-start;\n gap: 20px;\n align-self: stretch;\n border-radius: 6px;\n border: 1px solid #edebe8;\n padding: 15px;\n overflow-y: scroll;\n .ant-tabs {\n width: 100%;\n }\n .ant-tabs-tab-active {\n .ant-tabs-tab-btn {\n color: #3a3630 !important;\n font-family: 'Lato', sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n }\n }\n .ant-tabs-ink-bar {\n background: #feba30;\n }\n"])));
9313
9574
 
9314
- var BarCode = function BarCode() {
9315
- return React__default.createElement("svg", {
9316
- xmlns: "http://www.w3.org/2000/svg",
9317
- width: "18",
9318
- height: "18",
9319
- viewBox: "0 0 18 18",
9320
- fill: "none"
9321
- }, React__default.createElement("path", {
9322
- d: "M1.5 4.3125C1.5 3.76549 1.7173 3.24089 2.10409 2.85409C2.49089 2.4673 3.01549 2.25 3.5625 2.25H4.6875C4.83668 2.25 4.97976 2.30926 5.08525 2.41475C5.19074 2.52024 5.25 2.66332 5.25 2.8125C5.25 2.96168 5.19074 3.10476 5.08525 3.21025C4.97976 3.31574 4.83668 3.375 4.6875 3.375H3.5625C3.045 3.375 2.625 3.795 2.625 4.3125V5.4375C2.625 5.58668 2.56574 5.72976 2.46025 5.83525C2.35476 5.94074 2.21168 6 2.0625 6C1.91332 6 1.77024 5.94074 1.66475 5.83525C1.55926 5.72976 1.5 5.58668 1.5 5.4375V4.3125ZM12.75 2.8125C12.75 2.66332 12.8093 2.52024 12.9148 2.41475C13.0202 2.30926 13.1633 2.25 13.3125 2.25H14.4375C14.9845 2.25 15.5091 2.4673 15.8959 2.85409C16.2827 3.24089 16.5 3.76549 16.5 4.3125V5.4375C16.5 5.58668 16.4407 5.72976 16.3352 5.83525C16.2298 5.94074 16.0867 6 15.9375 6C15.7883 6 15.6452 5.94074 15.5398 5.83525C15.4343 5.72976 15.375 5.58668 15.375 5.4375V4.3125C15.375 3.795 14.955 3.375 14.4375 3.375H13.3125C13.1633 3.375 13.0202 3.31574 12.9148 3.21025C12.8093 3.10476 12.75 2.96168 12.75 2.8125ZM2.0625 12C2.21168 12 2.35476 12.0593 2.46025 12.1648C2.56574 12.2702 2.625 12.4133 2.625 12.5625V13.6875C2.625 14.205 3.045 14.625 3.5625 14.625H4.6875C4.83668 14.625 4.97976 14.6843 5.08525 14.7898C5.19074 14.8952 5.25 15.0383 5.25 15.1875C5.25 15.3367 5.19074 15.4798 5.08525 15.5852C4.97976 15.6907 4.83668 15.75 4.6875 15.75H3.5625C3.01549 15.75 2.49089 15.5327 2.10409 15.1459C1.7173 14.7591 1.5 14.2345 1.5 13.6875V12.5625C1.5 12.4133 1.55926 12.2702 1.66475 12.1648C1.77024 12.0593 1.91332 12 2.0625 12ZM15.9375 12C16.0867 12 16.2298 12.0593 16.3352 12.1648C16.4407 12.2702 16.5 12.4133 16.5 12.5625V13.6875C16.5 14.2345 16.2827 14.7591 15.8959 15.1459C15.5091 15.5327 14.9845 15.75 14.4375 15.75H13.3125C13.1633 15.75 13.0202 15.6907 12.9148 15.5852C12.8093 15.4798 12.75 15.3367 12.75 15.1875C12.75 15.0383 12.8093 14.8952 12.9148 14.7898C13.0202 14.6843 13.1633 14.625 13.3125 14.625H14.4375C14.955 14.625 15.375 14.205 15.375 13.6875V12.5625C15.375 12.4133 15.4343 12.2702 15.5398 12.1648C15.6452 12.0593 15.7883 12 15.9375 12ZM4.3125 5.25C4.46168 5.25 4.60476 5.30926 4.71025 5.41475C4.81574 5.52024 4.875 5.66332 4.875 5.8125V12.1875C4.875 12.3367 4.81574 12.4798 4.71025 12.5852C4.60476 12.6907 4.46168 12.75 4.3125 12.75C4.16332 12.75 4.02024 12.6907 3.91475 12.5852C3.80926 12.4798 3.75 12.3367 3.75 12.1875V5.8125C3.75 5.66332 3.80926 5.52024 3.91475 5.41475C4.02024 5.30926 4.16332 5.25 4.3125 5.25ZM7.875 5.8125C7.875 5.66332 7.81574 5.52024 7.71025 5.41475C7.60476 5.30926 7.46168 5.25 7.3125 5.25C7.16332 5.25 7.02024 5.30926 6.91475 5.41475C6.80926 5.52024 6.75 5.66332 6.75 5.8125V12.1875C6.75 12.3367 6.80926 12.4798 6.91475 12.5852C7.02024 12.6907 7.16332 12.75 7.3125 12.75C7.46168 12.75 7.60476 12.6907 7.71025 12.5852C7.81574 12.4798 7.875 12.3367 7.875 12.1875V5.8125ZM10.3125 5.25C10.4617 5.25 10.6048 5.30926 10.7102 5.41475C10.8157 5.52024 10.875 5.66332 10.875 5.8125V12.1875C10.875 12.3367 10.8157 12.4798 10.7102 12.5852C10.6048 12.6907 10.4617 12.75 10.3125 12.75C10.1633 12.75 10.0202 12.6907 9.91475 12.5852C9.80926 12.4798 9.75 12.3367 9.75 12.1875V5.8125C9.75 5.66332 9.80926 5.52024 9.91475 5.41475C10.0202 5.30926 10.1633 5.25 10.3125 5.25ZM13.875 5.8125C13.875 5.66332 13.8157 5.52024 13.7102 5.41475C13.6048 5.30926 13.4617 5.25 13.3125 5.25C13.1633 5.25 13.0202 5.30926 12.9148 5.41475C12.8093 5.52024 12.75 5.66332 12.75 5.8125V12.1875C12.75 12.3367 12.8093 12.4798 12.9148 12.5852C13.0202 12.6907 13.1633 12.75 13.3125 12.75C13.4617 12.75 13.6048 12.6907 13.7102 12.5852C13.8157 12.4798 13.875 12.3367 13.875 12.1875V5.8125Z",
9323
- fill: "#3A3630",
9324
- fillOpacity: "0.8"
9325
- }));
9326
- };
9327
-
9328
- var WeightIcon = function WeightIcon() {
9329
- return React__default.createElement("svg", {
9330
- xmlns: "http://www.w3.org/2000/svg",
9331
- width: "18",
9332
- height: "18",
9333
- viewBox: "0 0 18 18",
9334
- fill: "none"
9335
- }, React__default.createElement("path", {
9336
- d: "M9 2.25C9.79565 2.25 10.5587 2.56607 11.1213 3.12868C11.6839 3.69129 12 4.45435 12 5.25C12 5.7975 11.8575 6.3075 11.595 6.75H13.5C14.2125 6.75 14.8125 7.2525 14.9625 7.92C16.47 13.9275 16.5 14.085 16.5 14.25C16.5 14.6478 16.342 15.0294 16.0607 15.3107C15.7794 15.592 15.3978 15.75 15 15.75H3C2.60218 15.75 2.22064 15.592 1.93934 15.3107C1.65804 15.0294 1.5 14.6478 1.5 14.25C1.5 14.085 1.53 13.9275 3.0375 7.92C3.1875 7.2525 3.7875 6.75 4.5 6.75H6.405C6.13724 6.29565 5.99731 5.77737 6 5.25C6 4.45435 6.31607 3.69129 6.87868 3.12868C7.44129 2.56607 8.20435 2.25 9 2.25ZM9 3.75C8.60218 3.75 8.22064 3.90804 7.93934 4.18934C7.65804 4.47064 7.5 4.85218 7.5 5.25C7.5 5.64782 7.65804 6.02936 7.93934 6.31066C8.22064 6.59196 8.60218 6.75 9 6.75C9.39782 6.75 9.77936 6.59196 10.0607 6.31066C10.342 6.02936 10.5 5.64782 10.5 5.25C10.5 4.85218 10.342 4.47064 10.0607 4.18934C9.77936 3.90804 9.39782 3.75 9 3.75ZM4.5 8.25V14.25H6V12.375L6.75 13.125V14.25H8.25V12.75L6.75 11.25L8.25 9.75V8.25H6.75V9.375L6 10.125V8.25H4.5ZM11.25 8.25C10.4175 8.25 9.75 8.9175 9.75 9.75V12.75C9.75 13.5825 10.4175 14.25 11.25 14.25H13.5V10.5H12V12.75H11.25V9.75H13.5V8.25H11.25Z",
9337
- fill: "#3A3630",
9338
- fillOpacity: "0.6"
9339
- }));
9340
- };
9341
-
9342
- var CbmIcon = function CbmIcon() {
9343
- return React__default.createElement("svg", {
9344
- xmlns: "http://www.w3.org/2000/svg",
9345
- width: "18",
9346
- height: "18",
9347
- viewBox: "0 0 18 18",
9348
- fill: "none"
9349
- }, React__default.createElement("path", {
9350
- d: "M13.4213 2.66475C13.3589 2.54013 13.2631 2.43533 13.1446 2.36208C13.026 2.28883 12.8894 2.25002 12.75 2.25H5.25005C4.9658 2.25 4.7063 2.4105 4.5788 2.66475L1.5788 8.66475C1.52666 8.76895 1.49951 8.88386 1.49951 9.00037C1.49951 9.11689 1.52666 9.2318 1.5788 9.336L4.5788 15.336C4.7063 15.5895 4.9658 15.75 5.25005 15.75H12.75C13.0343 15.75 13.2938 15.5895 13.4213 15.3353L16.4213 9.33525C16.4734 9.23105 16.5006 9.11614 16.5006 8.99963C16.5006 8.88311 16.4734 8.7682 16.4213 8.664L13.4213 2.66475ZM14.5365 8.25H8.71355L6.46355 3.75H12.2865L14.5365 8.25ZM3.08855 9L5.25005 4.677L7.41155 9L5.25005 13.323L3.08855 9ZM12.2865 14.25H6.46355L8.71355 9.75H14.5365L12.2865 14.25Z",
9351
- fill: "#3A3630",
9352
- fillOpacity: "0.6"
9353
- }));
9354
- };
9355
-
9356
- var _templateObject$2d, _templateObject2$1C;
9357
- var AddProduct = function AddProduct() {
9358
- var _orderStaticData$orde;
9359
- var _useCreateOrderProduc = useCreateOrderProducts(),
9360
- orderProduct = _useCreateOrderProduc[0],
9361
- setOrderProduct = _useCreateOrderProduc[1];
9362
- var _useOrderStaticData = useOrderStaticData(),
9363
- orderStaticData = _useOrderStaticData[0];
9364
- var typeOptions = orderStaticData == null || (_orderStaticData$orde = orderStaticData.order_product_type) == null ? void 0 : _orderStaticData$orde.map(function (option) {
9365
- return {
9366
- label: option == null ? void 0 : option.type,
9367
- value: option == null ? void 0 : option.id
9368
- };
9369
- });
9370
- var handleInputChange = function handleInputChange(index, field, value) {
9371
- setOrderProduct(function (prevProducts) {
9372
- var _extends2;
9373
- var newProducts = [].concat(prevProducts);
9374
- newProducts[index] = _extends({}, newProducts[index], (_extends2 = {}, _extends2[field] = value, _extends2));
9375
- return newProducts;
9376
- });
9377
- };
9378
- var onSelectChange = function onSelectChange(index, value) {
9379
- handleInputChange(index, 'product_type_id', +value);
9380
- };
9381
- var onSearch = function onSearch(value) {
9382
- console.log('search item value:', value);
9383
- };
9384
- return React__default.createElement(GLobalPopupContent$5, null, React__default.createElement(SimpleTable, null, React__default.createElement("table", null, React__default.createElement("thead", null, React__default.createElement("tr", null, React__default.createElement("th", null, "Product Type"), React__default.createElement("th", {
9385
- style: {
9386
- width: '130px'
9387
- }
9388
- }, React__default.createElement("span", null, "Code ", React__default.createElement("em", null, "*"))), React__default.createElement("th", {
9389
- style: {
9390
- width: '33%'
9391
- }
9392
- }, React__default.createElement("span", null, "Description ", React__default.createElement("em", null, "*"))), React__default.createElement("th", null, "Barcode"), React__default.createElement("th", {
9393
- style: {
9394
- width: '120px'
9395
- }
9396
- }, "Weight"), React__default.createElement("th", {
9397
- style: {
9398
- width: '120px'
9399
- }
9400
- }, "CBM"))), React__default.createElement("tbody", null, orderProduct.length > 0 && (orderProduct == null ? void 0 : orderProduct.map(function (item, index) {
9401
- return React__default.createElement("tr", {
9402
- key: index
9403
- }, React__default.createElement("td", null, React__default.createElement(dmsComponentLibrary.AntSelect, {
9404
- options: typeOptions,
9405
- placeholder: "Deliver",
9406
- onChange: function onChange(value) {
9407
- return onSelectChange(index, value);
9408
- },
9409
- disabled: false,
9410
- style: {
9411
- width: 120
9412
- },
9413
- onSearch: onSearch,
9414
- showSearch: true,
9415
- popupClassName: 'dropDownStyle',
9416
- selectWrapperClass: ''
9417
- })), React__default.createElement("td", null, React__default.createElement("div", {
9418
- className: "inputWrap"
9419
- }, React__default.createElement("input", {
9420
- type: "text",
9421
- placeholder: "code",
9422
- value: item.code,
9423
- onChange: function onChange(e) {
9424
- return handleInputChange(index, 'code', e.target.value);
9425
- }
9426
- }))), React__default.createElement("td", null, React__default.createElement("div", {
9427
- className: "inputWrap"
9428
- }, React__default.createElement("input", {
9429
- type: "text",
9430
- placeholder: "Enter Description of Product",
9431
- value: item.description,
9432
- onChange: function onChange(e) {
9433
- return handleInputChange(index, 'description', e.target.value);
9434
- }
9435
- }))), React__default.createElement("td", null, React__default.createElement("div", {
9436
- className: "inputWrap"
9437
- }, React__default.createElement("input", {
9438
- type: "text",
9439
- placeholder: "Enter barcode of product",
9440
- value: item.sku,
9441
- onChange: function onChange(e) {
9442
- return handleInputChange(index, 'sku', e.target.value);
9443
- }
9444
- }), React__default.createElement(BarCode, null))), React__default.createElement("td", null, React__default.createElement("div", {
9445
- className: "inputWrap"
9446
- }, React__default.createElement("input", {
9447
- type: "text",
9448
- placeholder: "00.00",
9449
- value: item.weight,
9450
- onChange: function onChange(e) {
9451
- return handleInputChange(index, 'weight', parseFloat(e.target.value));
9452
- }
9453
- }), React__default.createElement(WeightIcon, null))), React__default.createElement("td", null, React__default.createElement("div", {
9454
- className: "inputWrap"
9455
- }, React__default.createElement("input", {
9456
- type: "text",
9457
- placeholder: "00.00",
9458
- value: item.cube,
9459
- onChange: function onChange(e) {
9460
- return handleInputChange(index, 'cube', parseFloat(e.target.value));
9461
- }
9462
- }), React__default.createElement(CbmIcon, null))));
9463
- }))))));
9464
- };
9465
- var GLobalPopupContent$5 = /*#__PURE__*/styled__default.div(_templateObject$2d || (_templateObject$2d = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9466
- var SimpleTable = /*#__PURE__*/styled__default.div(_templateObject2$1C || (_templateObject2$1C = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding: 0 15px;\n min-height: 158px;\n table {\n border-spacing: 0px 12px;\n border-collapse: separate;\n thead {\n tr {\n th {\n padding: 0 10px 0;\n color: #6a7378;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 20px;\n text-align: left;\n span {\n position: relative;\n em {\n color: #fc5555;\n font-style: normal;\n }\n }\n }\n }\n }\n tbody {\n tr {\n td {\n padding: 10px 8px;\n background: #f8fafc;\n box-shadow: 5px 1px 5px 0px rgba(16, 24, 40, 0.1);\n\n .inputWrap {\n position: relative;\n input[type='text'] {\n border-radius: 6px;\n border: 1px solid #e0e2e7;\n background: #fff;\n box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);\n padding: 8px 10px;\n width: 100%;\n padding-right: 30px;\n &:focus-visible {\n outline: none;\n }\n }\n svg {\n position: absolute;\n right: 11px;\n top: 7px;\n }\n }\n &:first-child {\n border-radius: 5px 0 0 5px;\n }\n &:last-child {\n border-radius: 0 5px 5px 0;\n }\n }\n }\n }\n }\n"])));
9467
-
9468
- var _templateObject$2e;
9575
+ var _templateObject$2d;
9469
9576
  var LogsTable = function LogsTable() {
9470
9577
  var options = [{
9471
9578
  value: 'bjsCouriers',
@@ -9540,9 +9647,9 @@ var LogsTable = function LogsTable() {
9540
9647
  }
9541
9648
  })));
9542
9649
  };
9543
- var GlobalPopupContent = /*#__PURE__*/styled__default.div(_templateObject$2e || (_templateObject$2e = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9650
+ var GlobalPopupContent = /*#__PURE__*/styled__default.div(_templateObject$2d || (_templateObject$2d = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9544
9651
 
9545
- var _templateObject$2f, _templateObject2$1D;
9652
+ var _templateObject$2e, _templateObject2$1C;
9546
9653
  var DefectsModal = function DefectsModal() {
9547
9654
  var options = [{
9548
9655
  value: 'bjsCouriers',
@@ -9585,7 +9692,7 @@ var DefectsModal = function DefectsModal() {
9585
9692
  key: 'images',
9586
9693
  title: 'Images'
9587
9694
  }];
9588
- return React__default.createElement(React__default.Fragment, null, React__default.createElement(GLobalPopupContent$6, null, React__default.createElement(StyledConatiner, null, React__default.createElement(dmsComponentLibrary.AntTable, {
9695
+ return React__default.createElement(React__default.Fragment, null, React__default.createElement(GLobalPopupContent$5, null, React__default.createElement(StyledConatiner, null, React__default.createElement(dmsComponentLibrary.AntTable, {
9589
9696
  columns: columns,
9590
9697
  data: DefectsData,
9591
9698
  selectOptions: options,
@@ -9594,10 +9701,10 @@ var DefectsModal = function DefectsModal() {
9594
9701
  }
9595
9702
  }))));
9596
9703
  };
9597
- var StyledConatiner = /*#__PURE__*/styled__default.div(_templateObject$2f || (_templateObject$2f = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* tex: nowrap; */\n"])));
9598
- var GLobalPopupContent$6 = /*#__PURE__*/styled__default.div(_templateObject2$1D || (_templateObject2$1D = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9704
+ var StyledConatiner = /*#__PURE__*/styled__default.div(_templateObject$2e || (_templateObject$2e = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* tex: nowrap; */\n"])));
9705
+ var GLobalPopupContent$5 = /*#__PURE__*/styled__default.div(_templateObject2$1C || (_templateObject2$1C = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9599
9706
 
9600
- var _templateObject$2g;
9707
+ var _templateObject$2f;
9601
9708
  var repackModal = function repackModal() {
9602
9709
  var columns = [{
9603
9710
  key: 'packaging_type',
@@ -9627,28 +9734,24 @@ var repackModal = function repackModal() {
9627
9734
  }
9628
9735
  }))));
9629
9736
  };
9630
- var StyledConatiner$1 = /*#__PURE__*/styled__default.div(_templateObject$2g || (_templateObject$2g = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* text-wrap: nowrap; */\n"])));
9737
+ var StyledConatiner$1 = /*#__PURE__*/styled__default.div(_templateObject$2f || (_templateObject$2f = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* text-wrap: nowrap; */\n"])));
9631
9738
 
9632
- var _templateObject$2h, _templateObject2$1E, _templateObject3$X;
9739
+ var _templateObject$2g, _templateObject2$1D, _templateObject3$X;
9633
9740
  var CreateReturnModal = function CreateReturnModal() {
9634
- var _useState = React.useState(),
9741
+ var _useState = React.useState([]),
9742
+ selectedlocation = _useState[0],
9635
9743
  setSelectedLocations = _useState[1];
9636
- var _useLocationData = useLocationData(),
9637
- locationData = _useLocationData[0];
9744
+ var _useSelectedOrders = useSelectedOrders(),
9745
+ selectedReturnOrder = _useSelectedOrders[0];
9638
9746
  var handleSelectLocations = function handleSelectLocations(id) {
9639
9747
  setSelectedLocations(function (prevSelectedLocations) {
9640
- var isSelected = prevSelectedLocations == null ? void 0 : prevSelectedLocations.some(function (location) {
9641
- return location.id === id;
9642
- });
9748
+ var isSelected = prevSelectedLocations.includes(id);
9643
9749
  if (isSelected) {
9644
- return prevSelectedLocations.filter(function (invoice) {
9645
- return invoice.id !== id;
9750
+ return prevSelectedLocations.filter(function (selectedId) {
9751
+ return selectedId !== id;
9646
9752
  });
9647
9753
  } else {
9648
- return [].concat(prevSelectedLocations, [{
9649
- id: id,
9650
- status_id: 3
9651
- }]);
9754
+ return [].concat(prevSelectedLocations, [id]);
9652
9755
  }
9653
9756
  });
9654
9757
  };
@@ -9663,38 +9766,38 @@ var CreateReturnModal = function CreateReturnModal() {
9663
9766
  listStyle: 'none',
9664
9767
  padding: 0
9665
9768
  }
9666
- }, locationData == null ? void 0 : locationData.map(function (invoice) {
9769
+ }, selectedReturnOrder == null ? void 0 : selectedReturnOrder.map(function (returnLoc) {
9667
9770
  return React__default.createElement("li", {
9668
- key: invoice.id,
9771
+ key: returnLoc.id,
9669
9772
  style: {
9670
9773
  marginBottom: '8px',
9671
9774
  display: 'flex',
9672
9775
  alignItems: 'center'
9673
9776
  }
9674
9777
  }, React__default.createElement(dmsComponentLibrary.Checkbox, {
9675
- checked: true,
9778
+ checked: selectedlocation.includes(returnLoc.id),
9676
9779
  onChange: function onChange() {
9677
- return handleSelectLocations(invoice.id);
9780
+ return handleSelectLocations(returnLoc.id);
9678
9781
  }
9679
9782
  }), React__default.createElement(StyledText$1, {
9680
9783
  style: {
9681
9784
  marginLeft: '8px'
9682
9785
  }
9683
- }, invoice.location_name));
9786
+ }, returnLoc == null ? void 0 : returnLoc.return_location));
9684
9787
  }))));
9685
9788
  };
9686
- var StyledText$1 = /*#__PURE__*/styled__default.div(_templateObject$2h || (_templateObject$2h = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #8d8f90;\n font-family: Poppins;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n"])));
9687
- var Container$1b = /*#__PURE__*/styled__default.div(_templateObject2$1E || (_templateObject2$1E = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9789
+ var StyledText$1 = /*#__PURE__*/styled__default.div(_templateObject$2g || (_templateObject$2g = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #8d8f90;\n font-family: Poppins;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n"])));
9790
+ var Container$1b = /*#__PURE__*/styled__default.div(_templateObject2$1D || (_templateObject2$1D = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9688
9791
  var Wrapper$l = /*#__PURE__*/styled__default.div(_templateObject3$X || (_templateObject3$X = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 15px;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n gap: 15px;\n align-self: stretch;\n border-radius: 8px;\n background: #f8fafc;\n box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1);\n"])));
9689
9792
 
9793
+ var _excluded$2 = ["id"];
9690
9794
  var ModalManager = function ModalManager() {
9691
9795
  var _useAtom = jotai.useAtom(countReducerAtom),
9692
9796
  popupName = _useAtom[0],
9693
9797
  dispatch = _useAtom[1];
9694
9798
  var _useProductDetails = useProductDetails();
9695
9799
  var _useCreateOrderProduc = useCreateOrderProducts(),
9696
- orderProduct = _useCreateOrderProduc[0],
9697
- setOrderProduct = _useCreateOrderProduc[1];
9800
+ orderProduct = _useCreateOrderProduc[0];
9698
9801
  var _useOrderId = useOrderId(),
9699
9802
  orderId = _useOrderId[0];
9700
9803
  var _useDeleteProdsID = useDeleteProdsID(),
@@ -9711,6 +9814,9 @@ var ModalManager = function ModalManager() {
9711
9814
  selectedTab = _useAtom3[0];
9712
9815
  var _useState = React.useState(false),
9713
9816
  setIsFormValid = _useState[1];
9817
+ var _useNewReturnPayload = useNewReturnPayload(),
9818
+ newPayload = _useNewReturnPayload[0],
9819
+ setNewPayload = _useNewReturnPayload[1];
9714
9820
  console.log(orderProduct, 'abcabcabcabcabcabcabcabcabcabcabc');
9715
9821
  var _closeModal = function closeModal() {
9716
9822
  dispatch({
@@ -9761,68 +9867,73 @@ var ModalManager = function ModalManager() {
9761
9867
  // }
9762
9868
  // };
9763
9869
  // API block for creating product order
9764
- var _useApiHook = dmsComponentLibrary.useApiHook({
9765
- endpoint: "order/order_products/create/",
9766
- method: 'POST',
9767
- body: [orderProduct],
9768
- performAction: false
9769
- }),
9770
- response = _useApiHook.data,
9771
- setOrderAction = _useApiHook.setShouldPerformAction;
9772
- var validateAddForm = function validateAddForm() {
9773
- if (!Array.isArray(orderProduct)) return false;
9774
- return orderProduct.every(function (product) {
9775
- return product.code !== '' && product.description !== '' && product.weight !== 0 && product.cube !== 0 && product.order_product_type_id !== 0 && product.sku !== '';
9776
- });
9777
- };
9778
- React.useEffect(function () {
9779
- setAddIsFormValid(validateAddForm());
9780
- }, [orderProduct]);
9781
- var onAddOrderProduct = function onAddOrderProduct() {
9782
- if (isAddFormValid) {
9783
- setOrderProduct(function (prev) {
9784
- return prev.map(function (product) {
9785
- return _extends({}, product, {
9786
- order_id: orderId
9787
- });
9788
- });
9789
- });
9790
- setOrderAction(true);
9791
- } else {
9792
- console.log('Please fill in all required fields before proceeding.');
9793
- }
9794
- };
9795
- React.useEffect(function () {
9796
- if (response && response != null && response.data) {
9797
- dispatch({
9798
- type: 'close'
9799
- });
9800
- }
9801
- }, [response]);
9802
- var _useState2 = React.useState(false),
9803
- isAddFormValid = _useState2[0],
9804
- setAddIsFormValid = _useState2[1];
9805
- var AddMore = function AddMore() {
9806
- setOrderProduct(function (prevProducts) {
9807
- return [].concat(prevProducts, [{
9808
- code: '',
9809
- description: '',
9810
- sku: '',
9811
- weight: '',
9812
- cube: '',
9813
- order_product_type_id: ''
9814
- }]);
9815
- });
9816
- };
9870
+ // const {
9871
+ // data: response,
9872
+ // setShouldPerformAction: setOrderAction,
9873
+ // } = useApiHook<{
9874
+ // data: ApiResponse[];
9875
+ // }>({
9876
+ // endpoint: `order/order_products/create/`,
9877
+ // method: 'POST',
9878
+ // body: [orderProduct],
9879
+ // performAction: false,
9880
+ // });
9881
+ // const validateAddForm = () => {
9882
+ // if (!Array.isArray(orderProduct)) return false;
9883
+ // return orderProduct.every(
9884
+ // (product: any) =>
9885
+ // product.code !== '' &&
9886
+ // product.description !== '' &&
9887
+ // product.weight !== 0 &&
9888
+ // product.cube !== 0 &&
9889
+ // product.order_product_type_id !== 0 &&
9890
+ // product.sku !== ''
9891
+ // );
9892
+ // };
9893
+ // useEffect(() => {
9894
+ // setAddIsFormValid(validateAddForm());
9895
+ // }, [orderProduct]);
9896
+ // const onAddOrderProduct = () => {
9897
+ // if (isAddFormValid) {
9898
+ // setOrderProduct((prev: any) =>
9899
+ // prev.map((product: any) => ({
9900
+ // ...product,
9901
+ // order_id: orderId,
9902
+ // }))
9903
+ // );
9904
+ // setOrderAction(true);
9905
+ // } else {
9906
+ // console.log('Please fill in all required fields before proceeding.');
9907
+ // }
9908
+ // };
9909
+ // useEffect(() => {
9910
+ // if (response && response?.data) {
9911
+ // dispatch({ type: 'close' });
9912
+ // }
9913
+ // }, [response]);
9914
+ // const [isAddFormValid, setAddIsFormValid] = useState(false);
9915
+ // const AddMore = () => {
9916
+ // setOrderProduct((prevProducts: any) => [
9917
+ // ...prevProducts,
9918
+ // {
9919
+ // code: '',
9920
+ // description: '',
9921
+ // sku: '',
9922
+ // weight: '',
9923
+ // cube: '',
9924
+ // order_product_type_id: '',
9925
+ // },
9926
+ // ]);
9927
+ // };
9817
9928
  // api block for the create product order
9818
- var _useApiHook2 = dmsComponentLibrary.useApiHook({
9929
+ var _useApiHook = dmsComponentLibrary.useApiHook({
9819
9930
  endpoint: "order/order_products/unrecieve/",
9820
9931
  method: 'POST',
9821
9932
  body: [unRecieve],
9822
9933
  performAction: false
9823
9934
  }),
9824
- actionResponse = _useApiHook2.data,
9825
- setUnrecieveaction = _useApiHook2.setShouldPerformAction;
9935
+ actionResponse = _useApiHook.data,
9936
+ setUnrecieveaction = _useApiHook.setShouldPerformAction;
9826
9937
  React.useEffect(function () {
9827
9938
  if (actionResponse && actionResponse != null && actionResponse.data) {
9828
9939
  dispatch({
@@ -9831,14 +9942,14 @@ var ModalManager = function ModalManager() {
9831
9942
  }
9832
9943
  }, [actionResponse]);
9833
9944
  // api block for the update product order
9834
- var _useApiHook3 = dmsComponentLibrary.useApiHook({
9945
+ var _useApiHook2 = dmsComponentLibrary.useApiHook({
9835
9946
  endpoint: "order/order_products/type/update/",
9836
9947
  method: 'PUT',
9837
9948
  body: [updateOrderProduct],
9838
9949
  performAction: false
9839
9950
  }),
9840
- updateResponse = _useApiHook3.data,
9841
- setUpdateSction = _useApiHook3.setShouldPerformAction;
9951
+ updateResponse = _useApiHook2.data,
9952
+ setUpdateSction = _useApiHook2.setShouldPerformAction;
9842
9953
  // const onUnrecieveProductOrder = () => {
9843
9954
  // setUnRecieve((prev: any) => ({
9844
9955
  // ...prev,
@@ -9877,6 +9988,28 @@ var ModalManager = function ModalManager() {
9877
9988
  });
9878
9989
  }
9879
9990
  }, [updateResponse]);
9991
+ //Confirm return popup
9992
+ var _useApiHook3 = dmsComponentLibrary.useApiHook({
9993
+ endpoint: "return_orders/",
9994
+ method: 'POST',
9995
+ body: [newPayload],
9996
+ performAction: false
9997
+ }),
9998
+ response = _useApiHook3.data,
9999
+ setShouldPerformAction = _useApiHook3.setShouldPerformAction;
10000
+ var handleConfirmReturn = function handleConfirmReturn() {
10001
+ var payloadWithoutId = newPayload == null ? void 0 : newPayload.map(function (_ref) {
10002
+ var rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
10003
+ return _extends({}, rest);
10004
+ });
10005
+ console.log(response);
10006
+ if (payloadWithoutId) {
10007
+ setNewPayload(payloadWithoutId);
10008
+ setShouldPerformAction(true);
10009
+ } else {
10010
+ setShouldPerformAction(false);
10011
+ }
10012
+ };
9880
10013
  return React__default.createElement(React__default.Fragment, null, (popupName == null ? void 0 : popupName.state) == 'create-return' && React__default.createElement(dmsComponentLibrary.AntModal, {
9881
10014
  openStatus: (popupName == null ? void 0 : popupName.state) == 'create-return' ? true : false,
9882
10015
  closeModal: function closeModal() {
@@ -9890,37 +10023,15 @@ var ModalManager = function ModalManager() {
9890
10023
  btns: [{
9891
10024
  name: 'Submit',
9892
10025
  btnStyle: 'rounded',
9893
- type: 'button'
10026
+ onClick: handleConfirmReturn,
10027
+ type: 'button',
10028
+ disabled: !newPayload
9894
10029
  }],
9895
10030
  btnAlign: 'justifyEnd'
9896
10031
  },
9897
10032
  BodyComponent: CreateReturnModal,
9898
10033
  width: 800,
9899
10034
  classNameAdd: 'globalPopup'
9900
- }), (popupName == null ? void 0 : popupName.state) === 'addProduct' && React__default.createElement(dmsComponentLibrary.AntModal, {
9901
- openStatus: (popupName == null ? void 0 : popupName.state) === 'addProduct',
9902
- closeModal: _closeModal,
9903
- PopupHeader: {
9904
- heading: 'Add Product(s) to Order',
9905
- subHeading: 'Full Stock Control'
9906
- },
9907
- PopupFooter: {
9908
- btns: [{
9909
- name: 'Add More Product',
9910
- btnStyle: 'normalLink',
9911
- icon: 'addIcon',
9912
- onClick: AddMore
9913
- }, {
9914
- name: 'Save Details',
9915
- btnStyle: 'rounded',
9916
- onClick: onAddOrderProduct,
9917
- disabled: !isAddFormValid
9918
- }],
9919
- btnAlign: 'justifySpaceBetween'
9920
- },
9921
- BodyComponent: AddProduct,
9922
- width: 1104,
9923
- classNameAdd: 'globalPopup'
9924
10035
  }), (popupName == null ? void 0 : popupName.state) === 'qclog' && React__default.createElement(dmsComponentLibrary.AntModal, {
9925
10036
  openStatus: (popupName == null ? void 0 : popupName.state) === 'qclog',
9926
10037
  closeModal: _closeModal,
@@ -9993,14 +10104,14 @@ var ModalManager = function ModalManager() {
9993
10104
  }));
9994
10105
  };
9995
10106
 
9996
- var _templateObject$2i, _templateObject2$1F;
10107
+ var _templateObject$2h, _templateObject2$1E;
9997
10108
  var ReturnTable = function ReturnTable() {
9998
10109
  return React__default.createElement("div", null, React__default.createElement(DashBoardWrapper$1, null, React__default.createElement(RouterHeader, null), React__default.createElement("div", {
9999
10110
  className: "Tableconatiner"
10000
10111
  }, React__default.createElement(HeaderFilter, null), React__default.createElement(Container$1c, null, React__default.createElement(ReturnFilter, null), React__default.createElement(ReturnOrderTable, null)))), React__default.createElement(ModalManager, null));
10001
10112
  };
10002
- var Container$1c = /*#__PURE__*/styled__default.div(_templateObject$2i || (_templateObject$2i = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -46px;\n"])));
10003
- var DashBoardWrapper$1 = /*#__PURE__*/styled__default.section(_templateObject2$1F || (_templateObject2$1F = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .Tableconatiner {\n border-radius: 12px;\n background: #fff;\n box-shadow: -2px 0px 12px 0px rgba(56, 71, 109, 0.1);\n display: block;\n padding: 15px 20px;\n }\n .headerWrap,\n .tableData,\n .styleCovered {\n transition: all ease 0.5s;\n }\n &.stickyTableHead {\n h2 {\n font-size: 21px;\n }\n .headerWrap {\n height: 84px;\n padding: 10px;\n border-radius: 0px 0px 15px 15px;\n > div {\n position: relative;\n z-index: 10;\n }\n }\n .styleCovered {\n margin-top: -32px;\n width: 67%;\n float: right;\n gap: 5px;\n padding-right: 11px;\n\n li {\n padding: 4px 10px 5px 5px;\n gap: 5px;\n .svgCover {\n width: 30px;\n height: 30px;\n svg {\n height: auto;\n width: 58%;\n }\n }\n .countDigit {\n font-size: 19px;\n }\n }\n .countMess {\n font-size: 13px;\n }\n }\n .dmsBulkFilter {\n min-height: unset;\n gap: 4px;\n > div {\n padding: 4px 12px;\n label {\n font-size: 11px;\n }\n }\n }\n\n .StyledFilterList {\n gap: 4px;\n li {\n height: 29px;\n padding: 3px 8px;\n gap: 4px;\n .StyledFilterBtnIcon {\n width: 20px;\n height: 20px;\n svh {\n width: 10px;\n height: auto;\n }\n }\n .StyledFilterBtnLabel {\n font-size: 13px;\n }\n }\n }\n .StyledFilterLabel {\n padding-left: 10px;\n span {\n font-size: 13px;\n }\n }\n .cardcontainer.tableData {\n max-height: calc(100vh - 310px);\n min-height: calc(100vh - 310px);\n }\n\n .tableData {\n max-height: calc(100vh - 320px);\n min-height: calc(100vh - 320px);\n\n margin-top: 8px;\n thead {\n position: sticky;\n top: 0;\n z-index: 9;\n th {\n font-size: 13px;\n padding: 2px 15px;\n }\n }\n }\n }\n"])));
10113
+ var Container$1c = /*#__PURE__*/styled__default.div(_templateObject$2h || (_templateObject$2h = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -46px;\n"])));
10114
+ var DashBoardWrapper$1 = /*#__PURE__*/styled__default.section(_templateObject2$1E || (_templateObject2$1E = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .Tableconatiner {\n border-radius: 12px;\n background: #fff;\n box-shadow: -2px 0px 12px 0px rgba(56, 71, 109, 0.1);\n display: block;\n padding: 15px 20px;\n }\n .headerWrap,\n .tableData,\n .styleCovered {\n transition: all ease 0.5s;\n }\n &.stickyTableHead {\n h2 {\n font-size: 21px;\n }\n .headerWrap {\n height: 84px;\n padding: 10px;\n border-radius: 0px 0px 15px 15px;\n > div {\n position: relative;\n z-index: 10;\n }\n }\n .styleCovered {\n margin-top: -32px;\n width: 67%;\n float: right;\n gap: 5px;\n padding-right: 11px;\n\n li {\n padding: 4px 10px 5px 5px;\n gap: 5px;\n .svgCover {\n width: 30px;\n height: 30px;\n svg {\n height: auto;\n width: 58%;\n }\n }\n .countDigit {\n font-size: 19px;\n }\n }\n .countMess {\n font-size: 13px;\n }\n }\n .dmsBulkFilter {\n min-height: unset;\n gap: 4px;\n > div {\n padding: 4px 12px;\n label {\n font-size: 11px;\n }\n }\n }\n\n .StyledFilterList {\n gap: 4px;\n li {\n height: 29px;\n padding: 3px 8px;\n gap: 4px;\n .StyledFilterBtnIcon {\n width: 20px;\n height: 20px;\n svh {\n width: 10px;\n height: auto;\n }\n }\n .StyledFilterBtnLabel {\n font-size: 13px;\n }\n }\n }\n .StyledFilterLabel {\n padding-left: 10px;\n span {\n font-size: 13px;\n }\n }\n .cardcontainer.tableData {\n max-height: calc(100vh - 310px);\n min-height: calc(100vh - 310px);\n }\n\n .tableData {\n max-height: calc(100vh - 320px);\n min-height: calc(100vh - 320px);\n\n margin-top: 8px;\n thead {\n position: sticky;\n top: 0;\n z-index: 9;\n th {\n font-size: 13px;\n padding: 2px 15px;\n }\n }\n }\n }\n"])));
10004
10115
 
10005
10116
  function LoadIcon() {
10006
10117
  return React__default.createElement("svg", {
@@ -10223,7 +10334,7 @@ var OrderTable = function OrderTable(_ref) {
10223
10334
  })))));
10224
10335
  };
10225
10336
 
10226
- var _templateObject$2j, _templateObject2$1G, _templateObject3$Y, _templateObject4$E;
10337
+ var _templateObject$2i, _templateObject2$1F, _templateObject3$Y, _templateObject4$E;
10227
10338
  var TableFilters = function TableFilters() {
10228
10339
  return React__default.createElement(Container$1d, null, React__default.createElement(StyledBulkItem, null, React__default.createElement(SearchType, null)), React__default.createElement(IconConatiner$1, null, React__default.createElement(Mid$1, null, React__default.createElement(IconText$1, null, "Export"), React__default.createElement(DownloadIcon, null))));
10229
10340
  // return (
@@ -10239,8 +10350,8 @@ var TableFilters = function TableFilters() {
10239
10350
  // // </StyledBulkFilterCover>
10240
10351
  // );
10241
10352
  };
10242
- var Container$1d = /*#__PURE__*/styled__default.div(_templateObject$2j || (_templateObject$2j = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n /* align-items: flex-start; */\n gap: 16px;\n align-items: center;\n"])));
10243
- var Mid$1 = /*#__PURE__*/styled__default.div(_templateObject2$1G || (_templateObject2$1G = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 10px 10px 10px 10px;\n align-items: center;\n gap: 8px;\n align-self: stretch;\n /* border-radius: 15px 15px 15px 15px; */\n"])));
10353
+ var Container$1d = /*#__PURE__*/styled__default.div(_templateObject$2i || (_templateObject$2i = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n /* align-items: flex-start; */\n gap: 16px;\n align-items: center;\n"])));
10354
+ var Mid$1 = /*#__PURE__*/styled__default.div(_templateObject2$1F || (_templateObject2$1F = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 10px 10px 10px 10px;\n align-items: center;\n gap: 8px;\n align-self: stretch;\n /* border-radius: 15px 15px 15px 15px; */\n"])));
10244
10355
  // const TextConatiner = styled.div`
10245
10356
  // display: flex;
10246
10357
  // padding: 7px 12px;
@@ -10307,19 +10418,6 @@ var DateIcon = function DateIcon() {
10307
10418
  }));
10308
10419
  };
10309
10420
 
10310
- var DownArrowIcon = function DownArrowIcon() {
10311
- return React__default.createElement("svg", {
10312
- xmlns: "http://www.w3.org/2000/svg",
10313
- width: "8",
10314
- height: "4",
10315
- viewBox: "0 0 8 4",
10316
- fill: "none"
10317
- }, React__default.createElement("path", {
10318
- d: "M0.350098 0.125L4.1001 3.875L7.8501 0.125H0.350098Z",
10319
- fill: "#888075"
10320
- }));
10321
- };
10322
-
10323
10421
  var StatusIcon = function StatusIcon() {
10324
10422
  return React__default.createElement("svg", {
10325
10423
  xmlns: "http://www.w3.org/2000/svg",
@@ -10377,37 +10475,143 @@ var AssigneIcon = function AssigneIcon() {
10377
10475
  }))));
10378
10476
  };
10379
10477
 
10380
- var _templateObject$2k;
10478
+ var initialState$2 = {
10479
+ 'x-filters': [],
10480
+ 'x-pagination': {
10481
+ page: 1,
10482
+ per_page: 50
10483
+ }
10484
+ };
10485
+ var filterReducer$1 = function filterReducer(state, action) {
10486
+ switch (action.type) {
10487
+ case 'SET_DATE_FILTER':
10488
+ return _extends({}, state, {
10489
+ 'x-filters': [].concat(state['x-filters'].filter(function (f) {
10490
+ return f.field !== 'created_at';
10491
+ }), [{
10492
+ field: 'created_at',
10493
+ op: '>=',
10494
+ value: dateFns.format(new Date(action.payload), 'yyyy-MM-dd') + "T00:00:00+00:00"
10495
+ }, {
10496
+ field: 'created_at',
10497
+ op: '<=',
10498
+ value: dateFns.format(new Date(action.payload), 'yyyy-MM-dd') + "T23:59:59+00:00"
10499
+ }])
10500
+ });
10501
+ case 'SET_CLIENT_FILTER':
10502
+ return _extends({}, state, {
10503
+ 'x-filters': [].concat(state['x-filters'].filter(function (f) {
10504
+ return f.field !== 'customer_id';
10505
+ }), [{
10506
+ field: 'customer_id',
10507
+ op: '=',
10508
+ value: action.payload
10509
+ }])
10510
+ });
10511
+ // case 'SET_ACTIONS_FILTER':
10512
+ // return {
10513
+ // ...state,
10514
+ // 'x-filters': [
10515
+ // ...state['x-filters'].filter(
10516
+ // f => f.field !== 'product_return_action_id'
10517
+ // ),
10518
+ // {
10519
+ // field: 'product_return_action_id',
10520
+ // op: '=',
10521
+ // value: action.payload,
10522
+ // },
10523
+ // ],
10524
+ // };
10525
+ // case 'SET_LOCATION_FILTER':
10526
+ // return {
10527
+ // ...state,
10528
+ // 'x-filters': [
10529
+ // ...state['x-filters'].filter(f => f.field !== 'return_location'),
10530
+ // {
10531
+ // field: 'return_location',
10532
+ // op: 'in',
10533
+ // value: action.payload,
10534
+ // },
10535
+ // ],
10536
+ // };
10537
+ case 'SET_PAGE':
10538
+ return _extends({}, state, {
10539
+ 'x-pagination': _extends({}, state['x-pagination'], {
10540
+ page: action.payload
10541
+ })
10542
+ });
10543
+ case 'SET_PERPAGE':
10544
+ return _extends({}, state, {
10545
+ 'x-pagination': _extends({}, state['x-pagination'], {
10546
+ per_page: action.payload
10547
+ })
10548
+ });
10549
+ case 'CLEAR_FILTERS':
10550
+ return _extends({}, state);
10551
+ default:
10552
+ return state;
10553
+ }
10554
+ };
10555
+ var filtersStateAtom$1 = /*#__PURE__*/jotai.atom(initialState$2);
10556
+ var filtersReducerAtom$1 = /*#__PURE__*/jotai.atom(function (get) {
10557
+ return get(filtersStateAtom$1);
10558
+ }, function (get, set, action) {
10559
+ return set(filtersStateAtom$1, filterReducer$1(get(filtersStateAtom$1), action));
10560
+ });
10561
+
10562
+ var _templateObject$2j, _templateObject2$1G;
10381
10563
  var ReturnOrderFilter = function ReturnOrderFilter() {
10382
- var _useOrderDetails = useOrderDetails(),
10383
- orderDetails = _useOrderDetails[0],
10384
- setOrderDetails = _useOrderDetails[1];
10385
- var _usePrevOrderDetails = usePrevOrderDetails(),
10386
- prevOrderDetails = _usePrevOrderDetails[0];
10387
- var actionDate = orderDetails != null && orderDetails.action_date ? new Date(orderDetails == null ? void 0 : orderDetails.action_date) : null;
10388
- var onChange = function onChange(date, _dateString) {
10389
- var selectedDate = date == null ? void 0 : date.format('YYYY-MM-DDTHH:mm:ss');
10390
- if (selectedDate !== undefined && prevOrderDetails.action_date !== undefined) {
10391
- if (new Date(selectedDate).toLocaleDateString() === new Date(prevOrderDetails.action_date).toLocaleDateString()) {
10392
- setOrderDetails(function (prev) {
10393
- return _extends({}, prev, {
10394
- action_date: prevOrderDetails.action_date
10395
- });
10396
- });
10397
- } else {
10398
- setOrderDetails(function (prev) {
10399
- return _extends({}, prev, {
10400
- action_date: selectedDate
10401
- });
10402
- });
10403
- }
10404
- } else {
10405
- setOrderDetails(function (prev) {
10406
- return _extends({}, prev, {
10407
- action_date: null
10408
- });
10564
+ var _useAtom = jotai.useAtom(filtersReducerAtom$1),
10565
+ dispatch = _useAtom[1];
10566
+ var _useCustomerData = useCustomerData(),
10567
+ customers = _useCustomerData[0];
10568
+ var _useState = React.useState(),
10569
+ selectedDate = _useState[0],
10570
+ setSelectedDate = _useState[1];
10571
+ var zoneOptions = [{
10572
+ label: 'Zone 1',
10573
+ value: 'zone1'
10574
+ }, {
10575
+ label: 'Zone 2',
10576
+ value: 'zone2'
10577
+ }, {
10578
+ label: 'Zone 3',
10579
+ value: 'zone3'
10580
+ }, {
10581
+ label: 'Zone 4',
10582
+ value: 'zone4'
10583
+ }, {
10584
+ label: 'Zone 5',
10585
+ value: 'zone5'
10586
+ }];
10587
+ // date change here
10588
+ var handleDateChange = function handleDateChange(date) {
10589
+ setSelectedDate(date ? date == null ? void 0 : date.$d : null);
10590
+ console.log(selectedDate, 'selected');
10591
+ };
10592
+ React.useEffect(function () {
10593
+ if (selectedDate) {
10594
+ console.log(selectedDate, 'selected');
10595
+ dispatch({
10596
+ type: 'SET_DATE_FILTER',
10597
+ payload: selectedDate
10409
10598
  });
10410
10599
  }
10600
+ }, [selectedDate]);
10601
+ //client options
10602
+ var clientOptions = customers == null ? void 0 : customers.map(function (option) {
10603
+ var _option$customer_name, _option$customer_name2;
10604
+ return {
10605
+ label: (option == null || (_option$customer_name = option.customer_name) == null || (_option$customer_name = _option$customer_name.charAt(0)) == null ? void 0 : _option$customer_name.toUpperCase()) + (option == null || (_option$customer_name2 = option.customer_name) == null ? void 0 : _option$customer_name2.slice(1)),
10606
+ value: option == null ? void 0 : option.id
10607
+ };
10608
+ });
10609
+ var handleClientChange = function handleClientChange(value) {
10610
+ console.log(value, 'value');
10611
+ dispatch({
10612
+ type: 'SET_CLIENT_FILTER',
10613
+ payload: value
10614
+ });
10411
10615
  };
10412
10616
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(StyledFiter, null, React__default.createElement(StyledFIlterELements, null, React__default.createElement(LeftSideConatiner, null, React__default.createElement("div", {
10413
10617
  className: "filtercontainer"
@@ -10421,48 +10625,105 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
10421
10625
  className: "dateiconcontainer"
10422
10626
  }, React__default.createElement(DateIcon, null)), React__default.createElement(StyledDatePicker, null, React__default.createElement(antd.DatePicker, {
10423
10627
  className: "custom-datepicker",
10424
- onChange: onChange,
10425
- value: actionDate === null ? actionDate : dayjs(actionDate),
10628
+ onChange: handleDateChange,
10629
+ style: {
10630
+ width: '100px'
10631
+ },
10632
+ value: selectedDate ? dayjs(selectedDate) : null,
10426
10633
  format: "DD/MM/YY",
10427
- placeholder: "Date"
10634
+ placeholder: "Date",
10635
+ needConfirm: true
10428
10636
  }))), React__default.createElement("div", {
10429
10637
  className: "datefilter"
10430
10638
  }, React__default.createElement("div", {
10431
10639
  className: "dateiconcontainer"
10432
- }, ' ', React__default.createElement(StatusIcon, null), ' '), React__default.createElement("div", {
10433
- className: "datetext"
10434
- }, "Status of Order"), React__default.createElement("div", {
10435
- className: "roundbox"
10436
- }, React__default.createElement(DownArrowIcon, null), ' ')), React__default.createElement("div", {
10640
+ }, React__default.createElement(StatusIcon, null)), React__default.createElement(StyledAntSelect$d, null, React__default.createElement(antd.Select, {
10641
+ options: zoneOptions,
10642
+ className: "custom-select",
10643
+ placeholder: "Status of Order",
10644
+ onChange: function onChange() {},
10645
+ style: {
10646
+ minWidth: '115px'
10647
+ },
10648
+ maxTagCount: 0,
10649
+ maxTagPlaceholder: function maxTagPlaceholder(omittedValues) {
10650
+ return React__default.createElement(antd.Tooltip, {
10651
+ overlayStyle: {
10652
+ pointerEvents: 'none'
10653
+ },
10654
+ title: omittedValues.map(function (_ref) {
10655
+ var label = _ref.label;
10656
+ return label;
10657
+ }).join(', ')
10658
+ }, React__default.createElement("span", null, omittedValues.length + " selected"));
10659
+ }
10660
+ }))), React__default.createElement("div", {
10437
10661
  className: "datefilter"
10438
10662
  }, React__default.createElement("div", {
10439
10663
  className: "dateiconcontainer"
10440
- }, React__default.createElement(ClientIcon, null)), React__default.createElement("div", {
10441
- className: "datetext"
10442
- }, "Client"), React__default.createElement("div", {
10443
- className: "roundbox"
10444
- }, React__default.createElement(DownArrowIcon, null))), React__default.createElement("div", {
10664
+ }, React__default.createElement(ClientIcon, null)), React__default.createElement(StyledAntSelect$d, null, React__default.createElement(antd.Select, {
10665
+ options: clientOptions,
10666
+ className: "custom-select",
10667
+ placeholder: "Client",
10668
+ onChange: handleClientChange,
10669
+ style: {
10670
+ width: '125px'
10671
+ },
10672
+ maxTagCount: 0,
10673
+ maxTagPlaceholder: function maxTagPlaceholder(omittedValues) {
10674
+ return React__default.createElement(antd.Tooltip, {
10675
+ overlayStyle: {
10676
+ pointerEvents: 'none'
10677
+ },
10678
+ title: omittedValues.map(function (_ref2) {
10679
+ var label = _ref2.label;
10680
+ return label;
10681
+ }).join(', ')
10682
+ }, React__default.createElement("span", null, omittedValues.length + " selected"));
10683
+ }
10684
+ }))), React__default.createElement("div", {
10445
10685
  className: "datefilter"
10446
10686
  }, React__default.createElement("div", {
10447
10687
  className: "dateiconcontainer"
10448
- }, React__default.createElement(AssigneIcon, null)), React__default.createElement("div", {
10449
- className: "datetext"
10450
- }, "Assignee"), React__default.createElement("div", {
10451
- className: "roundbox"
10452
- }, React__default.createElement(DownArrowIcon, null))))), React__default.createElement(TableFilters, null)));
10688
+ }, React__default.createElement(AssigneIcon, null)), React__default.createElement(StyledAntSelect$d, null, React__default.createElement(antd.Select, {
10689
+ options: zoneOptions,
10690
+ className: "custom-select",
10691
+ placeholder: "Asignee",
10692
+ onChange: function onChange() {},
10693
+ style: {
10694
+ minWidth: '100px'
10695
+ },
10696
+ maxTagCount: 0,
10697
+ maxTagPlaceholder: function maxTagPlaceholder(omittedValues) {
10698
+ return React__default.createElement(antd.Tooltip, {
10699
+ overlayStyle: {
10700
+ pointerEvents: 'none'
10701
+ },
10702
+ title: omittedValues.map(function (_ref3) {
10703
+ var label = _ref3.label;
10704
+ return label;
10705
+ }).join(', ')
10706
+ }, React__default.createElement("span", null, omittedValues.length + " selected"));
10707
+ }
10708
+ }))))), React__default.createElement(TableFilters, null)));
10453
10709
  };
10454
- var StyledDatePicker = /*#__PURE__*/styled__default.div(_templateObject$2k || (_templateObject$2k = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .custom-datepicker {\n border: none;\n width: 80px;\n }\n"])));
10710
+ var StyledDatePicker = /*#__PURE__*/styled__default.div(_templateObject$2j || (_templateObject$2j = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .custom-datepicker {\n border: none;\n }\n"])));
10711
+ // const DropdownContainer = styled.div``;
10712
+ var StyledAntSelect$d = /*#__PURE__*/styled__default.div(_templateObject2$1G || (_templateObject2$1G = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .custom-select {\n border: none;\n width: 80px;\n }\n :where(.css-dev-only-do-not-override-m4timi).ant-select-single:not(.ant-select-customize-input)\n .ant-select-selector {\n padding: 0 5px;\n }\n\n :where(.css-dev-only-do-not-override-m4timi).ant-select-outlined:not(.ant-select-customize-input)\n .ant-select-selector {\n border: none;\n }\n .roundbox {\n display: flex;\n width: 18px;\n height: 18px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n border-radius: 18px;\n background: #fff;\n box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1);\n left: 359px;\n position: absolute;\n border-radius: 18px;\n background: #fff;\n box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1);\n top: 16px;\n }\n"])));
10455
10713
 
10456
- var _templateObject$2l, _templateObject2$1H;
10714
+ var _templateObject$2k, _templateObject2$1H;
10457
10715
  var ReturnAfterTable = function ReturnAfterTable() {
10458
10716
  var _useReturnAfterOrderD = useReturnAfterOrderData(),
10459
- returnAfterOrder = _useReturnAfterOrderD[0],
10460
10717
  setReturnOrderData = _useReturnAfterOrderD[1];
10461
10718
  var _useLoading = useLoading(),
10462
10719
  setLoading = _useLoading[1];
10720
+ var _useAtom = jotai.useAtom(filtersReducerAtom$1),
10721
+ state = _useAtom[0];
10722
+ var filters = state['x-filters'];
10463
10723
  var _useApiHook = dmsComponentLibrary.useApiHook({
10464
10724
  endpoint: '/return_orders/?skip_filters=0',
10465
- method: 'GET'
10725
+ method: 'GET',
10726
+ filters: filters
10466
10727
  }),
10467
10728
  fetchedReturnOrderData = _useApiHook.data,
10468
10729
  staticDataLoading = _useApiHook.loading;
@@ -10472,12 +10733,11 @@ var ReturnAfterTable = function ReturnAfterTable() {
10472
10733
  setReturnOrderData(fetchedReturnOrderData == null ? void 0 : fetchedReturnOrderData.data);
10473
10734
  }
10474
10735
  }, [fetchedReturnOrderData, staticDataLoading]);
10475
- console.log('returnAfterOrder', returnAfterOrder);
10476
10736
  return React__default.createElement("div", null, React__default.createElement(DashBoardWrapper$2, null, React__default.createElement(RouterHeader, null), React__default.createElement("div", {
10477
10737
  className: "Tableconatiner"
10478
10738
  }, React__default.createElement(HeaderFilter, null), React__default.createElement(Container$1e, null, React__default.createElement(ReturnOrderFilter, null), React__default.createElement(OrderTable, null)))));
10479
10739
  };
10480
- var Container$1e = /*#__PURE__*/styled__default.div(_templateObject$2l || (_templateObject$2l = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -30px;\n"])));
10740
+ var Container$1e = /*#__PURE__*/styled__default.div(_templateObject$2k || (_templateObject$2k = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -30px;\n"])));
10481
10741
  var DashBoardWrapper$2 = /*#__PURE__*/styled__default.section(_templateObject2$1H || (_templateObject2$1H = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .Tableconatiner {\n border-radius: 12px;\n background: #fff;\n box-shadow: -2px 0px 12px 0px rgba(56, 71, 109, 0.1);\n display: block;\n padding: 15px 20px;\n }\n .headerWrap,\n .tableData,\n .styleCovered {\n transition: all ease 0.5s;\n }\n &.stickyTableHead {\n h2 {\n font-size: 21px;\n }\n .headerWrap {\n height: 84px;\n padding: 10px;\n border-radius: 0px 0px 15px 15px;\n > div {\n position: relative;\n z-index: 10;\n }\n }\n .styleCovered {\n margin-top: -32px;\n width: 67%;\n float: right;\n gap: 5px;\n padding-right: 11px;\n\n li {\n padding: 4px 10px 5px 5px;\n gap: 5px;\n .svgCover {\n width: 30px;\n height: 30px;\n svg {\n height: auto;\n width: 58%;\n }\n }\n .countDigit {\n font-size: 19px;\n }\n }\n .countMess {\n font-size: 13px;\n }\n }\n .dmsBulkFilter {\n min-height: unset;\n gap: 4px;\n > div {\n padding: 4px 12px;\n label {\n font-size: 11px;\n }\n }\n }\n\n .StyledFilterList {\n gap: 4px;\n li {\n height: 29px;\n padding: 3px 8px;\n gap: 4px;\n .StyledFilterBtnIcon {\n width: 20px;\n height: 20px;\n svh {\n width: 10px;\n height: auto;\n }\n }\n .StyledFilterBtnLabel {\n font-size: 13px;\n }\n }\n }\n .StyledFilterLabel {\n padding-left: 10px;\n span {\n font-size: 13px;\n }\n }\n .cardcontainer.tableData {\n max-height: calc(100vh - 310px);\n min-height: calc(100vh - 310px);\n }\n\n .tableData {\n max-height: calc(100vh - 320px);\n min-height: calc(100vh - 320px);\n\n margin-top: 8px;\n thead {\n position: sticky;\n top: 0;\n z-index: 9;\n th {\n font-size: 13px;\n padding: 2px 15px;\n }\n }\n }\n }\n"])));
10482
10742
 
10483
10743
  var BulkFilter = function BulkFilter() {
@@ -10507,7 +10767,7 @@ var BulkFilter = function BulkFilter() {
10507
10767
  );
10508
10768
  };
10509
10769
 
10510
- var _excluded$2 = ["count"];
10770
+ var _excluded$3 = ["count"];
10511
10771
  // import { useAtom } from 'jotai';
10512
10772
  var Filters = function Filters() {
10513
10773
  var _useRoutesTable = useRoutesTable(),
@@ -10533,11 +10793,15 @@ var Filters = function Filters() {
10533
10793
  if (paginationData !== null) {
10534
10794
  var _JSON$parse = JSON.parse(paginationData),
10535
10795
  count = _JSON$parse.count,
10536
- rest = _objectWithoutPropertiesLoose(_JSON$parse, _excluded$2);
10796
+ rest = _objectWithoutPropertiesLoose(_JSON$parse, _excluded$3);
10537
10797
  setPaginationObject(rest);
10538
10798
  setCount(count);
10539
10799
  } else {
10540
- console.error('Pagination data is null');
10800
+ // console.error('Pagination data is null');
10801
+ antd.notification.error({
10802
+ message: 'Error',
10803
+ description: 'Pagination data is null'
10804
+ });
10541
10805
  }
10542
10806
  }
10543
10807
  }, [apiLoading]);
@@ -10571,7 +10835,7 @@ var ReturnTable$1 = function ReturnTable(_ref) {
10571
10835
  }, [staticDataLoading, fetchedStaticData]);
10572
10836
  return React__default.createElement(React__default.Fragment, null, React__default.createElement(StyledTableWrapper$1, {
10573
10837
  id: "tableScrolling"
10574
- }, React__default.createElement(StyledTable$1, null, React__default.createElement("thead", null, React__default.createElement("tr", null, React__default.createElement("th", null, "Trading Name"), React__default.createElement("th", null, "Client"), React__default.createElement("th", null, "Orders"), React__default.createElement("th", null, "Products"), React__default.createElement("th", null, "Dispose"), React__default.createElement("th", null, "Re-allocate"), React__default.createElement("th", null, "Re-Del"), React__default.createElement("th", null, "Recycle"), React__default.createElement("th", null, "Unknown"))), React__default.createElement("tbody", null, loadingskeleton ? React__default.createElement("tr", null, React__default.createElement("td", {
10838
+ }, React__default.createElement(StyledTable$1, null, React__default.createElement("thead", null, React__default.createElement("tr", null, React__default.createElement("th", null, "Trading Name"), React__default.createElement("th", null, "Client"), React__default.createElement("th", null, "Orders"), React__default.createElement("th", null, "Products"), React__default.createElement("th", null, "RTS"), React__default.createElement("th", null, "Pending"), React__default.createElement("th", null, "Dispose"), React__default.createElement("th", null, "Re-allocate"), React__default.createElement("th", null, "Re-Del"), React__default.createElement("th", null, "Recycle"), React__default.createElement("th", null, "Unknown"))), React__default.createElement("tbody", null, loadingskeleton ? React__default.createElement("tr", null, React__default.createElement("td", {
10575
10839
  colSpan: 9
10576
10840
  }, React__default.createElement(antd.Skeleton, {
10577
10841
  active: true
@@ -10591,11 +10855,11 @@ var ReturnTable$1 = function ReturnTable(_ref) {
10591
10855
  fontWeight: 600,
10592
10856
  paddingLeft: 0
10593
10857
  }
10594
- }, key == null ? void 0 : key.customer_name)), ' '), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key.return_orders))), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key.return_order_products))), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key.DISPOSE))), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key['RE-ALLOCATE']), ' ')), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key['RE-DEL']))), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key.RECYCLE))), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key.UNKNOWN))));
10858
+ }, key == null ? void 0 : key.customer_name)), ' '), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key.return_orders))), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key.return_order_products))), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key.RTS))), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key.PENDING))), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key.DISPOSE))), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key['RE-ALLOCATE']), ' ')), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key['RE-DEL']))), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key.RECYCLE))), React__default.createElement("td", null, React__default.createElement(ColumStyle, null, React__default.createElement(GreyBox, null, key == null ? void 0 : key.UNKNOWN))));
10595
10859
  })))));
10596
10860
  };
10597
10861
 
10598
- var _templateObject$2m, _templateObject2$1I, _templateObject3$Z;
10862
+ var _templateObject$2l, _templateObject2$1I, _templateObject3$Z;
10599
10863
  // import Loader from '../loader/Loader';
10600
10864
  // interface ApiResponse {
10601
10865
  // message: string;
@@ -10644,12 +10908,15 @@ function ReturnMainTable() {
10644
10908
  className: "Tableconatiner"
10645
10909
  }, React__default.createElement(HeaderFilter, null), React__default.createElement(Container$1f, null, React__default.createElement(Row$7, null, React__default.createElement(Text$7, null, "Client Return"), selectedClient ? React__default.createElement(ReturnFilter, null) : React__default.createElement(Filters, null)), React__default.createElement(ReturnTable$1, null)))));
10646
10910
  }
10647
- var Row$7 = /*#__PURE__*/styled__default.div(_templateObject$2m || (_templateObject$2m = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
10911
+ var Row$7 = /*#__PURE__*/styled__default.div(_templateObject$2l || (_templateObject$2l = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
10648
10912
  var Container$1f = /*#__PURE__*/styled__default.div(_templateObject2$1I || (_templateObject2$1I = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -46px;\n"])));
10649
10913
  var DashBoardWrapper$3 = /*#__PURE__*/styled__default.section(_templateObject3$Z || (_templateObject3$Z = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .Tableconatiner {\n border-radius: 12px;\n background: #fff;\n box-shadow: -2px 0px 12px 0px rgba(56, 71, 109, 0.1);\n display: block;\n padding: 15px 20px;\n }\n .headerWrap,\n .tableData,\n .styleCovered {\n transition: all ease 0.5s;\n }\n &.stickyTableHead {\n h2 {\n font-size: 21px;\n }\n .headerWrap {\n height: 84px;\n padding: 10px;\n border-radius: 0px 0px 15px 15px;\n > div {\n position: relative;\n z-index: 10;\n }\n }\n .styleCovered {\n margin-top: -32px;\n width: 67%;\n float: right;\n gap: 5px;\n padding-right: 11px;\n\n li {\n padding: 4px 10px 5px 5px;\n gap: 5px;\n .svgCover {\n width: 30px;\n height: 30px;\n svg {\n height: auto;\n width: 58%;\n }\n }\n .countDigit {\n font-size: 19px;\n }\n }\n .countMess {\n font-size: 13px;\n }\n }\n .dmsBulkFilter {\n min-height: unset;\n gap: 4px;\n > div {\n padding: 4px 12px;\n label {\n font-size: 11px;\n }\n }\n }\n\n .StyledFilterList {\n gap: 4px;\n li {\n height: 29px;\n padding: 3px 8px;\n gap: 4px;\n .StyledFilterBtnIcon {\n width: 20px;\n height: 20px;\n svh {\n width: 10px;\n height: auto;\n }\n }\n .StyledFilterBtnLabel {\n font-size: 13px;\n }\n }\n }\n .StyledFilterLabel {\n padding-left: 10px;\n span {\n font-size: 13px;\n }\n }\n .cardcontainer.tableData {\n max-height: calc(100vh - 310px);\n min-height: calc(100vh - 310px);\n }\n\n .tableData {\n max-height: calc(100vh - 320px);\n min-height: calc(100vh - 320px);\n\n margin-top: 8px;\n thead {\n position: sticky;\n top: 0;\n z-index: 9;\n th {\n font-size: 13px;\n padding: 2px 15px;\n }\n }\n }\n }\n"])));
10650
10914
 
10651
10915
  function ReturnClient() {
10652
10916
  var _selectedClientString;
10917
+ antd.notification.config({
10918
+ top: 80
10919
+ });
10653
10920
  var LoadingMessage = function LoadingMessage() {
10654
10921
  return React__default.createElement("div", null, "Loading...");
10655
10922
  };
@@ -10659,9 +10926,9 @@ function ReturnClient() {
10659
10926
  var selectedClientString = selectedClient == null ? void 0 : selectedClient.replace(/\s+/g, '-');
10660
10927
  selectedClientString = (_selectedClientString = selectedClientString) == null ? void 0 : _selectedClientString.toLowerCase();
10661
10928
  console.log(selectedClientString, 'selectedClient');
10662
- console.log("../return/:" + selectedClientString);
10929
+ console.log("../filter/:" + selectedClientString);
10663
10930
  React.useEffect(function () {
10664
- if (!location.pathname.includes('/return')) {
10931
+ if (!location.pathname.includes('/filter')) {
10665
10932
  localStorage.removeItem('clientName');
10666
10933
  localStorage.removeItem('clientId');
10667
10934
  }
@@ -10669,7 +10936,7 @@ function ReturnClient() {
10669
10936
  React.useEffect(function () {
10670
10937
  if (selectedClient) {
10671
10938
  var _selectedClientString2 = selectedClient.replace(/\s+/g, '-');
10672
- navigate("return/" + _selectedClientString2);
10939
+ navigate("filter/" + _selectedClientString2);
10673
10940
  }
10674
10941
  }, [selectedClient]);
10675
10942
  return React__default.createElement(React.Suspense, {
@@ -10684,7 +10951,7 @@ function ReturnClient() {
10684
10951
  path: "order-return/:id",
10685
10952
  element: React__default.createElement(OrderView, null)
10686
10953
  }), React__default.createElement(reactRouterDom.Route, {
10687
- path: "return/:name",
10954
+ path: "filter/:clientName",
10688
10955
  element: React__default.createElement(ReturnTable, null)
10689
10956
  })));
10690
10957
  }