@bjsdistribution/dms-client-return 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/components/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 +657 -478
  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 +663 -484
  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 +152 -69
  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 +131 -23
  22. package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +15 -1
  23. package/src/components/order-daily-overview/shared/utlis.ts +7 -1
  24. package/src/components/order-daily-overview/table/ReturnTable.tsx +12 -0
  25. package/src/components/order-view/hooks/useGetEventNotes.tsx +15 -2
  26. package/src/components/order-view/hooks/useGetSystemLogs.tsx +14 -2
  27. package/src/components/order-view/hooks/useUpdateOrder.ts +13 -2
  28. package/src/components/order-view/modalsPopup/CreateReturnModal.tsx +14 -17
  29. package/src/components/order-view/modalsPopup/ModalManager.tsx +90 -62
  30. package/src/components/order-view/notes/AddNote.tsx +7 -2
  31. package/src/components/order-view/order-actions/actions/change-customer-account/ChangeCustomerAccModal.tsx +6 -2
  32. package/src/components/order-view/order-actions/actions/escalation/Dropdowns.tsx +5 -0
  33. package/src/components/order-view/order-actions/actions/escalation/upgrade/index.tsx +7 -1
  34. package/src/components/order-view/order-actions/hooks/useAllReminderData.ts +13 -2
  35. package/src/components/order-view/order-actions/hooks/useAllTaskData.ts +15 -5
  36. package/src/components/order-view/order-actions/hooks/useCreateReminder.ts +20 -4
  37. package/src/components/order-view/order-actions/hooks/useCreateTask.ts +14 -3
  38. package/src/components/order-view/order-actions/hooks/useFetchSingleFlagData.ts +15 -3
  39. package/src/components/order-view/order-actions/hooks/useFetchSingleReminder.ts +13 -2
  40. package/src/components/order-view/order-actions/hooks/useUpdateFlag.ts +12 -2
  41. package/src/components/order-view/order-actions/hooks/useUpdateReminder.ts +12 -2
  42. package/src/components/order-view/products-info/expanded-content/index.tsx +6 -1
  43. package/src/components/order-view/return-client-products/product-table-footer/ProductDetailsFooter.tsx +6 -1
  44. package/src/components/order-view/system-event-logs/expanded-content/index.tsx +7 -1
  45. package/src/components/order-view/view-reminder/AssigneeDropdown.tsx +6 -1
  46. package/src/components/store.ts +30 -1
  47. package/src/components/types.ts +8 -0
  48. package/src/index.tsx +8 -4
@@ -1,10 +1,10 @@
1
1
  import React, { useEffect, useState, useMemo, useRef, Suspense } from 'react';
2
2
  import { useLocation, useParams, NavLink, useNavigate, Routes, Route } from 'react-router-dom';
3
3
  import styled, { css, keyframes } from 'styled-components';
4
- import { Label as Label$h, Input as Input$1, TextArea, FormSection, displayValueOrNA, SelectDropdown, dropdownStyles, RadioButtonGroup as RadioButtonGroup$1, Switch, Button as Button$1, useApiHook, getBaseEndpoint, formatDateTime, Alert, Checkbox as Checkbox$1, SectionHeader, CrossIcon, AntSelect, AntTable, CustomRating, DeleteIcon, CancelationModal, CancelAndCompleteAction, filterDropdownStyles, BackgroundModal as BackgroundModal$1, AntModal } from '@bjsdistribution/dms-component-library';
4
+ import { Label as Label$h, Input as Input$1, TextArea, FormSection, displayValueOrNA as displayValueOrNA$1, SelectDropdown, dropdownStyles, RadioButtonGroup as RadioButtonGroup$1, Switch, Button as Button$1, useApiHook, getBaseEndpoint, formatDateTime, Alert, Checkbox as Checkbox$1, SectionHeader, CrossIcon, AntSelect, AntTable, CustomRating, DeleteIcon, CancelationModal, CancelAndCompleteAction, filterDropdownStyles, BackgroundModal as BackgroundModal$1, AntModal } from '@bjsdistribution/dms-component-library';
5
5
  import { useAtom, atom } from 'jotai';
6
6
  import { atomWithReducer } from 'jotai/utils';
7
- import { DatePicker, notification, Skeleton, Upload, message, Input as Input$2, Select, Empty, Checkbox as Checkbox$2, Tabs } from 'antd';
7
+ import { DatePicker, notification, Skeleton, Upload, message, Input as Input$2, Select, Empty, Checkbox as Checkbox$2, Tabs, Tooltip } from 'antd';
8
8
  import dayjs from 'dayjs';
9
9
  import { useReactTable, getCoreRowModel, getSortedRowModel, flexRender } from '@tanstack/react-table';
10
10
  import Scrollbars from 'react-custom-scrollbars-2';
@@ -1351,8 +1351,8 @@ function ConsignmentNumber() {
1351
1351
  return React.createElement(Container$d, null, React.createElement(Wrapper$8, null, React.createElement(Label$h, {
1352
1352
  label: "Consignment Number"
1353
1353
  }), React.createElement(CopyText, {
1354
- text: displayValueOrNA(orderDetails.consignment)
1355
- })), React.createElement(Consignment, null, displayValueOrNA(orderDetails.consignment)));
1354
+ text: displayValueOrNA$1(orderDetails.consignment)
1355
+ })), React.createElement(Consignment, null, displayValueOrNA$1(orderDetails.consignment)));
1356
1356
  }
1357
1357
  var Wrapper$8 = /*#__PURE__*/styled.div(_templateObject$g || (_templateObject$g = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 5px;\n"])));
1358
1358
  var Consignment = /*#__PURE__*/styled.span(_templateObject2$e || (_templateObject2$e = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #249e45;\n font-family: 'Lato', sans-serif;\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n"])));
@@ -2330,14 +2330,18 @@ function AddNote() {
2330
2330
  description: error || 'Something went wrong. Please try again.'
2331
2331
  });
2332
2332
  }
2333
- _context.next = 18;
2333
+ _context.next = 17;
2334
2334
  break;
2335
2335
  case 14:
2336
2336
  _context.prev = 14;
2337
2337
  _context.t0 = _context["catch"](6);
2338
- console.error('Error saving note:', _context.t0);
2339
- alert('Failed to save note');
2340
- case 18:
2338
+ // console.error('Error saving note:', error);
2339
+ // alert('Failed to save note');
2340
+ notification.error({
2341
+ message: 'Error',
2342
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
2343
+ });
2344
+ case 17:
2341
2345
  case "end":
2342
2346
  return _context.stop();
2343
2347
  }
@@ -2819,8 +2823,11 @@ function useGetEventNotes() {
2819
2823
  case 9:
2820
2824
  _json = _context.sent;
2821
2825
  detail = _json == null ? void 0 : _json.detail;
2822
- msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
2823
- console.error('Error response:', msg);
2826
+ msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // console.error('Error response:', msg);
2827
+ notification.error({
2828
+ message: 'Error',
2829
+ description: "" + msg || 'An error has occurred. Please try again later.'
2830
+ });
2824
2831
  // setLoading(false);
2825
2832
  return _context.abrupt("return", []);
2826
2833
  case 14:
@@ -2838,7 +2845,11 @@ function useGetEventNotes() {
2838
2845
  case 22:
2839
2846
  _context.prev = 22;
2840
2847
  _context.t0 = _context["catch"](1);
2841
- console.error('Error fetching data:', _context.t0);
2848
+ // console.error('Error fetching data:', err);
2849
+ notification.error({
2850
+ message: 'Error',
2851
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
2852
+ });
2842
2853
  return _context.abrupt("return", []);
2843
2854
  case 26:
2844
2855
  _context.prev = 26;
@@ -2885,7 +2896,11 @@ function SystemLogs() {
2885
2896
  case 7:
2886
2897
  _context.prev = 7;
2887
2898
  _context.t0 = _context["catch"](0);
2888
- console.error('Error fetching event notes:', _context.t0);
2899
+ // console.error('Error fetching event notes:', error);
2900
+ notification.error({
2901
+ message: 'Error',
2902
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
2903
+ });
2889
2904
  case 10:
2890
2905
  case "end":
2891
2906
  return _context.stop();
@@ -3128,9 +3143,9 @@ function GeneralHeader() {
3128
3143
  var Section = /*#__PURE__*/styled.div(_templateObject$V || (_templateObject$V = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* display: flex;\n background: #ffffff;\n // padding: 15px;\n flex-direction: column;\n gap: 14px;\n border-radius: 12px;\n box-shadow: 0px 4px 30px 0px rgba(46, 45, 116, 0.05);\n border: 1px solid #e0e0e0; */\n"])));
3129
3144
 
3130
3145
  var _templateObject19, _templateObject20, _templateObject21;
3131
- var StyledTable = /*#__PURE__*/styled.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"])));
3146
+ var StyledTable = /*#__PURE__*/styled.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 .awaiting {\n display: flex;\n min-width: 85px;\n padding: 6px 10px;\n justify-content: center;\n align-items: center;\n gap: 5px;\n border-radius: 22px;\n background: rgba(233, 82, 82, 0.15);\n color: #e95252;\n font-family: 'Open Sans';\n font-size: 12px;\n font-weight: 600;\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"])));
3132
3147
  // Styled components
3133
- var StyledTableWrapper = /*#__PURE__*/styled.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"])));
3148
+ var StyledTableWrapper = /*#__PURE__*/styled.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"])));
3134
3149
  var CustomDrop = /*#__PURE__*/styled.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"])));
3135
3150
 
3136
3151
  var ActionIcon = function ActionIcon() {
@@ -3150,9 +3165,19 @@ var ActionIcon = function ActionIcon() {
3150
3165
  }));
3151
3166
  };
3152
3167
 
3168
+ var CreateReturnInitial = {
3169
+ customer_id: 0,
3170
+ account_number: '',
3171
+ return_location_token: '',
3172
+ products: [],
3173
+ return_action: []
3174
+ };
3153
3175
  var customerData = /*#__PURE__*/atom([]);
3154
3176
  var actionTypeData = /*#__PURE__*/atom([]);
3155
3177
  var locationData = /*#__PURE__*/atom([]);
3178
+ var createReturnPayload = /*#__PURE__*/atom(CreateReturnInitial);
3179
+ var newPayload = /*#__PURE__*/atom([]);
3180
+ var grpPayload = /*#__PURE__*/atom([]);
3156
3181
  var selectedOrderlList = /*#__PURE__*/atom([]);
3157
3182
  function useSelectedOrders() {
3158
3183
  return useAtom(selectedOrderlList);
@@ -3171,6 +3196,15 @@ function useActionType() {
3171
3196
  function useLocationData() {
3172
3197
  return useAtom(locationData);
3173
3198
  }
3199
+ function useReturnPayload() {
3200
+ return useAtom(createReturnPayload);
3201
+ }
3202
+ function useNewReturnPayload() {
3203
+ return useAtom(newPayload);
3204
+ }
3205
+ function useGroupedPayload() {
3206
+ return useAtom(grpPayload);
3207
+ }
3174
3208
 
3175
3209
  var ReturnProductTable = function ReturnProductTable() {
3176
3210
  var _useSelectedOrders = useSelectedOrders(),
@@ -3219,7 +3253,11 @@ var Container$B = /*#__PURE__*/styled.div(_templateObject$W || (_templateObject$
3219
3253
  var _templateObject$X, _templateObject2$C, _templateObject3$k;
3220
3254
  function ExpandedContent$2() {
3221
3255
  var SaveNote = function SaveNote() {
3222
- alert('saved');
3256
+ // alert('saved');
3257
+ notification.success({
3258
+ message: 'Success',
3259
+ description: ' Saved successfully.'
3260
+ });
3223
3261
  };
3224
3262
  return React.createElement(Container$C, null, React.createElement(ProductTable, null), React.createElement(MidConatiner, null, React.createElement(SaveNoteContainer$1, null, React.createElement(Button$1, {
3225
3263
  style: {
@@ -4770,7 +4808,11 @@ function ChangeCustomerAccModal() {
4770
4808
  setCurrentAction(undefined);
4771
4809
  };
4772
4810
  var handleSelectChange = function handleSelectChange() {
4773
- alert('hello');
4811
+ // alert('hello');
4812
+ notification.success({
4813
+ message: 'Success',
4814
+ description: 'Saved successfully.'
4815
+ });
4774
4816
  };
4775
4817
  return React.createElement(OrderActionModal, {
4776
4818
  headerTitle: "Change customer account",
@@ -4900,6 +4942,10 @@ var StyledAntSelect = /*#__PURE__*/styled(AntSelect)(_templateObject3$y || (_tem
4900
4942
  var Dropdowns = function Dropdowns() {
4901
4943
  var handleSelectChange = function handleSelectChange() {
4902
4944
  // alert('hello');
4945
+ notification.success({
4946
+ message: 'Success',
4947
+ description: 'Saved successfully.'
4948
+ });
4903
4949
  };
4904
4950
  return React.createElement(FlexContainer, null, React.createElement(InnerCont, null, React.createElement(Label$h, {
4905
4951
  label: "Escalation Category",
@@ -4973,7 +5019,11 @@ var Notes$2 = function Notes() {
4973
5019
  var _templateObject$1w, _templateObject2$14, _templateObject3$z, _templateObject4$i, _templateObject5$a, _templateObject6$8, _templateObject7$7, _templateObject8$4, _templateObject9$2, _templateObject10$1;
4974
5020
  var Upgrade = function Upgrade() {
4975
5021
  var handleSelectChange = function handleSelectChange() {
4976
- alert('hello');
5022
+ // alert('hello');
5023
+ notification.success({
5024
+ message: 'Success',
5025
+ description: 'Upgrade successfully.'
5026
+ });
4977
5027
  };
4978
5028
  return React.createElement(React.Fragment, null, React.createElement(Wrapper$g, null, React.createElement(Heading$2, null, "Upgrade"), React.createElement(Container$_, null, React.createElement(Top$3, null, React.createElement(InnerCont$1, null, React.createElement(Toggle, {
4979
5029
  label: 'Timed Service',
@@ -5535,7 +5585,11 @@ var RestoreProducts = function RestoreProducts() {
5535
5585
  var _templateObject$1B, _templateObject2$17;
5536
5586
  function AssigneeDropdown() {
5537
5587
  var handleSelectChange = function handleSelectChange() {
5538
- alert('hello');
5588
+ // alert('hello');
5589
+ notification.success({
5590
+ message: 'Success',
5591
+ description: 'Order has been saved successfully.'
5592
+ });
5539
5593
  };
5540
5594
  return React.createElement(FormContainer$2, null, React.createElement(Label$h, {
5541
5595
  label: "Assigned To",
@@ -5755,8 +5809,11 @@ function useFetchSingleReminderData() {
5755
5809
  case 10:
5756
5810
  _json = _context.sent;
5757
5811
  detail = _json == null ? void 0 : _json.detail;
5758
- msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
5759
- alert("" + msg);
5812
+ msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // alert(`${msg}`);
5813
+ notification.error({
5814
+ message: 'Error',
5815
+ description: "" + msg || 'An error has occurred. Please try again later.'
5816
+ });
5760
5817
  setLoading(false);
5761
5818
  return _context.abrupt("return", []);
5762
5819
  case 16:
@@ -5776,7 +5833,11 @@ function useFetchSingleReminderData() {
5776
5833
  _context.prev = 25;
5777
5834
  _context.t0 = _context["catch"](2);
5778
5835
  //setloading(false);
5779
- console.error('Error fetching data:', _context.t0);
5836
+ // console.error('Error fetching data:', err);
5837
+ notification.error({
5838
+ message: 'Error',
5839
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
5840
+ });
5780
5841
  return _context.abrupt("return", []);
5781
5842
  case 29:
5782
5843
  case "end":
@@ -5863,12 +5924,20 @@ function useUpdateReminder() {
5863
5924
  return response.json();
5864
5925
  case 11:
5865
5926
  json = _context.sent;
5866
- alert('Reminder has been updated');
5927
+ // alert('Reminder has been updated');
5928
+ notification.success({
5929
+ message: 'Success',
5930
+ description: 'Reminder has been updated'
5931
+ });
5867
5932
  return _context.abrupt("return", json);
5868
5933
  case 16:
5869
5934
  _context.prev = 16;
5870
5935
  _context.t0 = _context["catch"](2);
5871
- console.error('Error:', _context.t0);
5936
+ // console.error('Error:', err);
5937
+ notification.error({
5938
+ message: 'Error',
5939
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
5940
+ });
5872
5941
  case 19:
5873
5942
  _context.prev = 19;
5874
5943
  setLoading(false);
@@ -5932,8 +6001,11 @@ function useFetchReminders() {
5932
6001
  case 9:
5933
6002
  _json = _context.sent;
5934
6003
  detail = _json == null ? void 0 : _json.detail;
5935
- msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
5936
- console.error('Error response:', msg);
6004
+ msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // console.error('Error response:', msg);
6005
+ notification.error({
6006
+ message: 'Error',
6007
+ description: "" + msg || 'An error has occurred. Please try again later.'
6008
+ });
5937
6009
  // setLoading(false);
5938
6010
  return _context.abrupt("return", []);
5939
6011
  case 14:
@@ -5953,7 +6025,11 @@ function useFetchReminders() {
5953
6025
  case 23:
5954
6026
  _context.prev = 23;
5955
6027
  _context.t0 = _context["catch"](1);
5956
- console.error('Error fetching data:', _context.t0);
6028
+ // console.error('Error fetching data:', err);
6029
+ notification.error({
6030
+ message: 'Error',
6031
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
6032
+ });
5957
6033
  return _context.abrupt("return", []);
5958
6034
  case 27:
5959
6035
  _context.prev = 27;
@@ -6216,7 +6292,14 @@ var CustomSwitchSelector = function CustomSwitchSelector(_ref) {
6216
6292
  if (typeof selectedOptionValue === 'string') {
6217
6293
  onSwitchChange(selectedOptionValue);
6218
6294
  } else {
6219
- console.error('Unexpected type for selectedOptionValue:', typeof selectedOptionValue);
6295
+ // console.error(
6296
+ // 'Unexpected type for selectedOptionValue:',
6297
+ // typeof selectedOptionValue
6298
+ // );
6299
+ notification.error({
6300
+ message: 'Error',
6301
+ description: "" + typeof selectedOptionValue || 'Unexpected type for selectedOptionValue.'
6302
+ });
6220
6303
  }
6221
6304
  };
6222
6305
  return React.createElement(StyledSwitch, null, React.createElement(SwitchSelector, {
@@ -6666,7 +6749,11 @@ function useCreateTask() {
6666
6749
  setLoading(false);
6667
6750
  throw new Error('response is not ok');
6668
6751
  case 10:
6669
- alert('Task Created Successfully');
6752
+ // alert('Task Created Successfully');
6753
+ notification.success({
6754
+ message: 'Success',
6755
+ description: 'Task Created Successfully'
6756
+ });
6670
6757
  _context.next = 13;
6671
6758
  return response.json();
6672
6759
  case 13:
@@ -6676,19 +6763,23 @@ function useCreateTask() {
6676
6763
  _context.prev = 17;
6677
6764
  _context.t0 = _context["catch"](2);
6678
6765
  setLoading(false);
6679
- alert(_context.t0);
6680
- console.error('Error:', _context.t0);
6681
- case 22:
6682
- _context.prev = 22;
6766
+ // alert(err);
6767
+ // console.error('Error:', err);
6768
+ notification.error({
6769
+ message: 'Error',
6770
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
6771
+ });
6772
+ case 21:
6773
+ _context.prev = 21;
6683
6774
  setLoading(false);
6684
- return _context.finish(22);
6685
- case 25:
6775
+ return _context.finish(21);
6776
+ case 24:
6686
6777
  setLoading(false);
6687
- case 26:
6778
+ case 25:
6688
6779
  case "end":
6689
6780
  return _context.stop();
6690
6781
  }
6691
- }, _callee, null, [[2, 17, 22, 25]]);
6782
+ }, _callee, null, [[2, 17, 21, 24]]);
6692
6783
  }));
6693
6784
  return function create(_x) {
6694
6785
  return _ref.apply(this, arguments);
@@ -6726,9 +6817,17 @@ function useCreateReminder() {
6726
6817
  response = _context.sent;
6727
6818
  if (!response.ok) {
6728
6819
  setLoading(false);
6729
- alert('response is not ok');
6820
+ // alert('response is not ok');
6821
+ notification.error({
6822
+ message: 'Error',
6823
+ description: 'response is not ok'
6824
+ });
6730
6825
  }
6731
- alert('Reminder Created Successfully');
6826
+ // alert('Reminder Created Successfully');
6827
+ notification.success({
6828
+ message: 'Success',
6829
+ description: 'Reminder Created Successfully'
6830
+ });
6732
6831
  _context.next = 11;
6733
6832
  return response.json();
6734
6833
  case 11:
@@ -6738,19 +6837,23 @@ function useCreateReminder() {
6738
6837
  _context.prev = 15;
6739
6838
  _context.t0 = _context["catch"](2);
6740
6839
  setLoading(false);
6741
- alert(_context.t0);
6742
- console.error('Error:', _context.t0);
6743
- case 20:
6744
- _context.prev = 20;
6840
+ // alert(err);
6841
+ // console.error('Error:', err);
6842
+ notification.error({
6843
+ message: 'Error',
6844
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
6845
+ });
6846
+ case 19:
6847
+ _context.prev = 19;
6745
6848
  setLoading(false);
6746
- return _context.finish(20);
6747
- case 23:
6849
+ return _context.finish(19);
6850
+ case 22:
6748
6851
  setLoading(false);
6749
- case 24:
6852
+ case 23:
6750
6853
  case "end":
6751
6854
  return _context.stop();
6752
6855
  }
6753
- }, _callee, null, [[2, 15, 20, 23]]);
6856
+ }, _callee, null, [[2, 15, 19, 22]]);
6754
6857
  }));
6755
6858
  return function create(_x) {
6756
6859
  return _ref.apply(this, arguments);
@@ -6805,8 +6908,11 @@ function useFetchUnresolvedTasks() {
6805
6908
  case 9:
6806
6909
  _json = _context.sent;
6807
6910
  detail = _json == null ? void 0 : _json.detail;
6808
- msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
6809
- console.error('Error response:', msg);
6911
+ msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // console.error('Error response:', msg);
6912
+ notification.error({
6913
+ message: 'Error',
6914
+ description: "" + msg || 'An error has occurred. Please try again later.'
6915
+ });
6810
6916
  setLoading(false);
6811
6917
  return _context.abrupt("return", []);
6812
6918
  case 15:
@@ -6826,7 +6932,11 @@ function useFetchUnresolvedTasks() {
6826
6932
  case 25:
6827
6933
  _context.prev = 25;
6828
6934
  _context.t0 = _context["catch"](1);
6829
- console.error('Error fetching data:', _context.t0);
6935
+ // console.error('Error fetching data:', err);
6936
+ notification.error({
6937
+ message: 'Error',
6938
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
6939
+ });
6830
6940
  setLoading(false);
6831
6941
  return _context.abrupt("return", []);
6832
6942
  case 30:
@@ -7058,13 +7168,21 @@ function useUpdateOrder() {
7058
7168
  return response.json();
7059
7169
  case 13:
7060
7170
  json = _context.sent;
7061
- alert('Order has been updated');
7171
+ // alert('Order has been updated');
7172
+ notification.success({
7173
+ message: 'Success',
7174
+ description: 'Order has been updated.'
7175
+ });
7062
7176
  return _context.abrupt("return", json);
7063
7177
  case 18:
7064
7178
  _context.prev = 18;
7065
7179
  _context.t0 = _context["catch"](4);
7066
7180
  // setLoading(false);
7067
- console.log(_context.t0, 'error');
7181
+ // console.log(err, 'error');
7182
+ notification.error({
7183
+ message: 'Error',
7184
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
7185
+ });
7068
7186
  case 21:
7069
7187
  _context.prev = 21;
7070
7188
  return _context.finish(21);
@@ -7172,12 +7290,20 @@ function useUpdateFlag() {
7172
7290
  return response.json();
7173
7291
  case 11:
7174
7292
  json = _context.sent;
7175
- alert('Flag has been updated');
7293
+ // alert('Flag has been updated');
7294
+ notification.success({
7295
+ message: 'Success',
7296
+ description: 'Flag has been updated'
7297
+ });
7176
7298
  return _context.abrupt("return", json);
7177
7299
  case 16:
7178
7300
  _context.prev = 16;
7179
7301
  _context.t0 = _context["catch"](2);
7180
- console.error('Error:', _context.t0);
7302
+ // console.error('Error:', err);
7303
+ notification.error({
7304
+ message: 'Error',
7305
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
7306
+ });
7181
7307
  case 19:
7182
7308
  _context.prev = 19;
7183
7309
  setLoading(false);
@@ -7509,7 +7635,7 @@ function useFetchSingleFlagsData() {
7509
7635
  loading = _useFlagsLoading[0],
7510
7636
  setLoading = _useFlagsLoading[1];
7511
7637
  var ssoToken = getCookie('id_token');
7512
- console.log(loading, "loading loading");
7638
+ console.log(loading, 'loading loading');
7513
7639
  var res = /*#__PURE__*/function () {
7514
7640
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
7515
7641
  var endpoint, headers, response, _detail$, _json, detail, msg, json;
@@ -7539,8 +7665,11 @@ function useFetchSingleFlagsData() {
7539
7665
  case 9:
7540
7666
  _json = _context.sent;
7541
7667
  detail = _json == null ? void 0 : _json.detail;
7542
- msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
7543
- alert("" + msg);
7668
+ msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // alert(`${msg}`);
7669
+ notification.error({
7670
+ message: 'Error',
7671
+ description: "" + msg || 'An error has occurred. Please try again later.'
7672
+ });
7544
7673
  setLoading(false);
7545
7674
  return _context.abrupt("return", []);
7546
7675
  case 15:
@@ -7560,7 +7689,11 @@ function useFetchSingleFlagsData() {
7560
7689
  _context.prev = 24;
7561
7690
  _context.t0 = _context["catch"](1);
7562
7691
  setLoading(false);
7563
- console.error('Error fetching data:', _context.t0);
7692
+ // console.error('Error fetching data:', err);
7693
+ notification.error({
7694
+ message: 'Error',
7695
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
7696
+ });
7564
7697
  return _context.abrupt("return", []);
7565
7698
  case 29:
7566
7699
  case "end":
@@ -7848,8 +7981,11 @@ function useSystemLogs() {
7848
7981
  case 9:
7849
7982
  _json = _context.sent;
7850
7983
  detail = _json == null ? void 0 : _json.detail;
7851
- msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
7852
- console.error('Error response:', msg);
7984
+ msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // console.error('Error response:', msg);
7985
+ notification.error({
7986
+ message: 'Error',
7987
+ description: "" + msg || 'An error has occurred. Please try again later.'
7988
+ });
7853
7989
  // setLoading(false);
7854
7990
  return _context.abrupt("return", []);
7855
7991
  case 14:
@@ -7869,7 +8005,11 @@ function useSystemLogs() {
7869
8005
  case 23:
7870
8006
  _context.prev = 23;
7871
8007
  _context.t0 = _context["catch"](1);
7872
- console.error('Error fetching data:', _context.t0);
8008
+ // console.error('Error fetching data:', err);
8009
+ notification.error({
8010
+ message: 'Error',
8011
+ description: "" + _context.t0 || 'An error has occurred. Please try again later.'
8012
+ });
7873
8013
  return _context.abrupt("return", []);
7874
8014
  case 27:
7875
8015
  _context.prev = 27;
@@ -8185,6 +8325,16 @@ function SelectionFilter() {
8185
8325
  var _useState4 = useState(false),
8186
8326
  isButtonEnabled = _useState4[0],
8187
8327
  setIsButtonEnabled = _useState4[1];
8328
+ var _useReturnPayload = useReturnPayload(),
8329
+ setReturnPayload = _useReturnPayload[1];
8330
+ var _useState5 = useState(),
8331
+ storedAccNumber = _useState5[0],
8332
+ setStoredAccNumber = _useState5[1];
8333
+ var _useState6 = useState(),
8334
+ storedCustomerId = _useState6[0],
8335
+ setStoredCustomerId = _useState6[1];
8336
+ var _useNewReturnPayload = useNewReturnPayload(),
8337
+ setNewPayload = _useNewReturnPayload[1];
8188
8338
  //client options
8189
8339
  var clientOptions = customers == null ? void 0 : customers.map(function (option) {
8190
8340
  var _option$customer_name, _option$customer_name2;
@@ -8192,7 +8342,9 @@ function SelectionFilter() {
8192
8342
  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)),
8193
8343
  value: (option == null ? void 0 : option.id) + "_" + (option == null ? void 0 : option.uuid),
8194
8344
  id: option == null ? void 0 : option.id,
8195
- uuid: option == null ? void 0 : option.uuid
8345
+ uuid: option == null ? void 0 : option.uuid,
8346
+ account_number: option == null ? void 0 : option.account_number,
8347
+ gsit_customer_id: option == null ? void 0 : option.gsit_customer_id
8196
8348
  };
8197
8349
  });
8198
8350
  var actionTypeOptions = actionType == null ? void 0 : actionType.map(function (option) {
@@ -8210,14 +8362,28 @@ function SelectionFilter() {
8210
8362
  });
8211
8363
  //client change
8212
8364
  var handleSelectChange = function handleSelectChange(value, option) {
8365
+ setNewPayload([]);
8213
8366
  console.log(value, 'value');
8214
8367
  var selectedLabel = option == null ? void 0 : option.label;
8215
8368
  var selectedValue = option == null ? void 0 : option.id;
8216
8369
  var selectedUuids = option == null ? void 0 : option.uuid;
8370
+ var selectAccountNumber = option.account_number;
8371
+ var selectedCustomerId = option.gsit_customer_id;
8217
8372
  setSelectedClient(selectedValue);
8218
8373
  setName(selectedLabel);
8219
8374
  localStorage.setItem('clientName', selectedLabel);
8220
8375
  localStorage.setItem('clientId', selectedValue.toString());
8376
+ localStorage.setItem('account_number', selectAccountNumber);
8377
+ localStorage.setItem('customer_id', selectedCustomerId.toString());
8378
+ var storedAccNo = localStorage.getItem('account_number');
8379
+ var storedCustomerId = localStorage.getItem('customer_id');
8380
+ setReturnPayload(function (prevState) {
8381
+ return _extends({}, prevState, {
8382
+ account_number: storedAccNo,
8383
+ customer_id: storedCustomerId
8384
+ });
8385
+ });
8386
+ console.log(selectedUuids, 'selectedUuids');
8221
8387
  var filteredSubLocations = locationData == null ? void 0 : locationData.filter(function (subCat) {
8222
8388
  return (subCat == null ? void 0 : subCat.customer_id) === selectedUuids;
8223
8389
  }).map(function (subCat) {
@@ -8229,6 +8395,24 @@ function SelectionFilter() {
8229
8395
  setFilteredLocationOptions(filteredSubLocations);
8230
8396
  setUuid('');
8231
8397
  };
8398
+ useEffect(function () {
8399
+ var accountNumberFromStorage = localStorage.getItem('account_number');
8400
+ var customerIdFromStorage = localStorage.getItem('customer_id');
8401
+ if (accountNumberFromStorage) {
8402
+ setStoredAccNumber(accountNumberFromStorage);
8403
+ }
8404
+ if (customerIdFromStorage) {
8405
+ setStoredCustomerId(customerIdFromStorage);
8406
+ }
8407
+ if (storedAccNumber && storedCustomerId) {
8408
+ setReturnPayload(function (prevState) {
8409
+ return _extends({}, prevState, {
8410
+ account_number: storedAccNumber,
8411
+ customer_id: storedCustomerId
8412
+ });
8413
+ });
8414
+ }
8415
+ }, [storedAccNumber, storedCustomerId]);
8232
8416
  useEffect(function () {}, [getUuid, filteredLocationOptions]);
8233
8417
  //location change
8234
8418
  var handleLocationChange = function handleLocationChange(value, option) {
@@ -8293,6 +8477,7 @@ function SelectionFilter() {
8293
8477
  setIsButtonEnabled(false);
8294
8478
  }
8295
8479
  }, [storedName, selectedFilterValue, selectedLocationValue]);
8480
+ console.log(filteredLocationOptions, 'filteredLocationOptions');
8296
8481
  console.log('check', storedName, selectedFilterValue, selectedLocationValue);
8297
8482
  return React.createElement(Wrapper$k, null, React.createElement(FilterRow, null, React.createElement(LeftColumn, null, React.createElement(FilterColumn, null, React.createElement(Label$g, null, "Clients"), React.createElement(StyledAntSelect$5, {
8298
8483
  options: clientOptions,
@@ -8377,7 +8562,7 @@ function HeaderFilter() {
8377
8562
  if (fetchedStaticData && fetchedStaticData != null && fetchedStaticData.data) {
8378
8563
  var _fetchedStaticData$da;
8379
8564
  setActionType(fetchedStaticData == null || (_fetchedStaticData$da = fetchedStaticData.data) == null ? void 0 : _fetchedStaticData$da.flatMap(function (i) {
8380
- return i.order_contact_action_type;
8565
+ return i == null ? void 0 : i.order_product_return_action;
8381
8566
  }));
8382
8567
  }
8383
8568
  }, [actionLoading, fetchedStaticData]);
@@ -8391,7 +8576,7 @@ function HeaderFilter() {
8391
8576
 
8392
8577
  var _templateObject$1$, _templateObject4$v, _templateObject5$k, _templateObject7$d, _templateObject8$8;
8393
8578
  //Left side
8394
- var LeftSideConatiner = /*#__PURE__*/styled.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"])));
8579
+ var LeftSideConatiner = /*#__PURE__*/styled.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"])));
8395
8580
  //
8396
8581
  var StyledFiter = /*#__PURE__*/styled.div(_templateObject4$v || (_templateObject4$v = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
8397
8582
  var StyledFIlterELements = /*#__PURE__*/styled.div(_templateObject5$k || (_templateObject5$k = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 0;\n gap: 10px;\n align-items: center;\n"])));
@@ -8461,8 +8646,8 @@ var IconText = /*#__PURE__*/styled.div(_templateObject5$l || (_templateObject5$l
8461
8646
 
8462
8647
  var ReturnFilter = function ReturnFilter() {
8463
8648
  var _useParams = useParams(),
8464
- selectedClient = _useParams.selectedClient;
8465
- return React.createElement(React.Fragment, null, React.createElement(StyledFiter, null, React.createElement(Text$7, null, " ", selectedClient), React.createElement(StyledFIlterELements, null, React.createElement(StyledTableFilter, null)), React.createElement(RightFilters, null)));
8649
+ clientName = _useParams.clientName;
8650
+ return React.createElement(React.Fragment, null, React.createElement(StyledFiter, null, React.createElement(Text$7, null, " ", clientName), React.createElement(StyledFIlterELements, null, React.createElement(StyledTableFilter, null)), React.createElement(RightFilters, null)));
8466
8651
  };
8467
8652
 
8468
8653
  var _templateObject$22, _templateObject2$1s, _templateObject3$P, _templateObject4$x, _templateObject34;
@@ -8623,6 +8808,16 @@ var formatDate$1 = function formatDate(date) {
8623
8808
  // const seconds = padZero(date.getSeconds());
8624
8809
  return year + "-" + month + "-" + day;
8625
8810
  };
8811
+ var displayValueOrNA = function displayValueOrNA(value) {
8812
+ var isBlankArray = Array.isArray(value) && value.length === 0;
8813
+ if (value === 0) {
8814
+ return 0;
8815
+ }
8816
+ if (value === 'NA' || value === undefined || value === null || isBlankArray) {
8817
+ return 'NA';
8818
+ }
8819
+ return value;
8820
+ };
8626
8821
 
8627
8822
  var optionsPrint = [{
8628
8823
  icon: 'runSheet',
@@ -8681,6 +8876,14 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
8681
8876
  var _usePrintOptionTOggle = usePrintOptionTOggle(),
8682
8877
  printToogle = _usePrintOptionTOggle[0],
8683
8878
  setPrintToggle = _usePrintOptionTOggle[1];
8879
+ var _useReturnPayload = useReturnPayload(),
8880
+ createReturn = _useReturnPayload[0],
8881
+ setReturnPayload = _useReturnPayload[1];
8882
+ var _useNewReturnPayload = useNewReturnPayload(),
8883
+ newpayload = _useNewReturnPayload[0],
8884
+ setNewPayload = _useNewReturnPayload[1];
8885
+ var _useGroupedPayload = useGroupedPayload(),
8886
+ setGrouped = _useGroupedPayload[1];
8684
8887
  var OpenDropDown = function OpenDropDown(index) {
8685
8888
  setPrintToggle(function (prevIndex) {
8686
8889
  return prevIndex === index ? null : index;
@@ -8715,41 +8918,109 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
8715
8918
  var handleSelectAll = function handleSelectAll(e) {
8716
8919
  setSelectAll(e.target.checked);
8717
8920
  if (e.target.checked) {
8718
- setSelectedReturnOrder(returnData.map(function (invoice) {
8921
+ setSelectedReturnOrder(returnData == null ? void 0 : returnData.map(function (loc) {
8922
+ var _loc$return_locations;
8719
8923
  return {
8720
- id: invoice.id,
8721
- status_id: 3
8924
+ id: loc.id,
8925
+ return_locations: loc == null ? void 0 : loc.return_locations,
8926
+ return_location: loc == null ? void 0 : loc.return_location,
8927
+ products: loc.id,
8928
+ order_product_return_action: loc == null ? void 0 : loc.order_product_return_action,
8929
+ return_location_token: loc == null || (_loc$return_locations = loc.return_locations) == null ? void 0 : _loc$return_locations.token
8930
+ };
8931
+ }));
8932
+ setNewPayload(returnData == null ? void 0 : returnData.map(function (loc) {
8933
+ var _loc$order_product_re, _loc$return_locations2;
8934
+ return {
8935
+ id: loc.id,
8936
+ account_number: createReturn == null ? void 0 : createReturn.account_number,
8937
+ customer_id: createReturn == null ? void 0 : createReturn.customer_id,
8938
+ products: loc.id,
8939
+ return_action: (loc == null || (_loc$order_product_re = loc.order_product_return_action) == null ? void 0 : _loc$order_product_re.type) || null,
8940
+ return_location_token: loc == null || (_loc$return_locations2 = loc.return_locations) == null ? void 0 : _loc$return_locations2.token
8722
8941
  };
8723
8942
  }));
8724
8943
  } else {
8725
8944
  setSelectedReturnOrder([]);
8726
8945
  }
8727
8946
  };
8728
- var handleSelectInvoice = function handleSelectInvoice(id) {
8729
- setSelectedReturnOrder(function (prevSelectedInvoices) {
8730
- var isSelected = prevSelectedInvoices == null ? void 0 : prevSelectedInvoices.some(function (invoice) {
8731
- return invoice.id === id;
8947
+ var handleSelectOrderReturn = function handleSelectOrderReturn(id, return_location, return_locations, order_product_return_action) {
8948
+ setSelectedReturnOrder(function (prevSelectedLocations) {
8949
+ var isSelected = prevSelectedLocations == null ? void 0 : prevSelectedLocations.some(function (loc) {
8950
+ return loc.id === id;
8732
8951
  });
8733
8952
  if (isSelected) {
8734
- return prevSelectedInvoices.filter(function (invoice) {
8735
- return invoice.id !== id;
8953
+ var updatedSelectedLocations = prevSelectedLocations.filter(function (loc) {
8954
+ return loc.id !== id;
8955
+ });
8956
+ setReturnPayload(function (prevState) {
8957
+ return _extends({}, prevState, {
8958
+ products: id,
8959
+ return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
8960
+ return_location_token: (return_locations == null ? void 0 : return_locations.token) || null
8961
+ });
8736
8962
  });
8963
+ setNewPayload(function (prevPayload) {
8964
+ return prevPayload.filter(function (item) {
8965
+ return item.id !== id;
8966
+ });
8967
+ });
8968
+ return updatedSelectedLocations;
8737
8969
  } else {
8738
- return [].concat(prevSelectedInvoices, [{
8970
+ var newReturnPayload = {
8739
8971
  id: id,
8740
- status_id: 3
8972
+ account_number: createReturn == null ? void 0 : createReturn.account_number,
8973
+ customer_id: createReturn == null ? void 0 : createReturn.customer_id,
8974
+ products: id,
8975
+ return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
8976
+ return_location_token: (return_locations == null ? void 0 : return_locations.token) || null
8977
+ };
8978
+ setNewPayload(function (prevPayload) {
8979
+ return [].concat(prevPayload, [newReturnPayload]);
8980
+ });
8981
+ setReturnPayload(function (prevState) {
8982
+ return _extends({}, prevState, {
8983
+ products: id,
8984
+ return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
8985
+ return_location_token: (return_locations == null ? void 0 : return_locations.token) || null
8986
+ });
8987
+ });
8988
+ return [].concat(prevSelectedLocations, [{
8989
+ id: id,
8990
+ return_location: return_location,
8991
+ return_locations: return_locations,
8992
+ order_product_return_action: order_product_return_action
8741
8993
  }]);
8742
8994
  }
8743
8995
  });
8744
8996
  };
8745
- return React.createElement(React.Fragment, null, React.createElement(StyledTableWrapper, {
8746
- id: "tableScrolling"
8747
- }, React.createElement(StyledTable, null, React.createElement("thead", null, React.createElement("tr", null, React.createElement("th", {
8997
+ useEffect(function () {
8998
+ if ((newpayload == null ? void 0 : newpayload.length) === 0) return;
8999
+ var groupedPayload = newpayload == null ? void 0 : newpayload.reduce(function (acc, item) {
9000
+ var return_location_token = item.return_location_token;
9001
+ if (!return_location_token) {
9002
+ acc.push(item);
9003
+ } else {
9004
+ if (!acc[return_location_token]) {
9005
+ acc[return_location_token] = _extends({}, item, {
9006
+ products: [],
9007
+ return_action: []
9008
+ });
9009
+ }
9010
+ acc[return_location_token].products = [].concat(acc[return_location_token].products, item.products);
9011
+ acc[return_location_token].return_action = [].concat(acc[return_location_token].return_action, item.return_action);
9012
+ }
9013
+ return acc;
9014
+ }, []);
9015
+ var mergedPayload = Object.values(groupedPayload);
9016
+ setGrouped(mergedPayload);
9017
+ }, [newpayload]);
9018
+ return React.createElement(React.Fragment, null, React.createElement(StyledTableWrapper, null, React.createElement(StyledTable, null, React.createElement("thead", null, React.createElement("tr", null, React.createElement("th", {
8748
9019
  className: "emailInvoiceCheckbox"
8749
9020
  }, React.createElement(Checkbox$1, {
8750
9021
  checked: selectAll,
8751
9022
  onChange: handleSelectAll
8752
- })), React.createElement("th", null, "Product Location"), React.createElement("th", null, "Return Location"), React.createElement("th", null, "Recipient"), React.createElement("th", null, "Code"), React.createElement("th", null, " Description"), React.createElement("th", null, "Part"), React.createElement("th", null, "Weight"), React.createElement("th", null, " CBM"), React.createElement("th", null, "Return Reason"), React.createElement("th", null, "Collected"), React.createElement("th", null, "Collection Reason"), React.createElement("th", {
9023
+ })), React.createElement("th", null, "Product Location"), React.createElement("th", null, "Return Location"), React.createElement("th", null, "Recipient"), React.createElement("th", null, "Code"), React.createElement("th", null, "Description"), React.createElement("th", null, "Part"), React.createElement("th", null, "Weight"), React.createElement("th", null, "CBM"), React.createElement("th", null, "Return Reason"), React.createElement("th", null, "Collected"), React.createElement("th", null, "Collection Reason"), React.createElement("th", {
8753
9024
  className: "emailInvoiceShare"
8754
9025
  }, "Labels"))), React.createElement("tbody", null, loadingskeleton ? React.createElement("tr", null, React.createElement("td", {
8755
9026
  colSpan: 6
@@ -8768,9 +9039,11 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
8768
9039
  return (selectedInvoice == null ? void 0 : selectedInvoice.id) === item.id;
8769
9040
  }),
8770
9041
  onChange: function onChange() {
8771
- return handleSelectInvoice(item.id);
9042
+ return handleSelectOrderReturn(item.id, item.return_location, item.return_locations, item.order_product_return_action);
8772
9043
  }
8773
- })), React.createElement("td", null, displayValueOrNA(item == null || (_item$orders_products = item.orders_products_stock) == null ? void 0 : _item$orders_products.location)), React.createElement("td", null, " ", displayValueOrNA(item == null ? void 0 : item.return_location)), React.createElement("td", null, React.createElement("ul", {
9044
+ })), React.createElement("td", null, item != null && (_item$orders_products = item.orders_products_stock) != null && _item$orders_products.location ? null : React.createElement("div", {
9045
+ className: "awaiting"
9046
+ }, "Awating")), React.createElement("td", null, " ", displayValueOrNA(item == null ? void 0 : item.return_location)), React.createElement("td", null, React.createElement("ul", {
8774
9047
  style: {
8775
9048
  listStyleType: 'none',
8776
9049
  padding: 0
@@ -8785,7 +9058,7 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
8785
9058
  style: {
8786
9059
  color: '#888075'
8787
9060
  }
8788
- }, displayValueOrNA(item == null || (_item$order_data2 = item.order_data) == null || (_item$order_data2 = _item$order_data2.order_recipient) == null ? void 0 : _item$order_data2.postcode)))), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.code)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.description)), React.createElement("td", null, "N/A"), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.weight), "KG"), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.cube)), React.createElement("td", null, displayValueOrNA(item == null || (_item$return_reasons = item.return_reasons) == null ? void 0 : _item$return_reasons.reason)), React.createElement("td", null, "N/A"), React.createElement("td", null, displayValueOrNA(item == null || (_item$collection_reas = item.collection_reasons) == null ? void 0 : _item$collection_reas.reason)), React.createElement("td", null, React.createElement("ul", {
9061
+ }, displayValueOrNA(item == null || (_item$order_data2 = item.order_data) == null || (_item$order_data2 = _item$order_data2.order_recipient) == null ? void 0 : _item$order_data2.postcode)))), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.code)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.description)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.parts_count)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.weight), "KG"), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.cube)), React.createElement("td", null, displayValueOrNA(item == null || (_item$return_reasons = item.return_reasons) == null ? void 0 : _item$return_reasons.reason)), React.createElement("td", null, "N/A"), React.createElement("td", null, displayValueOrNA(item == null || (_item$collection_reas = item.collection_reasons) == null ? void 0 : _item$collection_reas.reason)), React.createElement("td", null, React.createElement("ul", {
8789
9062
  className: "actionbox"
8790
9063
  }, React.createElement(CustomDrop, {
8791
9064
  ref: dropdownRefParent,
@@ -9303,161 +9576,7 @@ var ProductAction = function ProductAction() {
9303
9576
  var GLobalPopupContent$4 = /*#__PURE__*/styled.div(_templateObject$2c || (_templateObject$2c = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9304
9577
  var Container$1a = /*#__PURE__*/styled.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"])));
9305
9578
 
9306
- var BarCode = function BarCode() {
9307
- return React.createElement("svg", {
9308
- xmlns: "http://www.w3.org/2000/svg",
9309
- width: "18",
9310
- height: "18",
9311
- viewBox: "0 0 18 18",
9312
- fill: "none"
9313
- }, React.createElement("path", {
9314
- 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",
9315
- fill: "#3A3630",
9316
- fillOpacity: "0.8"
9317
- }));
9318
- };
9319
-
9320
- var WeightIcon = function WeightIcon() {
9321
- return React.createElement("svg", {
9322
- xmlns: "http://www.w3.org/2000/svg",
9323
- width: "18",
9324
- height: "18",
9325
- viewBox: "0 0 18 18",
9326
- fill: "none"
9327
- }, React.createElement("path", {
9328
- 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",
9329
- fill: "#3A3630",
9330
- fillOpacity: "0.6"
9331
- }));
9332
- };
9333
-
9334
- var CbmIcon = function CbmIcon() {
9335
- return React.createElement("svg", {
9336
- xmlns: "http://www.w3.org/2000/svg",
9337
- width: "18",
9338
- height: "18",
9339
- viewBox: "0 0 18 18",
9340
- fill: "none"
9341
- }, React.createElement("path", {
9342
- 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",
9343
- fill: "#3A3630",
9344
- fillOpacity: "0.6"
9345
- }));
9346
- };
9347
-
9348
- var _templateObject$2d, _templateObject2$1C;
9349
- var AddProduct = function AddProduct() {
9350
- var _orderStaticData$orde;
9351
- var _useCreateOrderProduc = useCreateOrderProducts(),
9352
- orderProduct = _useCreateOrderProduc[0],
9353
- setOrderProduct = _useCreateOrderProduc[1];
9354
- var _useOrderStaticData = useOrderStaticData(),
9355
- orderStaticData = _useOrderStaticData[0];
9356
- var typeOptions = orderStaticData == null || (_orderStaticData$orde = orderStaticData.order_product_type) == null ? void 0 : _orderStaticData$orde.map(function (option) {
9357
- return {
9358
- label: option == null ? void 0 : option.type,
9359
- value: option == null ? void 0 : option.id
9360
- };
9361
- });
9362
- var handleInputChange = function handleInputChange(index, field, value) {
9363
- setOrderProduct(function (prevProducts) {
9364
- var _extends2;
9365
- var newProducts = [].concat(prevProducts);
9366
- newProducts[index] = _extends({}, newProducts[index], (_extends2 = {}, _extends2[field] = value, _extends2));
9367
- return newProducts;
9368
- });
9369
- };
9370
- var onSelectChange = function onSelectChange(index, value) {
9371
- handleInputChange(index, 'product_type_id', +value);
9372
- };
9373
- var onSearch = function onSearch(value) {
9374
- console.log('search item value:', value);
9375
- };
9376
- return React.createElement(GLobalPopupContent$5, null, React.createElement(SimpleTable, null, React.createElement("table", null, React.createElement("thead", null, React.createElement("tr", null, React.createElement("th", null, "Product Type"), React.createElement("th", {
9377
- style: {
9378
- width: '130px'
9379
- }
9380
- }, React.createElement("span", null, "Code ", React.createElement("em", null, "*"))), React.createElement("th", {
9381
- style: {
9382
- width: '33%'
9383
- }
9384
- }, React.createElement("span", null, "Description ", React.createElement("em", null, "*"))), React.createElement("th", null, "Barcode"), React.createElement("th", {
9385
- style: {
9386
- width: '120px'
9387
- }
9388
- }, "Weight"), React.createElement("th", {
9389
- style: {
9390
- width: '120px'
9391
- }
9392
- }, "CBM"))), React.createElement("tbody", null, orderProduct.length > 0 && (orderProduct == null ? void 0 : orderProduct.map(function (item, index) {
9393
- return React.createElement("tr", {
9394
- key: index
9395
- }, React.createElement("td", null, React.createElement(AntSelect, {
9396
- options: typeOptions,
9397
- placeholder: "Deliver",
9398
- onChange: function onChange(value) {
9399
- return onSelectChange(index, value);
9400
- },
9401
- disabled: false,
9402
- style: {
9403
- width: 120
9404
- },
9405
- onSearch: onSearch,
9406
- showSearch: true,
9407
- popupClassName: 'dropDownStyle',
9408
- selectWrapperClass: ''
9409
- })), React.createElement("td", null, React.createElement("div", {
9410
- className: "inputWrap"
9411
- }, React.createElement("input", {
9412
- type: "text",
9413
- placeholder: "code",
9414
- value: item.code,
9415
- onChange: function onChange(e) {
9416
- return handleInputChange(index, 'code', e.target.value);
9417
- }
9418
- }))), React.createElement("td", null, React.createElement("div", {
9419
- className: "inputWrap"
9420
- }, React.createElement("input", {
9421
- type: "text",
9422
- placeholder: "Enter Description of Product",
9423
- value: item.description,
9424
- onChange: function onChange(e) {
9425
- return handleInputChange(index, 'description', e.target.value);
9426
- }
9427
- }))), React.createElement("td", null, React.createElement("div", {
9428
- className: "inputWrap"
9429
- }, React.createElement("input", {
9430
- type: "text",
9431
- placeholder: "Enter barcode of product",
9432
- value: item.sku,
9433
- onChange: function onChange(e) {
9434
- return handleInputChange(index, 'sku', e.target.value);
9435
- }
9436
- }), React.createElement(BarCode, null))), React.createElement("td", null, React.createElement("div", {
9437
- className: "inputWrap"
9438
- }, React.createElement("input", {
9439
- type: "text",
9440
- placeholder: "00.00",
9441
- value: item.weight,
9442
- onChange: function onChange(e) {
9443
- return handleInputChange(index, 'weight', parseFloat(e.target.value));
9444
- }
9445
- }), React.createElement(WeightIcon, null))), React.createElement("td", null, React.createElement("div", {
9446
- className: "inputWrap"
9447
- }, React.createElement("input", {
9448
- type: "text",
9449
- placeholder: "00.00",
9450
- value: item.cube,
9451
- onChange: function onChange(e) {
9452
- return handleInputChange(index, 'cube', parseFloat(e.target.value));
9453
- }
9454
- }), React.createElement(CbmIcon, null))));
9455
- }))))));
9456
- };
9457
- var GLobalPopupContent$5 = /*#__PURE__*/styled.div(_templateObject$2d || (_templateObject$2d = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9458
- var SimpleTable = /*#__PURE__*/styled.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"])));
9459
-
9460
- var _templateObject$2e;
9579
+ var _templateObject$2d;
9461
9580
  var LogsTable = function LogsTable() {
9462
9581
  var options = [{
9463
9582
  value: 'bjsCouriers',
@@ -9532,9 +9651,9 @@ var LogsTable = function LogsTable() {
9532
9651
  }
9533
9652
  })));
9534
9653
  };
9535
- var GlobalPopupContent = /*#__PURE__*/styled.div(_templateObject$2e || (_templateObject$2e = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9654
+ var GlobalPopupContent = /*#__PURE__*/styled.div(_templateObject$2d || (_templateObject$2d = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9536
9655
 
9537
- var _templateObject$2f, _templateObject2$1D;
9656
+ var _templateObject$2e, _templateObject2$1C;
9538
9657
  var DefectsModal = function DefectsModal() {
9539
9658
  var options = [{
9540
9659
  value: 'bjsCouriers',
@@ -9577,7 +9696,7 @@ var DefectsModal = function DefectsModal() {
9577
9696
  key: 'images',
9578
9697
  title: 'Images'
9579
9698
  }];
9580
- return React.createElement(React.Fragment, null, React.createElement(GLobalPopupContent$6, null, React.createElement(StyledConatiner, null, React.createElement(AntTable, {
9699
+ return React.createElement(React.Fragment, null, React.createElement(GLobalPopupContent$5, null, React.createElement(StyledConatiner, null, React.createElement(AntTable, {
9581
9700
  columns: columns,
9582
9701
  data: DefectsData,
9583
9702
  selectOptions: options,
@@ -9586,10 +9705,10 @@ var DefectsModal = function DefectsModal() {
9586
9705
  }
9587
9706
  }))));
9588
9707
  };
9589
- var StyledConatiner = /*#__PURE__*/styled.div(_templateObject$2f || (_templateObject$2f = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* tex: nowrap; */\n"])));
9590
- var GLobalPopupContent$6 = /*#__PURE__*/styled.div(_templateObject2$1D || (_templateObject2$1D = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9708
+ var StyledConatiner = /*#__PURE__*/styled.div(_templateObject$2e || (_templateObject$2e = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* tex: nowrap; */\n"])));
9709
+ var GLobalPopupContent$5 = /*#__PURE__*/styled.div(_templateObject2$1C || (_templateObject2$1C = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9591
9710
 
9592
- var _templateObject$2g;
9711
+ var _templateObject$2f;
9593
9712
  var repackModal = function repackModal() {
9594
9713
  var columns = [{
9595
9714
  key: 'packaging_type',
@@ -9619,28 +9738,24 @@ var repackModal = function repackModal() {
9619
9738
  }
9620
9739
  }))));
9621
9740
  };
9622
- var StyledConatiner$1 = /*#__PURE__*/styled.div(_templateObject$2g || (_templateObject$2g = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* text-wrap: nowrap; */\n"])));
9741
+ var StyledConatiner$1 = /*#__PURE__*/styled.div(_templateObject$2f || (_templateObject$2f = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* text-wrap: nowrap; */\n"])));
9623
9742
 
9624
- var _templateObject$2h, _templateObject2$1E, _templateObject3$X;
9743
+ var _templateObject$2g, _templateObject2$1D, _templateObject3$X;
9625
9744
  var CreateReturnModal = function CreateReturnModal() {
9626
- var _useState = useState(),
9745
+ var _useState = useState([]),
9746
+ selectedlocation = _useState[0],
9627
9747
  setSelectedLocations = _useState[1];
9628
- var _useLocationData = useLocationData(),
9629
- locationData = _useLocationData[0];
9748
+ var _useSelectedOrders = useSelectedOrders(),
9749
+ selectedReturnOrder = _useSelectedOrders[0];
9630
9750
  var handleSelectLocations = function handleSelectLocations(id) {
9631
9751
  setSelectedLocations(function (prevSelectedLocations) {
9632
- var isSelected = prevSelectedLocations == null ? void 0 : prevSelectedLocations.some(function (location) {
9633
- return location.id === id;
9634
- });
9752
+ var isSelected = prevSelectedLocations.includes(id);
9635
9753
  if (isSelected) {
9636
- return prevSelectedLocations.filter(function (invoice) {
9637
- return invoice.id !== id;
9754
+ return prevSelectedLocations.filter(function (selectedId) {
9755
+ return selectedId !== id;
9638
9756
  });
9639
9757
  } else {
9640
- return [].concat(prevSelectedLocations, [{
9641
- id: id,
9642
- status_id: 3
9643
- }]);
9758
+ return [].concat(prevSelectedLocations, [id]);
9644
9759
  }
9645
9760
  });
9646
9761
  };
@@ -9655,38 +9770,38 @@ var CreateReturnModal = function CreateReturnModal() {
9655
9770
  listStyle: 'none',
9656
9771
  padding: 0
9657
9772
  }
9658
- }, locationData == null ? void 0 : locationData.map(function (invoice) {
9773
+ }, selectedReturnOrder == null ? void 0 : selectedReturnOrder.map(function (returnLoc) {
9659
9774
  return React.createElement("li", {
9660
- key: invoice.id,
9775
+ key: returnLoc.id,
9661
9776
  style: {
9662
9777
  marginBottom: '8px',
9663
9778
  display: 'flex',
9664
9779
  alignItems: 'center'
9665
9780
  }
9666
9781
  }, React.createElement(Checkbox$1, {
9667
- checked: true,
9782
+ checked: selectedlocation.includes(returnLoc.id),
9668
9783
  onChange: function onChange() {
9669
- return handleSelectLocations(invoice.id);
9784
+ return handleSelectLocations(returnLoc.id);
9670
9785
  }
9671
9786
  }), React.createElement(StyledText$1, {
9672
9787
  style: {
9673
9788
  marginLeft: '8px'
9674
9789
  }
9675
- }, invoice.location_name));
9790
+ }, returnLoc == null ? void 0 : returnLoc.return_location));
9676
9791
  }))));
9677
9792
  };
9678
- var StyledText$1 = /*#__PURE__*/styled.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"])));
9679
- var Container$1b = /*#__PURE__*/styled.div(_templateObject2$1E || (_templateObject2$1E = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9793
+ var StyledText$1 = /*#__PURE__*/styled.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"])));
9794
+ var Container$1b = /*#__PURE__*/styled.div(_templateObject2$1D || (_templateObject2$1D = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
9680
9795
  var Wrapper$l = /*#__PURE__*/styled.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"])));
9681
9796
 
9797
+ var _excluded$2 = ["id"];
9682
9798
  var ModalManager = function ModalManager() {
9683
9799
  var _useAtom = useAtom(countReducerAtom),
9684
9800
  popupName = _useAtom[0],
9685
9801
  dispatch = _useAtom[1];
9686
9802
  var _useProductDetails = useProductDetails();
9687
9803
  var _useCreateOrderProduc = useCreateOrderProducts(),
9688
- orderProduct = _useCreateOrderProduc[0],
9689
- setOrderProduct = _useCreateOrderProduc[1];
9804
+ orderProduct = _useCreateOrderProduc[0];
9690
9805
  var _useOrderId = useOrderId(),
9691
9806
  orderId = _useOrderId[0];
9692
9807
  var _useDeleteProdsID = useDeleteProdsID(),
@@ -9703,6 +9818,9 @@ var ModalManager = function ModalManager() {
9703
9818
  selectedTab = _useAtom3[0];
9704
9819
  var _useState = useState(false),
9705
9820
  setIsFormValid = _useState[1];
9821
+ var _useNewReturnPayload = useNewReturnPayload(),
9822
+ newPayload = _useNewReturnPayload[0],
9823
+ setNewPayload = _useNewReturnPayload[1];
9706
9824
  console.log(orderProduct, 'abcabcabcabcabcabcabcabcabcabcabc');
9707
9825
  var _closeModal = function closeModal() {
9708
9826
  dispatch({
@@ -9753,68 +9871,73 @@ var ModalManager = function ModalManager() {
9753
9871
  // }
9754
9872
  // };
9755
9873
  // API block for creating product order
9756
- var _useApiHook = useApiHook({
9757
- endpoint: "order/order_products/create/",
9758
- method: 'POST',
9759
- body: [orderProduct],
9760
- performAction: false
9761
- }),
9762
- response = _useApiHook.data,
9763
- setOrderAction = _useApiHook.setShouldPerformAction;
9764
- var validateAddForm = function validateAddForm() {
9765
- if (!Array.isArray(orderProduct)) return false;
9766
- return orderProduct.every(function (product) {
9767
- return product.code !== '' && product.description !== '' && product.weight !== 0 && product.cube !== 0 && product.order_product_type_id !== 0 && product.sku !== '';
9768
- });
9769
- };
9770
- useEffect(function () {
9771
- setAddIsFormValid(validateAddForm());
9772
- }, [orderProduct]);
9773
- var onAddOrderProduct = function onAddOrderProduct() {
9774
- if (isAddFormValid) {
9775
- setOrderProduct(function (prev) {
9776
- return prev.map(function (product) {
9777
- return _extends({}, product, {
9778
- order_id: orderId
9779
- });
9780
- });
9781
- });
9782
- setOrderAction(true);
9783
- } else {
9784
- console.log('Please fill in all required fields before proceeding.');
9785
- }
9786
- };
9787
- useEffect(function () {
9788
- if (response && response != null && response.data) {
9789
- dispatch({
9790
- type: 'close'
9791
- });
9792
- }
9793
- }, [response]);
9794
- var _useState2 = useState(false),
9795
- isAddFormValid = _useState2[0],
9796
- setAddIsFormValid = _useState2[1];
9797
- var AddMore = function AddMore() {
9798
- setOrderProduct(function (prevProducts) {
9799
- return [].concat(prevProducts, [{
9800
- code: '',
9801
- description: '',
9802
- sku: '',
9803
- weight: '',
9804
- cube: '',
9805
- order_product_type_id: ''
9806
- }]);
9807
- });
9808
- };
9874
+ // const {
9875
+ // data: response,
9876
+ // setShouldPerformAction: setOrderAction,
9877
+ // } = useApiHook<{
9878
+ // data: ApiResponse[];
9879
+ // }>({
9880
+ // endpoint: `order/order_products/create/`,
9881
+ // method: 'POST',
9882
+ // body: [orderProduct],
9883
+ // performAction: false,
9884
+ // });
9885
+ // const validateAddForm = () => {
9886
+ // if (!Array.isArray(orderProduct)) return false;
9887
+ // return orderProduct.every(
9888
+ // (product: any) =>
9889
+ // product.code !== '' &&
9890
+ // product.description !== '' &&
9891
+ // product.weight !== 0 &&
9892
+ // product.cube !== 0 &&
9893
+ // product.order_product_type_id !== 0 &&
9894
+ // product.sku !== ''
9895
+ // );
9896
+ // };
9897
+ // useEffect(() => {
9898
+ // setAddIsFormValid(validateAddForm());
9899
+ // }, [orderProduct]);
9900
+ // const onAddOrderProduct = () => {
9901
+ // if (isAddFormValid) {
9902
+ // setOrderProduct((prev: any) =>
9903
+ // prev.map((product: any) => ({
9904
+ // ...product,
9905
+ // order_id: orderId,
9906
+ // }))
9907
+ // );
9908
+ // setOrderAction(true);
9909
+ // } else {
9910
+ // console.log('Please fill in all required fields before proceeding.');
9911
+ // }
9912
+ // };
9913
+ // useEffect(() => {
9914
+ // if (response && response?.data) {
9915
+ // dispatch({ type: 'close' });
9916
+ // }
9917
+ // }, [response]);
9918
+ // const [isAddFormValid, setAddIsFormValid] = useState(false);
9919
+ // const AddMore = () => {
9920
+ // setOrderProduct((prevProducts: any) => [
9921
+ // ...prevProducts,
9922
+ // {
9923
+ // code: '',
9924
+ // description: '',
9925
+ // sku: '',
9926
+ // weight: '',
9927
+ // cube: '',
9928
+ // order_product_type_id: '',
9929
+ // },
9930
+ // ]);
9931
+ // };
9809
9932
  // api block for the create product order
9810
- var _useApiHook2 = useApiHook({
9933
+ var _useApiHook = useApiHook({
9811
9934
  endpoint: "order/order_products/unrecieve/",
9812
9935
  method: 'POST',
9813
9936
  body: [unRecieve],
9814
9937
  performAction: false
9815
9938
  }),
9816
- actionResponse = _useApiHook2.data,
9817
- setUnrecieveaction = _useApiHook2.setShouldPerformAction;
9939
+ actionResponse = _useApiHook.data,
9940
+ setUnrecieveaction = _useApiHook.setShouldPerformAction;
9818
9941
  useEffect(function () {
9819
9942
  if (actionResponse && actionResponse != null && actionResponse.data) {
9820
9943
  dispatch({
@@ -9823,14 +9946,14 @@ var ModalManager = function ModalManager() {
9823
9946
  }
9824
9947
  }, [actionResponse]);
9825
9948
  // api block for the update product order
9826
- var _useApiHook3 = useApiHook({
9949
+ var _useApiHook2 = useApiHook({
9827
9950
  endpoint: "order/order_products/type/update/",
9828
9951
  method: 'PUT',
9829
9952
  body: [updateOrderProduct],
9830
9953
  performAction: false
9831
9954
  }),
9832
- updateResponse = _useApiHook3.data,
9833
- setUpdateSction = _useApiHook3.setShouldPerformAction;
9955
+ updateResponse = _useApiHook2.data,
9956
+ setUpdateSction = _useApiHook2.setShouldPerformAction;
9834
9957
  // const onUnrecieveProductOrder = () => {
9835
9958
  // setUnRecieve((prev: any) => ({
9836
9959
  // ...prev,
@@ -9869,6 +9992,28 @@ var ModalManager = function ModalManager() {
9869
9992
  });
9870
9993
  }
9871
9994
  }, [updateResponse]);
9995
+ //Confirm return popup
9996
+ var _useApiHook3 = useApiHook({
9997
+ endpoint: "return_orders/",
9998
+ method: 'POST',
9999
+ body: [newPayload],
10000
+ performAction: false
10001
+ }),
10002
+ response = _useApiHook3.data,
10003
+ setShouldPerformAction = _useApiHook3.setShouldPerformAction;
10004
+ var handleConfirmReturn = function handleConfirmReturn() {
10005
+ var payloadWithoutId = newPayload == null ? void 0 : newPayload.map(function (_ref) {
10006
+ var rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
10007
+ return _extends({}, rest);
10008
+ });
10009
+ console.log(response);
10010
+ if (payloadWithoutId) {
10011
+ setNewPayload(payloadWithoutId);
10012
+ setShouldPerformAction(true);
10013
+ } else {
10014
+ setShouldPerformAction(false);
10015
+ }
10016
+ };
9872
10017
  return React.createElement(React.Fragment, null, (popupName == null ? void 0 : popupName.state) == 'create-return' && React.createElement(AntModal, {
9873
10018
  openStatus: (popupName == null ? void 0 : popupName.state) == 'create-return' ? true : false,
9874
10019
  closeModal: function closeModal() {
@@ -9882,37 +10027,15 @@ var ModalManager = function ModalManager() {
9882
10027
  btns: [{
9883
10028
  name: 'Submit',
9884
10029
  btnStyle: 'rounded',
9885
- type: 'button'
10030
+ onClick: handleConfirmReturn,
10031
+ type: 'button',
10032
+ disabled: !newPayload
9886
10033
  }],
9887
10034
  btnAlign: 'justifyEnd'
9888
10035
  },
9889
10036
  BodyComponent: CreateReturnModal,
9890
10037
  width: 800,
9891
10038
  classNameAdd: 'globalPopup'
9892
- }), (popupName == null ? void 0 : popupName.state) === 'addProduct' && React.createElement(AntModal, {
9893
- openStatus: (popupName == null ? void 0 : popupName.state) === 'addProduct',
9894
- closeModal: _closeModal,
9895
- PopupHeader: {
9896
- heading: 'Add Product(s) to Order',
9897
- subHeading: 'Full Stock Control'
9898
- },
9899
- PopupFooter: {
9900
- btns: [{
9901
- name: 'Add More Product',
9902
- btnStyle: 'normalLink',
9903
- icon: 'addIcon',
9904
- onClick: AddMore
9905
- }, {
9906
- name: 'Save Details',
9907
- btnStyle: 'rounded',
9908
- onClick: onAddOrderProduct,
9909
- disabled: !isAddFormValid
9910
- }],
9911
- btnAlign: 'justifySpaceBetween'
9912
- },
9913
- BodyComponent: AddProduct,
9914
- width: 1104,
9915
- classNameAdd: 'globalPopup'
9916
10039
  }), (popupName == null ? void 0 : popupName.state) === 'qclog' && React.createElement(AntModal, {
9917
10040
  openStatus: (popupName == null ? void 0 : popupName.state) === 'qclog',
9918
10041
  closeModal: _closeModal,
@@ -9985,14 +10108,14 @@ var ModalManager = function ModalManager() {
9985
10108
  }));
9986
10109
  };
9987
10110
 
9988
- var _templateObject$2i, _templateObject2$1F;
10111
+ var _templateObject$2h, _templateObject2$1E;
9989
10112
  var ReturnTable = function ReturnTable() {
9990
10113
  return React.createElement("div", null, React.createElement(DashBoardWrapper$1, null, React.createElement(RouterHeader, null), React.createElement("div", {
9991
10114
  className: "Tableconatiner"
9992
10115
  }, React.createElement(HeaderFilter, null), React.createElement(Container$1c, null, React.createElement(ReturnFilter, null), React.createElement(ReturnOrderTable, null)))), React.createElement(ModalManager, null));
9993
10116
  };
9994
- var Container$1c = /*#__PURE__*/styled.div(_templateObject$2i || (_templateObject$2i = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -46px;\n"])));
9995
- var DashBoardWrapper$1 = /*#__PURE__*/styled.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"])));
10117
+ var Container$1c = /*#__PURE__*/styled.div(_templateObject$2h || (_templateObject$2h = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -46px;\n"])));
10118
+ var DashBoardWrapper$1 = /*#__PURE__*/styled.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"])));
9996
10119
 
9997
10120
  function LoadIcon() {
9998
10121
  return React.createElement("svg", {
@@ -10158,7 +10281,7 @@ var OrderTable = function OrderTable(_ref) {
10158
10281
  onChange: function onChange() {
10159
10282
  return handleSelectInvoice(item.id);
10160
10283
  }
10161
- })), React.createElement("td", null, formatDate$1(new Date(item == null ? void 0 : item.created_at))), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.return_locations)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.pick_up_location)), React.createElement("td", {
10284
+ })), React.createElement("td", null, formatDate$1(new Date(item == null ? void 0 : item.created_at))), React.createElement("td", null, displayValueOrNA$1(item == null ? void 0 : item.return_locations)), React.createElement("td", null, displayValueOrNA$1(item == null ? void 0 : item.pick_up_location)), React.createElement("td", {
10162
10285
  onClick: function onClick() {
10163
10286
  return setOrderId(item.id);
10164
10287
  }
@@ -10175,11 +10298,11 @@ var OrderTable = function OrderTable(_ref) {
10175
10298
  }
10176
10299
  }, React.createElement(NavLink, {
10177
10300
  to: "" + item.id
10178
- }, displayValueOrNA(item == null || (_item$order_recipient = item.order_recipient) == null ? void 0 : _item$order_recipient.recipient_name))), React.createElement("li", {
10301
+ }, displayValueOrNA$1(item == null || (_item$order_recipient = item.order_recipient) == null ? void 0 : _item$order_recipient.recipient_name))), React.createElement("li", {
10179
10302
  style: {
10180
10303
  color: '#888075'
10181
10304
  }
10182
- }, displayValueOrNA(item == null || (_item$order_recipient2 = item.order_recipient) == null ? void 0 : _item$order_recipient2.postcode)))), React.createElement("td", null, displayValueOrNA(item == null || (_item$customer_data = item.customer_data) == null ? void 0 : _item$customer_data.customer_name)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.consignment)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.order_number)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.box_count)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.weight), "KG"), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.cube)), React.createElement("td", null, React.createElement(AntSelect, {
10305
+ }, displayValueOrNA$1(item == null || (_item$order_recipient2 = item.order_recipient) == null ? void 0 : _item$order_recipient2.postcode)))), React.createElement("td", null, displayValueOrNA$1(item == null || (_item$customer_data = item.customer_data) == null ? void 0 : _item$customer_data.customer_name)), React.createElement("td", null, displayValueOrNA$1(item == null ? void 0 : item.consignment)), React.createElement("td", null, displayValueOrNA$1(item == null ? void 0 : item.order_number)), React.createElement("td", null, displayValueOrNA$1(item == null ? void 0 : item.box_count)), React.createElement("td", null, displayValueOrNA$1(item == null ? void 0 : item.weight), "KG"), React.createElement("td", null, displayValueOrNA$1(item == null ? void 0 : item.cube)), React.createElement("td", null, React.createElement(AntSelect, {
10183
10306
  options: assigneOptions,
10184
10307
  placeholder: "Select",
10185
10308
  onChange: function onChange() {},
@@ -10215,7 +10338,7 @@ var OrderTable = function OrderTable(_ref) {
10215
10338
  })))));
10216
10339
  };
10217
10340
 
10218
- var _templateObject$2j, _templateObject2$1G, _templateObject3$Y, _templateObject4$E;
10341
+ var _templateObject$2i, _templateObject2$1F, _templateObject3$Y, _templateObject4$E;
10219
10342
  var TableFilters = function TableFilters() {
10220
10343
  return React.createElement(Container$1d, null, React.createElement(StyledBulkItem, null, React.createElement(SearchType, null)), React.createElement(IconConatiner$1, null, React.createElement(Mid$1, null, React.createElement(IconText$1, null, "Export"), React.createElement(DownloadIcon, null))));
10221
10344
  // return (
@@ -10231,8 +10354,8 @@ var TableFilters = function TableFilters() {
10231
10354
  // // </StyledBulkFilterCover>
10232
10355
  // );
10233
10356
  };
10234
- var Container$1d = /*#__PURE__*/styled.div(_templateObject$2j || (_templateObject$2j = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n /* align-items: flex-start; */\n gap: 16px;\n align-items: center;\n"])));
10235
- var Mid$1 = /*#__PURE__*/styled.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"])));
10357
+ var Container$1d = /*#__PURE__*/styled.div(_templateObject$2i || (_templateObject$2i = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n /* align-items: flex-start; */\n gap: 16px;\n align-items: center;\n"])));
10358
+ var Mid$1 = /*#__PURE__*/styled.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"])));
10236
10359
  // const TextConatiner = styled.div`
10237
10360
  // display: flex;
10238
10361
  // padding: 7px 12px;
@@ -10299,41 +10422,6 @@ var DateIcon = function DateIcon() {
10299
10422
  }));
10300
10423
  };
10301
10424
 
10302
- var DownArrowIcon = function DownArrowIcon() {
10303
- return React.createElement("svg", {
10304
- xmlns: "http://www.w3.org/2000/svg",
10305
- width: "8",
10306
- height: "4",
10307
- viewBox: "0 0 8 4",
10308
- fill: "none"
10309
- }, React.createElement("path", {
10310
- d: "M0.350098 0.125L4.1001 3.875L7.8501 0.125H0.350098Z",
10311
- fill: "#888075"
10312
- }));
10313
- };
10314
-
10315
- var StatusIcon = function StatusIcon() {
10316
- return React.createElement("svg", {
10317
- xmlns: "http://www.w3.org/2000/svg",
10318
- width: "13",
10319
- height: "12",
10320
- viewBox: "0 0 13 12",
10321
- fill: "none"
10322
- }, React.createElement("path", {
10323
- d: "M2.60002 6V4.83333C2.60002 3.90507 2.96877 3.01483 3.62514 2.35845C4.28152 1.70208 5.17176 1.33333 6.10002 1.33333C7.02827 1.33333 7.91851 1.70208 8.57489 2.35845C9.23127 3.01483 9.60002 3.90507 9.60002 4.83333V6M1.43335 9.5C1.43335 9.80941 1.55627 10.1062 1.77506 10.325C1.99385 10.5437 2.2906 10.6667 2.60002 10.6667C2.90944 10.6667 3.20618 10.5437 3.42497 10.325C3.64377 10.1062 3.76668 9.80941 3.76668 9.5C3.76668 9.19058 3.64377 8.89383 3.42497 8.67504C3.20618 8.45625 2.90944 8.33333 2.60002 8.33333C2.2906 8.33333 1.99385 8.45625 1.77506 8.67504C1.55627 8.89383 1.43335 9.19058 1.43335 9.5ZM8.43335 9.5C8.43335 9.80941 8.55627 10.1062 8.77506 10.325C8.99385 10.5437 9.2906 10.6667 9.60002 10.6667C9.90944 10.6667 10.2062 10.5437 10.425 10.325C10.6438 10.1062 10.7667 9.80941 10.7667 9.5C10.7667 9.19058 10.6438 8.89383 10.425 8.67504C10.2062 8.45625 9.90944 8.33333 9.60002 8.33333C9.2906 8.33333 8.99385 8.45625 8.77506 8.67504C8.55627 8.89383 8.43335 9.19058 8.43335 9.5Z",
10324
- stroke: "#6D6B68",
10325
- "stroke-width": "2",
10326
- "stroke-linecap": "round",
10327
- "stroke-linejoin": "round"
10328
- }), React.createElement("path", {
10329
- d: "M7.8501 4.25L9.6001 6L11.3501 4.25",
10330
- stroke: "#6D6B68",
10331
- "stroke-width": "2",
10332
- "stroke-linecap": "round",
10333
- "stroke-linejoin": "round"
10334
- }));
10335
- };
10336
-
10337
10425
  var ClientIcon = function ClientIcon() {
10338
10426
  return React.createElement("svg", {
10339
10427
  xmlns: "http://www.w3.org/2000/svg",
@@ -10347,59 +10435,134 @@ var ClientIcon = function ClientIcon() {
10347
10435
  }));
10348
10436
  };
10349
10437
 
10350
- var AssigneIcon = function AssigneIcon() {
10351
- return React.createElement("svg", {
10352
- xmlns: "http://www.w3.org/2000/svg",
10353
- width: "15",
10354
- height: "14",
10355
- viewBox: "0 0 15 14",
10356
- fill: "none"
10357
- }, React.createElement("g", {
10358
- "clip-path": "url(#clip0_504_13636)"
10359
- }, React.createElement("path", {
10360
- d: "M4.4751 1.16667H12.6418V6.70834H11.4751V2.33334H10.3084V5.61051L8.55843 4.7355L6.80843 5.61051V2.33334H5.64176V5.54167H4.4751V1.16667ZM7.9751 2.33334V3.72284L8.55843 3.43117L9.14176 3.72284V2.33334H7.9751ZM5.02051 7.72917C4.92474 7.72892 4.82985 7.74755 4.74127 7.78398C4.65269 7.82041 4.57215 7.87394 4.50426 7.9415L3.30843 9.13734V11.375H6.59085L9.97593 10.5292L12.0363 9.6495C12.1064 9.61158 12.1601 9.54908 12.1871 9.47399C12.214 9.3989 12.2123 9.31652 12.1822 9.24263C12.1521 9.16875 12.0958 9.10857 12.0241 9.07364C11.9524 9.0387 11.8703 9.03147 11.7936 9.05334L11.7819 9.05625L8.0416 9.91667H5.93343V8.75H7.75635C7.89172 8.75 8.02154 8.69623 8.11727 8.60051C8.21299 8.50479 8.26676 8.37496 8.26676 8.23959C8.26676 8.10422 8.21299 7.97439 8.11727 7.87867C8.02154 7.78295 7.89172 7.72917 7.75635 7.72917H5.02051ZM9.42585 8.40117L11.4978 7.92459C11.7185 7.86656 11.9496 7.85988 12.1732 7.90505C12.3969 7.95022 12.6072 8.04605 12.7881 8.18518C12.969 8.3243 13.1155 8.50302 13.2166 8.70762C13.3176 8.91221 13.3704 9.13724 13.3709 9.36542C13.3707 9.64241 13.2934 9.91388 13.1478 10.1495C13.0021 10.3851 12.7938 10.5755 12.5461 10.6995L12.5303 10.7077L10.3487 11.6381L6.73435 12.5417H0.100098V8.3125H2.4836L3.6806 7.1155C3.85696 6.93974 4.06622 6.80044 4.29643 6.70555C4.52663 6.61067 4.77327 6.56206 5.02226 6.5625H7.75635C7.99023 6.56247 8.22153 6.61136 8.4354 6.70603C8.64926 6.8007 8.84096 6.93905 8.99818 7.11221C9.15541 7.28536 9.27467 7.48948 9.34832 7.71146C9.42198 7.93345 9.44838 8.16838 9.42585 8.40117ZM2.14176 9.47917H1.26676V11.375H2.14176V9.47917Z",
10361
- fill: "#6D6B68"
10362
- })), React.createElement("defs", null, React.createElement("clipPath", {
10363
- id: "clip0_504_13636"
10364
- }, React.createElement("rect", {
10365
- width: "14",
10366
- height: "14",
10367
- fill: "white",
10368
- transform: "translate(0.100098)"
10369
- }))));
10438
+ var initialState$2 = {
10439
+ 'x-filters': [],
10440
+ 'x-pagination': {
10441
+ page: 1,
10442
+ per_page: 50
10443
+ }
10444
+ };
10445
+ var filterReducer$1 = function filterReducer(state, action) {
10446
+ switch (action.type) {
10447
+ case 'SET_DATE_FILTER':
10448
+ return _extends({}, state, {
10449
+ 'x-filters': [].concat(state['x-filters'].filter(function (f) {
10450
+ return f.field !== 'created_at';
10451
+ }), [{
10452
+ field: 'created_at',
10453
+ op: '>=',
10454
+ value: format(new Date(action.payload), 'yyyy-MM-dd') + "T00:00:00+00:00"
10455
+ }, {
10456
+ field: 'created_at',
10457
+ op: '<=',
10458
+ value: format(new Date(action.payload), 'yyyy-MM-dd') + "T23:59:59+00:00"
10459
+ }])
10460
+ });
10461
+ case 'SET_CLIENT_FILTER':
10462
+ return _extends({}, state, {
10463
+ 'x-filters': [].concat(state['x-filters'].filter(function (f) {
10464
+ return f.field !== 'customer_id';
10465
+ }), [{
10466
+ field: 'customer_id',
10467
+ op: '=',
10468
+ value: action.payload
10469
+ }])
10470
+ });
10471
+ // case 'SET_ACTIONS_FILTER':
10472
+ // return {
10473
+ // ...state,
10474
+ // 'x-filters': [
10475
+ // ...state['x-filters'].filter(
10476
+ // f => f.field !== 'product_return_action_id'
10477
+ // ),
10478
+ // {
10479
+ // field: 'product_return_action_id',
10480
+ // op: '=',
10481
+ // value: action.payload,
10482
+ // },
10483
+ // ],
10484
+ // };
10485
+ // case 'SET_LOCATION_FILTER':
10486
+ // return {
10487
+ // ...state,
10488
+ // 'x-filters': [
10489
+ // ...state['x-filters'].filter(f => f.field !== 'return_location'),
10490
+ // {
10491
+ // field: 'return_location',
10492
+ // op: 'in',
10493
+ // value: action.payload,
10494
+ // },
10495
+ // ],
10496
+ // };
10497
+ case 'SET_PAGE':
10498
+ return _extends({}, state, {
10499
+ 'x-pagination': _extends({}, state['x-pagination'], {
10500
+ page: action.payload
10501
+ })
10502
+ });
10503
+ case 'SET_PERPAGE':
10504
+ return _extends({}, state, {
10505
+ 'x-pagination': _extends({}, state['x-pagination'], {
10506
+ per_page: action.payload
10507
+ })
10508
+ });
10509
+ case 'CLEAR_FILTERS':
10510
+ return _extends({}, state);
10511
+ default:
10512
+ return state;
10513
+ }
10370
10514
  };
10515
+ var filtersStateAtom$1 = /*#__PURE__*/atom(initialState$2);
10516
+ var filtersReducerAtom$1 = /*#__PURE__*/atom(function (get) {
10517
+ return get(filtersStateAtom$1);
10518
+ }, function (get, set, action) {
10519
+ return set(filtersStateAtom$1, filterReducer$1(get(filtersStateAtom$1), action));
10520
+ });
10371
10521
 
10372
- var _templateObject$2k;
10522
+ var _templateObject$2j, _templateObject2$1G;
10373
10523
  var ReturnOrderFilter = function ReturnOrderFilter() {
10374
- var _useOrderDetails = useOrderDetails(),
10375
- orderDetails = _useOrderDetails[0],
10376
- setOrderDetails = _useOrderDetails[1];
10377
- var _usePrevOrderDetails = usePrevOrderDetails(),
10378
- prevOrderDetails = _usePrevOrderDetails[0];
10379
- var actionDate = orderDetails != null && orderDetails.action_date ? new Date(orderDetails == null ? void 0 : orderDetails.action_date) : null;
10380
- var onChange = function onChange(date, _dateString) {
10381
- var selectedDate = date == null ? void 0 : date.format('YYYY-MM-DDTHH:mm:ss');
10382
- if (selectedDate !== undefined && prevOrderDetails.action_date !== undefined) {
10383
- if (new Date(selectedDate).toLocaleDateString() === new Date(prevOrderDetails.action_date).toLocaleDateString()) {
10384
- setOrderDetails(function (prev) {
10385
- return _extends({}, prev, {
10386
- action_date: prevOrderDetails.action_date
10387
- });
10388
- });
10389
- } else {
10390
- setOrderDetails(function (prev) {
10391
- return _extends({}, prev, {
10392
- action_date: selectedDate
10393
- });
10394
- });
10395
- }
10396
- } else {
10397
- setOrderDetails(function (prev) {
10398
- return _extends({}, prev, {
10399
- action_date: null
10400
- });
10524
+ var _useAtom = useAtom(filtersReducerAtom$1),
10525
+ dispatch = _useAtom[1];
10526
+ var _useCustomerData = useCustomerData(),
10527
+ customers = _useCustomerData[0];
10528
+ var _useState = useState(),
10529
+ selectedDate = _useState[0],
10530
+ setSelectedDate = _useState[1];
10531
+ // const zoneOptions = [
10532
+ // { label: 'Zone 1', value: 'zone1' },
10533
+ // { label: 'Zone 2', value: 'zone2' },
10534
+ // { label: 'Zone 3', value: 'zone3' },
10535
+ // { label: 'Zone 4', value: 'zone4' },
10536
+ // { label: 'Zone 5', value: 'zone5' },
10537
+ // ];
10538
+ // date change here
10539
+ var handleDateChange = function handleDateChange(date) {
10540
+ setSelectedDate(date ? date == null ? void 0 : date.$d : null);
10541
+ console.log(selectedDate, 'selected');
10542
+ };
10543
+ useEffect(function () {
10544
+ if (selectedDate) {
10545
+ console.log(selectedDate, 'selected');
10546
+ dispatch({
10547
+ type: 'SET_DATE_FILTER',
10548
+ payload: selectedDate
10401
10549
  });
10402
10550
  }
10551
+ }, [selectedDate]);
10552
+ //client options
10553
+ var clientOptions = customers == null ? void 0 : customers.map(function (option) {
10554
+ var _option$customer_name, _option$customer_name2;
10555
+ return {
10556
+ 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)),
10557
+ value: option == null ? void 0 : option.id
10558
+ };
10559
+ });
10560
+ var handleClientChange = function handleClientChange(value) {
10561
+ console.log(value, 'value');
10562
+ dispatch({
10563
+ type: 'SET_CLIENT_FILTER',
10564
+ payload: value
10565
+ });
10403
10566
  };
10404
10567
  return React.createElement(React.Fragment, null, React.createElement(StyledFiter, null, React.createElement(StyledFIlterELements, null, React.createElement(LeftSideConatiner, null, React.createElement("div", {
10405
10568
  className: "filtercontainer"
@@ -10413,48 +10576,58 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
10413
10576
  className: "dateiconcontainer"
10414
10577
  }, React.createElement(DateIcon, null)), React.createElement(StyledDatePicker, null, React.createElement(DatePicker, {
10415
10578
  className: "custom-datepicker",
10416
- onChange: onChange,
10417
- value: actionDate === null ? actionDate : dayjs(actionDate),
10579
+ onChange: handleDateChange,
10580
+ style: {
10581
+ width: '100px'
10582
+ },
10583
+ value: selectedDate ? dayjs(selectedDate) : null,
10418
10584
  format: "DD/MM/YY",
10419
- placeholder: "Date"
10585
+ placeholder: "Date",
10586
+ needConfirm: true
10420
10587
  }))), React.createElement("div", {
10421
10588
  className: "datefilter"
10422
10589
  }, React.createElement("div", {
10423
10590
  className: "dateiconcontainer"
10424
- }, ' ', React.createElement(StatusIcon, null), ' '), React.createElement("div", {
10425
- className: "datetext"
10426
- }, "Status of Order"), React.createElement("div", {
10427
- className: "roundbox"
10428
- }, React.createElement(DownArrowIcon, null), ' ')), React.createElement("div", {
10429
- className: "datefilter"
10430
- }, React.createElement("div", {
10431
- className: "dateiconcontainer"
10432
- }, React.createElement(ClientIcon, null)), React.createElement("div", {
10433
- className: "datetext"
10434
- }, "Client"), React.createElement("div", {
10435
- className: "roundbox"
10436
- }, React.createElement(DownArrowIcon, null))), React.createElement("div", {
10437
- className: "datefilter"
10438
- }, React.createElement("div", {
10439
- className: "dateiconcontainer"
10440
- }, React.createElement(AssigneIcon, null)), React.createElement("div", {
10441
- className: "datetext"
10442
- }, "Assignee"), React.createElement("div", {
10443
- className: "roundbox"
10444
- }, React.createElement(DownArrowIcon, null))))), React.createElement(TableFilters, null)));
10591
+ }, React.createElement(ClientIcon, null)), React.createElement(StyledAntSelect$d, null, React.createElement(Select, {
10592
+ options: clientOptions,
10593
+ className: "custom-select",
10594
+ placeholder: "Client",
10595
+ onChange: handleClientChange,
10596
+ style: {
10597
+ width: '125px',
10598
+ border: 'none'
10599
+ },
10600
+ maxTagCount: 0,
10601
+ maxTagPlaceholder: function maxTagPlaceholder(omittedValues) {
10602
+ return React.createElement(Tooltip, {
10603
+ overlayStyle: {
10604
+ pointerEvents: 'none'
10605
+ },
10606
+ title: omittedValues.map(function (_ref) {
10607
+ var label = _ref.label;
10608
+ return label;
10609
+ }).join(', ')
10610
+ }, React.createElement("span", null, omittedValues.length + " selected"));
10611
+ }
10612
+ }))))), React.createElement(TableFilters, null)));
10445
10613
  };
10446
- var StyledDatePicker = /*#__PURE__*/styled.div(_templateObject$2k || (_templateObject$2k = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .custom-datepicker {\n border: none;\n width: 80px;\n }\n"])));
10614
+ var StyledDatePicker = /*#__PURE__*/styled.div(_templateObject$2j || (_templateObject$2j = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .custom-datepicker {\n border: none;\n }\n"])));
10615
+ // const DropdownContainer = styled.div``;
10616
+ var StyledAntSelect$d = /*#__PURE__*/styled.div(_templateObject2$1G || (_templateObject2$1G = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .custom-select {\n border: none;\n width: 80px;\n }\n .ant-select-selector {\n border: 1px solid #ffffff !important;\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"])));
10447
10617
 
10448
- var _templateObject$2l, _templateObject2$1H;
10618
+ var _templateObject$2k, _templateObject2$1H;
10449
10619
  var ReturnAfterTable = function ReturnAfterTable() {
10450
10620
  var _useReturnAfterOrderD = useReturnAfterOrderData(),
10451
- returnAfterOrder = _useReturnAfterOrderD[0],
10452
10621
  setReturnOrderData = _useReturnAfterOrderD[1];
10453
10622
  var _useLoading = useLoading(),
10454
10623
  setLoading = _useLoading[1];
10624
+ var _useAtom = useAtom(filtersReducerAtom$1),
10625
+ state = _useAtom[0];
10626
+ var filters = state['x-filters'];
10455
10627
  var _useApiHook = useApiHook({
10456
10628
  endpoint: '/return_orders/?skip_filters=0',
10457
- method: 'GET'
10629
+ method: 'GET',
10630
+ filters: filters
10458
10631
  }),
10459
10632
  fetchedReturnOrderData = _useApiHook.data,
10460
10633
  staticDataLoading = _useApiHook.loading;
@@ -10464,12 +10637,11 @@ var ReturnAfterTable = function ReturnAfterTable() {
10464
10637
  setReturnOrderData(fetchedReturnOrderData == null ? void 0 : fetchedReturnOrderData.data);
10465
10638
  }
10466
10639
  }, [fetchedReturnOrderData, staticDataLoading]);
10467
- console.log('returnAfterOrder', returnAfterOrder);
10468
10640
  return React.createElement("div", null, React.createElement(DashBoardWrapper$2, null, React.createElement(RouterHeader, null), React.createElement("div", {
10469
10641
  className: "Tableconatiner"
10470
10642
  }, React.createElement(HeaderFilter, null), React.createElement(Container$1e, null, React.createElement(ReturnOrderFilter, null), React.createElement(OrderTable, null)))));
10471
10643
  };
10472
- var Container$1e = /*#__PURE__*/styled.div(_templateObject$2l || (_templateObject$2l = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -30px;\n"])));
10644
+ var Container$1e = /*#__PURE__*/styled.div(_templateObject$2k || (_templateObject$2k = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -30px;\n"])));
10473
10645
  var DashBoardWrapper$2 = /*#__PURE__*/styled.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"])));
10474
10646
 
10475
10647
  var BulkFilter = function BulkFilter() {
@@ -10499,7 +10671,7 @@ var BulkFilter = function BulkFilter() {
10499
10671
  );
10500
10672
  };
10501
10673
 
10502
- var _excluded$2 = ["count"];
10674
+ var _excluded$3 = ["count"];
10503
10675
  // import { useAtom } from 'jotai';
10504
10676
  var Filters = function Filters() {
10505
10677
  var _useRoutesTable = useRoutesTable(),
@@ -10525,11 +10697,15 @@ var Filters = function Filters() {
10525
10697
  if (paginationData !== null) {
10526
10698
  var _JSON$parse = JSON.parse(paginationData),
10527
10699
  count = _JSON$parse.count,
10528
- rest = _objectWithoutPropertiesLoose(_JSON$parse, _excluded$2);
10700
+ rest = _objectWithoutPropertiesLoose(_JSON$parse, _excluded$3);
10529
10701
  setPaginationObject(rest);
10530
10702
  setCount(count);
10531
10703
  } else {
10532
- console.error('Pagination data is null');
10704
+ // console.error('Pagination data is null');
10705
+ notification.error({
10706
+ message: 'Error',
10707
+ description: 'Pagination data is null'
10708
+ });
10533
10709
  }
10534
10710
  }
10535
10711
  }, [apiLoading]);
@@ -10563,7 +10739,7 @@ var ReturnTable$1 = function ReturnTable(_ref) {
10563
10739
  }, [staticDataLoading, fetchedStaticData]);
10564
10740
  return React.createElement(React.Fragment, null, React.createElement(StyledTableWrapper$1, {
10565
10741
  id: "tableScrolling"
10566
- }, React.createElement(StyledTable$1, null, React.createElement("thead", null, React.createElement("tr", null, React.createElement("th", null, "Trading Name"), React.createElement("th", null, "Client"), React.createElement("th", null, "Orders"), React.createElement("th", null, "Products"), React.createElement("th", null, "Dispose"), React.createElement("th", null, "Re-allocate"), React.createElement("th", null, "Re-Del"), React.createElement("th", null, "Recycle"), React.createElement("th", null, "Unknown"))), React.createElement("tbody", null, loadingskeleton ? React.createElement("tr", null, React.createElement("td", {
10742
+ }, React.createElement(StyledTable$1, null, React.createElement("thead", null, React.createElement("tr", null, React.createElement("th", null, "Trading Name"), React.createElement("th", null, "Client"), React.createElement("th", null, "Orders"), React.createElement("th", null, "Products"), React.createElement("th", null, "RTS"), React.createElement("th", null, "Pending"), React.createElement("th", null, "Dispose"), React.createElement("th", null, "Re-allocate"), React.createElement("th", null, "Re-Del"), React.createElement("th", null, "Recycle"), React.createElement("th", null, "Unknown"))), React.createElement("tbody", null, loadingskeleton ? React.createElement("tr", null, React.createElement("td", {
10567
10743
  colSpan: 9
10568
10744
  }, React.createElement(Skeleton, {
10569
10745
  active: true
@@ -10583,11 +10759,11 @@ var ReturnTable$1 = function ReturnTable(_ref) {
10583
10759
  fontWeight: 600,
10584
10760
  paddingLeft: 0
10585
10761
  }
10586
- }, key == null ? void 0 : key.customer_name)), ' '), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.return_orders))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.return_order_products))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.DISPOSE))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key['RE-ALLOCATE']), ' ')), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key['RE-DEL']))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.RECYCLE))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.UNKNOWN))));
10762
+ }, key == null ? void 0 : key.customer_name)), ' '), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.return_orders))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.return_order_products))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.RTS))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.PENDING))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.DISPOSE))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key['RE-ALLOCATE']), ' ')), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key['RE-DEL']))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.RECYCLE))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.UNKNOWN))));
10587
10763
  })))));
10588
10764
  };
10589
10765
 
10590
- var _templateObject$2m, _templateObject2$1I, _templateObject3$Z;
10766
+ var _templateObject$2l, _templateObject2$1I, _templateObject3$Z;
10591
10767
  // import Loader from '../loader/Loader';
10592
10768
  // interface ApiResponse {
10593
10769
  // message: string;
@@ -10636,12 +10812,15 @@ function ReturnMainTable() {
10636
10812
  className: "Tableconatiner"
10637
10813
  }, React.createElement(HeaderFilter, null), React.createElement(Container$1f, null, React.createElement(Row$7, null, React.createElement(Text$7, null, "Client Return"), selectedClient ? React.createElement(ReturnFilter, null) : React.createElement(Filters, null)), React.createElement(ReturnTable$1, null)))));
10638
10814
  }
10639
- var Row$7 = /*#__PURE__*/styled.div(_templateObject$2m || (_templateObject$2m = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
10815
+ var Row$7 = /*#__PURE__*/styled.div(_templateObject$2l || (_templateObject$2l = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
10640
10816
  var Container$1f = /*#__PURE__*/styled.div(_templateObject2$1I || (_templateObject2$1I = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -46px;\n"])));
10641
10817
  var DashBoardWrapper$3 = /*#__PURE__*/styled.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"])));
10642
10818
 
10643
10819
  function ReturnClient() {
10644
10820
  var _selectedClientString;
10821
+ notification.config({
10822
+ top: 80
10823
+ });
10645
10824
  var LoadingMessage = function LoadingMessage() {
10646
10825
  return React.createElement("div", null, "Loading...");
10647
10826
  };
@@ -10651,9 +10830,9 @@ function ReturnClient() {
10651
10830
  var selectedClientString = selectedClient == null ? void 0 : selectedClient.replace(/\s+/g, '-');
10652
10831
  selectedClientString = (_selectedClientString = selectedClientString) == null ? void 0 : _selectedClientString.toLowerCase();
10653
10832
  console.log(selectedClientString, 'selectedClient');
10654
- console.log("../return/:" + selectedClientString);
10833
+ console.log("../filter/:" + selectedClientString);
10655
10834
  useEffect(function () {
10656
- if (!location.pathname.includes('/return')) {
10835
+ if (!location.pathname.includes('/filter')) {
10657
10836
  localStorage.removeItem('clientName');
10658
10837
  localStorage.removeItem('clientId');
10659
10838
  }
@@ -10661,7 +10840,7 @@ function ReturnClient() {
10661
10840
  useEffect(function () {
10662
10841
  if (selectedClient) {
10663
10842
  var _selectedClientString2 = selectedClient.replace(/\s+/g, '-');
10664
- navigate("return/" + _selectedClientString2);
10843
+ navigate("filter/" + _selectedClientString2);
10665
10844
  }
10666
10845
  }, [selectedClient]);
10667
10846
  return React.createElement(Suspense, {
@@ -10676,7 +10855,7 @@ function ReturnClient() {
10676
10855
  path: "order-return/:id",
10677
10856
  element: React.createElement(OrderView, null)
10678
10857
  }), React.createElement(Route, {
10679
- path: "return/:name",
10858
+ path: "filter/:clientName",
10680
10859
  element: React.createElement(ReturnTable, null)
10681
10860
  })));
10682
10861
  }