@bjsdistribution/dms-client-return 0.1.19-dev → 0.1.21-dev

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 (162) hide show
  1. package/dist/components/client-portal/DateFilterStore.d.ts +15 -0
  2. package/dist/components/client-portal/OutstandingTable.d.ts +3 -0
  3. package/dist/components/client-portal/ReturnStatus.d.ts +5 -0
  4. package/dist/components/client-portal/return-confirm/ConfirmedMain.d.ts +3 -0
  5. package/dist/components/client-portal/return-confirm/ReturnConfirmedTable.d.ts +3 -0
  6. package/dist/components/order-view/DynamicTable.d.ts +2 -1
  7. package/dist/components/order-view/general-information/Status.d.ts +1 -1
  8. package/dist/components/order-view/general-information/index.d.ts +1 -1
  9. package/dist/components/order-view/index.d.ts +1 -1
  10. package/dist/components/order-view/notes/AddNote.d.ts +1 -0
  11. package/dist/components/order-view/notes/order-dropdown/NewReturnDropdown.d.ts +3 -0
  12. package/dist/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.d.ts +4 -1
  13. package/dist/components/order-view/order-actions/actions/confirm-order/index.d.ts +4 -1
  14. package/dist/components/order-view/order-actions/actions/force-debrief/BaseChargeConfirmationModal.d.ts +7 -0
  15. package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.d.ts +11 -0
  16. package/dist/components/order-view/order-actions/actions/force-debrief/Selector.d.ts +11 -0
  17. package/dist/components/order-view/order-actions/actions/force-debrief/charges/adhoc/index.d.ts +3 -0
  18. package/dist/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.d.ts +8 -0
  19. package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.d.ts +7 -0
  20. package/dist/components/order-view/order-actions/actions/force-debrief/charges/delivery-add-ons/index.d.ts +7 -0
  21. package/dist/components/order-view/order-actions/actions/force-debrief/charges/disposal-charges/index.d.ts +7 -0
  22. package/dist/components/order-view/order-actions/actions/force-debrief/charges/order-charges/index.d.ts +7 -0
  23. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationCategory.d.ts +3 -0
  24. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationLevel.d.ts +3 -0
  25. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.d.ts +3 -0
  26. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/index.d.ts +3 -0
  27. package/dist/components/order-view/order-actions/actions/force-debrief/notifications/FlagsTemplate.d.ts +3 -0
  28. package/dist/components/order-view/order-actions/actions/force-debrief/notifications/OrderTemplate.d.ts +3 -0
  29. package/dist/components/order-view/order-actions/actions/force-debrief/notifications/Tabs.d.ts +3 -0
  30. package/dist/components/order-view/order-actions/actions/force-debrief/notifications/index.d.ts +3 -0
  31. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.d.ts +7 -0
  32. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.d.ts +3 -0
  33. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.d.ts +3 -0
  34. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/OrderHoldReasonDropdown.d.ts +3 -0
  35. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/StatusDropdown.d.ts +3 -0
  36. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/ZoneDropdown.d.ts +3 -0
  37. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/failure-content/index.d.ts +3 -0
  38. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/index.d.ts +4 -0
  39. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/success-content/index.d.ts +3 -0
  40. package/dist/components/order-view/order-actions/actions/force-debrief/styles.d.ts +8 -0
  41. package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.d.ts +1 -0
  42. package/dist/components/order-view/order-actions/actions/remove-from-route/RemoveFromRoute.d.ts +1 -1
  43. package/dist/components/order-view/order-actions/actions/unhold-order/UnholdOrder.d.ts +1 -0
  44. package/dist/components/order-view/order-actions/types.d.ts +3 -3
  45. package/dist/components/order-view/order-details/expanded-content/index.d.ts +1 -1
  46. package/dist/components/order-view/order-details/index.d.ts +1 -1
  47. package/dist/components/order-view/order-resources/expanded-content/index.d.ts +1 -1
  48. package/dist/components/order-view/products-info/expanded-content/index.d.ts +6 -1
  49. package/dist/components/order-view/products-info/index.d.ts +1 -1
  50. package/dist/components/order-view/return-client-products/ProductTable.d.ts +6 -1
  51. package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.d.ts +6 -1
  52. package/dist/components/order-view/store.d.ts +15 -3
  53. package/dist/components/order-view/system-event-logs/expanded-content/index.d.ts +1 -1
  54. package/dist/components/order-view/types.d.ts +49 -1
  55. package/dist/components/order-view/utils.d.ts +3 -0
  56. package/dist/components/order-view/view-reminder/ViewReminder.d.ts +2 -0
  57. package/dist/components/store.d.ts +5 -1
  58. package/dist/dms-client-return.cjs.development.js +7035 -3476
  59. package/dist/dms-client-return.cjs.development.js.map +1 -1
  60. package/dist/dms-client-return.cjs.production.min.js +1 -1
  61. package/dist/dms-client-return.cjs.production.min.js.map +1 -1
  62. package/dist/dms-client-return.esm.js +7099 -3540
  63. package/dist/dms-client-return.esm.js.map +1 -1
  64. package/package.json +6 -4
  65. package/src/assets/icons/ActionIcon.tsx +1 -1
  66. package/src/assets/icons/ArrowDownIcon.tsx +2 -2
  67. package/src/components/client-portal/DateFilterStore.ts +94 -0
  68. package/src/components/client-portal/OutstandingTable.tsx +355 -0
  69. package/src/components/client-portal/ReturnAfterSearchBar.tsx +76 -17
  70. package/src/components/client-portal/ReturnOverview.tsx +4 -4
  71. package/src/components/client-portal/ReturnRTFilters.tsx +57 -40
  72. package/src/components/client-portal/ReturnSearchBar.tsx +64 -94
  73. package/src/components/client-portal/ReturnStatus.tsx +50 -68
  74. package/src/components/client-portal/return-confirm/ConfirmedMain.tsx +224 -0
  75. package/src/components/client-portal/return-confirm/ReturnConfirmedTable.tsx +327 -0
  76. package/src/components/order-daily-overview/header/route-header/RouterHeader.tsx +11 -18
  77. package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +43 -15
  78. package/src/components/order-daily-overview/index.tsx +23 -4
  79. package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +23 -38
  80. package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +21 -24
  81. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +36 -36
  82. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +12 -2
  83. package/src/components/order-daily-overview/return-order-table/ReturnTable.tsx +16 -0
  84. package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +58 -155
  85. package/src/components/order-daily-overview/table/ReturnTable.tsx +8 -4
  86. package/src/components/order-view/DynamicTable.tsx +21 -8
  87. package/src/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.tsx +1 -1
  88. package/src/components/order-view/details-filters/left-side-filters/dropdowns/OptionsDropDown.tsx +9 -0
  89. package/src/components/order-view/details-filters/right-side-filters/Details.tsx +28 -3
  90. package/src/components/order-view/flags-action-modal/Dropdowns.tsx +2 -0
  91. package/src/components/order-view/general-information/Status.tsx +92 -18
  92. package/src/components/order-view/general-information/index.tsx +2 -2
  93. package/src/components/order-view/generic-table/AuditLogs.tsx +39 -12
  94. package/src/components/order-view/index.tsx +50 -8
  95. package/src/components/order-view/modalsPopup/ModalManager.tsx +1 -1
  96. package/src/components/order-view/notes/AddNote.tsx +95 -65
  97. package/src/components/order-view/notes/order-dropdown/NewReturnDropdown.tsx +8 -10
  98. package/src/components/order-view/notification/FlagTemplate.tsx +21 -10
  99. package/src/components/order-view/notification/OrderTemplate.tsx +192 -41
  100. package/src/components/order-view/notification/ReminderTemplate.tsx +28 -13
  101. package/src/components/order-view/notification/index.tsx +100 -55
  102. package/src/components/order-view/order-actions/actions/add-resources/DocFileUpload.tsx +92 -72
  103. package/src/components/order-view/order-actions/actions/add-resources/index.tsx +27 -10
  104. package/src/components/order-view/order-actions/actions/cancel-order/ReturnAction.tsx +25 -4
  105. package/src/components/order-view/order-actions/actions/cancel-order/ReturnReason.tsx +24 -4
  106. package/src/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.tsx +9 -2
  107. package/src/components/order-view/order-actions/actions/confirm-order/index.tsx +12 -6
  108. package/src/components/order-view/order-actions/actions/confirm-order/tables/NotesTable.tsx +1 -0
  109. package/src/components/order-view/order-actions/actions/create-task-reminder/CreateReminderModal.tsx +88 -30
  110. package/src/components/order-view/order-actions/actions/create-task-reminder/CreateTaskModal.tsx +5 -3
  111. package/src/components/order-view/order-actions/actions/create-task-reminder/TaskModal.tsx +2 -2
  112. package/src/components/order-view/order-actions/actions/force-debrief/BaseChargeConfirmationModal.tsx +94 -0
  113. package/src/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.tsx +620 -0
  114. package/src/components/order-view/order-actions/actions/force-debrief/Selector.tsx +65 -0
  115. package/src/components/order-view/order-actions/actions/force-debrief/charges/adhoc/index.tsx +94 -0
  116. package/src/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.tsx +106 -0
  117. package/src/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.tsx +77 -0
  118. package/src/components/order-view/order-actions/actions/force-debrief/charges/delivery-add-ons/index.tsx +78 -0
  119. package/src/components/order-view/order-actions/actions/force-debrief/charges/disposal-charges/index.tsx +77 -0
  120. package/src/components/order-view/order-actions/actions/force-debrief/charges/order-charges/index.tsx +124 -0
  121. package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationCategory.tsx +92 -0
  122. package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationLevel.tsx +90 -0
  123. package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.tsx +122 -0
  124. package/src/components/order-view/order-actions/actions/force-debrief/escalation/index.tsx +16 -0
  125. package/src/components/order-view/order-actions/actions/force-debrief/notifications/FlagsTemplate.tsx +46 -0
  126. package/src/components/order-view/order-actions/actions/force-debrief/notifications/OrderTemplate.tsx +117 -0
  127. package/src/components/order-view/order-actions/actions/force-debrief/notifications/Tabs.tsx +32 -0
  128. package/src/components/order-view/order-actions/actions/force-debrief/notifications/index.tsx +180 -0
  129. package/src/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.tsx +201 -0
  130. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.tsx +40 -0
  131. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.tsx +108 -0
  132. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/OrderHoldReasonDropdown.tsx +37 -0
  133. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/StatusDropdown.tsx +48 -0
  134. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/ZoneDropdown.tsx +27 -0
  135. package/src/components/order-view/order-actions/actions/force-debrief/order-info/failure-content/index.tsx +187 -0
  136. package/src/components/order-view/order-actions/actions/force-debrief/order-info/index.tsx +55 -0
  137. package/src/components/order-view/order-actions/actions/force-debrief/order-info/success-content/index.tsx +221 -0
  138. package/src/components/order-view/order-actions/actions/force-debrief/styles.tsx +51 -0
  139. package/src/components/order-view/order-actions/actions/hold-order/HoldOrderModal.tsx +2 -0
  140. package/src/components/order-view/order-actions/actions/remove-from-route/RemoveFromRoute.tsx +7 -2
  141. package/src/components/order-view/order-actions/actions/unhold-order/UnholdOrder.tsx +2 -0
  142. package/src/components/order-view/order-actions/index.tsx +18 -5
  143. package/src/components/order-view/order-actions/store.ts +1 -1
  144. package/src/components/order-view/order-actions/types.ts +3 -3
  145. package/src/components/order-view/order-details/expanded-content/footer/index.tsx +7 -1
  146. package/src/components/order-view/order-details/expanded-content/index.tsx +37 -16
  147. package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +1 -1
  148. package/src/components/order-view/order-details/expanded-content/services-section/ServiceLevel.tsx +3 -4
  149. package/src/components/order-view/order-details/index.tsx +5 -2
  150. package/src/components/order-view/order-resources/expanded-content/index.tsx +2 -2
  151. package/src/components/order-view/products-info/expanded-content/index.tsx +33 -11
  152. package/src/components/order-view/products-info/index.tsx +10 -6
  153. package/src/components/order-view/return-client-products/ProductTable.tsx +12 -2
  154. package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +73 -23
  155. package/src/components/order-view/store.ts +107 -1
  156. package/src/components/order-view/system-event-logs/expanded-content/index.tsx +6 -2
  157. package/src/components/order-view/types.ts +54 -1
  158. package/src/components/order-view/utils.ts +37 -0
  159. package/src/components/order-view/view-reminder/AssigneeDropdown.tsx +85 -26
  160. package/src/components/order-view/view-reminder/ViewReminder.tsx +33 -14
  161. package/src/components/store.ts +24 -1
  162. package/src/index.tsx +6 -3
@@ -1,4 +1,4 @@
1
- import { Checkbox, useAxios } from '@bjsdistribution/dms-component-library';
1
+ import { Checkbox, useApiHook } from '@bjsdistribution/dms-component-library';
2
2
  import { Empty, notification, Skeleton } from 'antd';
3
3
  import { format } from 'date-fns';
4
4
  import { useAtom } from 'jotai';
@@ -10,17 +10,13 @@ import SortIcon from '../../../../common/SortIcon';
10
10
  import PrintDropDownReturn from '../../../order-view/details-filters/left-side-filters/dropdowns/PrintDropDownReturn';
11
11
  import { usefetchAgain, useReturnData } from '../../../order-view/store';
12
12
  import {
13
- useClientPortal,
14
- useEndDate,
13
+ useCustomerData,
15
14
  useGroupedPayload,
16
15
  useLocationData,
17
16
  useNewReturnPayload,
18
17
  useReturnPayload,
19
- useSearchText,
20
18
  useSelectAll,
21
- useSelectedClientPortOrders,
22
19
  useSelectedOrders,
23
- useStartDate,
24
20
  } from '../../../store';
25
21
  import { ApiResponse } from '../../../types';
26
22
  import { filtersReducerAtom } from '../../header-filters/filterStore';
@@ -32,8 +28,7 @@ import {
32
28
  } from '../../store/store';
33
29
  import { EmptyDataContainer } from '../../table/table-data/styles';
34
30
  import { CustomDrop, StyledTable, StyledTableWrapper } from './returnstyles';
35
- import { NavLink, useParams } from 'react-router-dom';
36
- import dayjs from 'dayjs';
31
+ import { NavLink, useSearchParams } from 'react-router-dom';
37
32
 
38
33
  const ReturnOrderTable = () => {
39
34
  const [state] = useAtom(filtersReducerAtom);
@@ -45,18 +40,14 @@ const ReturnOrderTable = () => {
45
40
  const dropdownRefParent = useRef<HTMLDivElement>(null);
46
41
  const dropdownRef = useRef<HTMLDivElement>(null);
47
42
  const [printToogle, setPrintToggle] = usePrintOptionTOggle();
48
- const [createReturn, setReturnPayload] = useReturnPayload();
43
+ const [, setReturnPayload] = useReturnPayload();
49
44
  const [newpayload, setNewPayload] = useNewReturnPayload();
50
45
  const [, setGrouped] = useGroupedPayload();
51
46
  const [locationData] = useLocationData();
52
47
  const [, setPaginationObject] = UsePaginationData();
53
48
  const [callForFetch] = usefetchAgain();
54
- const [clientPortal] = useClientPortal();
55
- const { status } = useParams();
56
- const [selectedOrderIds, setSelectedOrderIds] = useSelectedClientPortOrders();
57
- const [selectClientAll, setSelectClientAll] = useState(false);
58
- const [modifiedFilters, setModifiedFilters] = useState<any[]>([]);
59
-
49
+ const [searchParams] = useSearchParams();
50
+ const urlCustomerId = searchParams.get('customerId');
60
51
  //sorting
61
52
  const [sortConfig, setSortConfig] = useState<{
62
53
  key: string;
@@ -122,67 +113,18 @@ const ReturnOrderTable = () => {
122
113
  }
123
114
  };
124
115
 
125
- //CP
126
- const [startDate] = useStartDate();
127
- const [endDate] = useEndDate();
128
-
129
- useEffect(() => {
130
- if (!clientPortal) return;
131
-
132
- const stored = JSON.parse(localStorage.getItem('returnDate') || '{}');
133
-
134
- const sDate = startDate?.isValid?.() ? startDate : dayjs(stored?.startDate);
135
- const eDate = endDate?.isValid?.()
136
- ? endDate
137
- : stored?.endDate
138
- ? dayjs(stored?.endDate)
139
- : null;
140
-
141
- if (!sDate?.isValid?.()) return;
142
-
143
- let dateFilters = [];
144
-
145
- if (eDate && eDate.isValid()) {
146
- dateFilters = [
147
- { field: 'created_at', op: '>=', value: sDate.format('YYYY-MM-DD') },
148
- {
149
- field: 'created_at',
150
- op: '<=',
151
- value: eDate.add(1, 'day').format('YYYY-MM-DD'),
152
- },
153
- ];
154
- } else {
155
- dateFilters = [
156
- {
157
- field: 'created_at',
158
- op: '=',
159
- value: sDate.format('YYYY-MM-DD'),
160
- },
161
- ];
162
- }
163
-
164
- const updatedFilters =
165
- status === 'outstanding_return'
166
- ? [
167
- { field: 'isdeleted', op: '=', value: 0 },
168
- { field: 'product_return_action_id', op: '=', value: 'RTS' },
169
- ...dateFilters,
170
- ]
171
- : dateFilters;
172
-
173
- setModifiedFilters(updatedFilters);
174
- }, [startDate, endDate, status]);
175
-
176
116
  const {
177
117
  data: fetchedOrderData,
178
118
  loading: returnDataLoad,
179
119
  paginationData,
180
- fetchData,
181
- } = useAxios<ApiResponse>({
120
+ setShouldPerformAction,
121
+ } = useApiHook<ApiResponse>({
182
122
  endpoint: '/v1/return/product/pending/',
183
123
  method: 'GET',
184
- filters: clientPortal ? modifiedFilters : filters,
124
+ filters: filters,
185
125
  pagination: pagination,
126
+ performAction: false,
127
+ showLoader: false,
186
128
  });
187
129
 
188
130
  useEffect(() => {
@@ -209,21 +151,9 @@ const ReturnOrderTable = () => {
209
151
  }
210
152
  }, [fetchedOrderData, returnDataLoad]);
211
153
 
212
- useEffect(() => {
213
- if (!clientPortal) {
214
- fetchData();
215
- }
216
- }, []);
217
- const [debouncedSearchText] = useSearchText();
218
-
219
- useEffect(() => {
220
- if (clientPortal && debouncedSearchText == '') {
221
- fetchData();
222
- }
223
- }, [debouncedSearchText]);
224
-
225
154
  useEffect(() => {
226
155
  setLoading(returnDataLoad);
156
+ setShouldPerformAction(true);
227
157
  if (fetchedOrderData && fetchedOrderData?.data && locationData) {
228
158
  const updatedReturnData = fetchedOrderData.data.map(returnItem => {
229
159
  const matchingLocation = locationData.find(
@@ -241,7 +171,15 @@ const ReturnOrderTable = () => {
241
171
  }
242
172
  // setShouldPerformAction(false);
243
173
  }, [fetchedOrderData, returnDataLoad, locationData, state, callForFetch]);
174
+ const [customers] = useCustomerData();
175
+
176
+ const selectedCustomer = customers?.find((customer: any) => {
177
+ const customerId = customer?.customer_id?.toString();
178
+ return customerId && customerId === urlCustomerId;
179
+ });
244
180
 
181
+ const accountNumber = selectedCustomer?.account_number;
182
+ console.log(selectedCustomer, 'selectedCustomer');
245
183
  const handleSelectAll = (e: any) => {
246
184
  const isChecked = e.target.checked;
247
185
  setSelectAll(isChecked);
@@ -250,7 +188,7 @@ const ReturnOrderTable = () => {
250
188
  const filteredData = returnData?.filter(
251
189
  (loc: any) => loc?.product_return_action === 'RTS'
252
190
  );
253
- const selectedOrders = filteredData?.map((loc: any) => ({
191
+ const selectedOrders = filteredData.map((loc: any) => ({
254
192
  id: loc.id,
255
193
  return_locations: loc?.return_location_name,
256
194
  return_location: loc?.return_location,
@@ -260,8 +198,8 @@ const ReturnOrderTable = () => {
260
198
  }));
261
199
  const newPayload = filteredData.map((loc: any) => ({
262
200
  id: loc.id,
263
- account_number: createReturn?.account_number,
264
- customer_id: +createReturn?.customer_id,
201
+ account_number: accountNumber,
202
+ customer_id: Number(urlCustomerId),
265
203
  products: [loc?.legacy_product_id],
266
204
  return_action: loc?.product_return_action,
267
205
  return_location_token: loc?.return_location || null,
@@ -287,7 +225,6 @@ const ReturnOrderTable = () => {
287
225
  const isSelected = prevSelectedLocations?.some(
288
226
  (loc: any) => loc.id === id
289
227
  );
290
-
291
228
  if (isSelected) {
292
229
  const updatedSelectedLocations = prevSelectedLocations.filter(
293
230
  (loc: any) => loc.id !== id
@@ -310,8 +247,8 @@ const ReturnOrderTable = () => {
310
247
  } else {
311
248
  const newReturnPayload = {
312
249
  id,
313
- account_number: createReturn?.account_number,
314
- customer_id: +createReturn?.customer_id,
250
+ account_number: accountNumber,
251
+ customer_id: Number(urlCustomerId),
315
252
  products: [legacy_product_id],
316
253
  return_action: product_return_action || null,
317
254
  return_location_token: return_location || null,
@@ -372,25 +309,6 @@ const ReturnOrderTable = () => {
372
309
  const mergedPayload = Object.values(groupedPayload);
373
310
  setGrouped(mergedPayload);
374
311
  }, [newpayload]);
375
-
376
- //Client Portal
377
- const handleSelectOrderId = (id: string | number) => {
378
- setSelectedOrderIds(prev =>
379
- prev.includes(id) ? prev.filter(orderId => orderId !== id) : [...prev, id]
380
- );
381
- };
382
-
383
- const handleClientSelectAll = (e: React.ChangeEvent<HTMLInputElement>) => {
384
- const isChecked = e.target.checked;
385
- setSelectClientAll(isChecked);
386
-
387
- if (isChecked) {
388
- setSelectedOrderIds(returnData?.map((item: any) => item?.order_id) || []);
389
- } else {
390
- setSelectedOrderIds([]);
391
- }
392
- };
393
-
394
312
  return (
395
313
  <>
396
314
  <StyledTableWrapper className="fortables">
@@ -401,28 +319,22 @@ const ReturnOrderTable = () => {
401
319
  <Checkbox checked={selectAll} onChange={handleSelectAll} />
402
320
  </th> */}
403
321
  {returnData?.some(
404
- (item: any) => item?.product_return_action === 'RTS'
322
+ (item: any) =>
323
+ item?.product_return_action === 'RTS' &&
324
+ item?.return_location !== 'null' &&
325
+ item?.return_location !== null
405
326
  ) ? (
406
327
  <th className="emailInvoiceCheckbox">
407
328
  <Checkbox checked={selectAll} onChange={handleSelectAll} />
408
329
  </th>
409
- ) : clientPortal ? (
410
- <th className="emailInvoiceCheckbox">
411
- <Checkbox
412
- checked={selectClientAll}
413
- onChange={handleClientSelectAll}
414
- />
415
- </th>
416
330
  ) : (
417
331
  <th></th>
418
332
  )}
419
- {!clientPortal && (
420
- <th onClick={() => handleSort('location')}>
421
- <div className="sortIconClass">
422
- Product Location {renderSortIcon('location')}
423
- </div>
424
- </th>
425
- )}
333
+ <th onClick={() => handleSort('location')}>
334
+ <div className="sortIconClass">
335
+ Product Location {renderSortIcon('location')}
336
+ </div>
337
+ </th>
426
338
  <th onClick={() => handleSort('return_location_name')}>
427
339
  <div className="sortIconClass">
428
340
  Return Location {renderSortIcon('return_location_name')}
@@ -476,44 +388,35 @@ const ReturnOrderTable = () => {
476
388
  sortedData?.map((item: any, index: any) => (
477
389
  <tr key={item.id}>
478
390
  <td>
479
- {clientPortal ? (
391
+ {item?.product_return_action === 'RTS' &&
392
+ item?.return_location !== 'null' &&
393
+ item?.return_location !== null ? (
480
394
  <Checkbox
481
- checked={selectedOrderIds.includes(item?.order_id)}
482
- onChange={() => handleSelectOrderId(item?.order_id)}
395
+ className="custom-check"
396
+ checked={selectedReturnOrder.some(
397
+ (selectedInvoice: any) =>
398
+ selectedInvoice?.id === item?.id
399
+ )}
400
+ onChange={() =>
401
+ handleSelectOrderReturn(
402
+ item?.id,
403
+ item?.return_location,
404
+ item?.return_location_name,
405
+ item?.product_return_action,
406
+ item?.legacy_product_id
407
+ )
408
+ }
483
409
  />
410
+ ) : null}
411
+ </td>
412
+
413
+ <td>
414
+ {item?.location !== null && item?.location !== undefined ? (
415
+ item?.location
484
416
  ) : (
485
- <>
486
- {item?.product_return_action === 'RTS' ? (
487
- <Checkbox
488
- className="custom-check"
489
- checked={selectedReturnOrder?.some(
490
- (selectedInvoice: any) =>
491
- selectedInvoice?.id === item?.id
492
- )}
493
- onChange={() =>
494
- handleSelectOrderReturn(
495
- item?.id,
496
- item?.return_location,
497
- item?.return_location_name,
498
- item?.product_return_action,
499
- item?.legacy_product_id
500
- )
501
- }
502
- />
503
- ) : null}
504
- </>
417
+ <div className="awaiting">Awaiting</div>
505
418
  )}
506
419
  </td>
507
- {!clientPortal && (
508
- <td>
509
- {item?.location !== null &&
510
- item?.location !== undefined ? (
511
- item?.location
512
- ) : (
513
- <div className="awaiting">Awaiting</div>
514
- )}
515
- </td>
516
- )}
517
420
  <td> {displayValueOrNA(item?.return_location_name)}</td>
518
421
  <td>
519
422
  <ul style={{ listStyleType: 'none', padding: 0 }}>
@@ -108,7 +108,6 @@ const ReturnTable: React.FC = () => {
108
108
  customerId: customerId?.toString(),
109
109
  });
110
110
  //for dev
111
- //navigate(`filter?${queryParams.toString()}`);
112
111
  navigate(`/orders/view/return/filter?${queryParams.toString()}`);
113
112
 
114
113
  //for local
@@ -138,7 +137,6 @@ const ReturnTable: React.FC = () => {
138
137
  type: RTS,
139
138
  });
140
139
  //for dev
141
- //navigate(`filter?${queryParams.toString()}`);
142
140
  navigate(`/orders/view/return/filter?${queryParams.toString()}`);
143
141
 
144
142
  //for local
@@ -158,6 +156,7 @@ const ReturnTable: React.FC = () => {
158
156
  { label: 'Products', key: 'return_order_products' },
159
157
  { label: 'RTS', key: 'RTS' },
160
158
  { label: 'Pending', key: 'PENDING' },
159
+ { label: 'Claims Paid', key: 'CLAIMS PAID' },
161
160
  { label: 'Dispose', key: 'DISPOSE' },
162
161
  { label: 'Re-allocate', key: 'RE-ALLOCATE' },
163
162
  { label: 'Re-Del', key: 'RE-DEL' },
@@ -175,13 +174,13 @@ const ReturnTable: React.FC = () => {
175
174
  <tbody>
176
175
  {statsLoading ? (
177
176
  <tr>
178
- <td colSpan={11}>
177
+ <td colSpan={12}>
179
178
  <Skeleton active />
180
179
  </td>
181
180
  </tr>
182
181
  ) : sortedData?.length === 0 ? (
183
182
  <tr>
184
- <td colSpan={11}>
183
+ <td colSpan={12}>
185
184
  <EmptyDataContainer>
186
185
  <Empty />
187
186
  </EmptyDataContainer>
@@ -249,6 +248,11 @@ const ReturnTable: React.FC = () => {
249
248
  <GreyBox>{key?.PENDING}</GreyBox>
250
249
  </ColumStyle>
251
250
  </td>
251
+ <td>
252
+ <ColumStyle>
253
+ <GreyBox>{key?.['CLAIMS PAID']}</GreyBox>
254
+ </ColumStyle>
255
+ </td>
252
256
  <td>
253
257
  <ColumStyle>
254
258
  <GreyBox>{key?.DISPOSE}</GreyBox>
@@ -8,14 +8,19 @@ import React, { useMemo } from 'react';
8
8
  import styled from 'styled-components';
9
9
  import CustomScrollBar from '../../common/scrollbar';
10
10
  import { atom, useAtom } from 'jotai';
11
+ import { Skeleton } from 'antd';
11
12
  export const selectedID = atom<any>([]);
12
13
 
13
14
  interface DynamicTableProps {
14
15
  columns: any;
15
16
  data: any[];
17
+ loading: boolean;
16
18
  }
17
19
 
18
- function DynamicTable({ columns, data }: DynamicTableProps, props: any) {
20
+ function DynamicTable(
21
+ { columns, data, loading }: DynamicTableProps,
22
+ props: any
23
+ ) {
19
24
  const tableColumns = useMemo(() => columns, [columns]);
20
25
  const tableData = useMemo(() => data, [data]);
21
26
 
@@ -44,6 +49,8 @@ function DynamicTable({ columns, data }: DynamicTableProps, props: any) {
44
49
  const largeColumns = ['details', 'datetime'];
45
50
  const noFlexColumns = ['id'];
46
51
 
52
+ console.log(rows, '<===========rows');
53
+ console.log(props, 'props');
47
54
  return (
48
55
  <MainContainer>
49
56
  <Container>
@@ -78,7 +85,19 @@ function DynamicTable({ columns, data }: DynamicTableProps, props: any) {
78
85
  ))}
79
86
  </TableHead>
80
87
  <TableBody>
81
- {rows?.length > 0 ? (
88
+ {loading ? (
89
+ <tr>
90
+ <td colSpan={5}>
91
+ <Skeleton active />
92
+ </td>
93
+ </tr>
94
+ ) : rows?.length === 0 ? (
95
+ <TableRow>
96
+ <TableData colSpan={columns.length}>
97
+ No entries found.
98
+ </TableData>
99
+ </TableRow>
100
+ ) : (
82
101
  rows?.map(row => (
83
102
  <TableRow
84
103
  key={row.id}
@@ -115,12 +134,6 @@ function DynamicTable({ columns, data }: DynamicTableProps, props: any) {
115
134
  ))}
116
135
  </TableRow>
117
136
  ))
118
- ) : (
119
- <TableRow>
120
- <TableData colSpan={columns.length}>
121
- No entries found.
122
- </TableData>
123
- </TableRow>
124
137
  )}
125
138
  </TableBody>
126
139
  </Table>
@@ -41,7 +41,7 @@ function DropDowns() {
41
41
  onClick={action.onClick}
42
42
  style={{ cursor: 'pointer' }}
43
43
  >
44
- {action.label}
44
+ {action?.label}
45
45
  </FontContainer>
46
46
  ))}
47
47
  </DashBoardWrapper>
@@ -40,6 +40,7 @@ function Options() {
40
40
  };
41
41
 
42
42
  const isReleased = orderStatus[0]?.released;
43
+ // const routedValue = orderStatus[0]?.routed;
43
44
  const isRouted = orderStatus[0]?.routed && orderDetails?.order_routes?.id;
44
45
  const isOrderOnHold = orderDetails?.status === 'OO';
45
46
  const isOrderCancelled = orderDetails?.status === 'CO';
@@ -73,6 +74,14 @@ function Options() {
73
74
  shouldExclude = true;
74
75
  }
75
76
 
77
+ if (isRouted && option.value === 'clear-date') {
78
+ shouldExclude = true;
79
+ }
80
+
81
+ // if (routedValue && option.value === 'remove-from-route') {
82
+ // shouldExclude = true;
83
+ // }
84
+
76
85
  return !shouldExclude;
77
86
  });
78
87
 
@@ -1,17 +1,23 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
- import { useCustomerInfo } from '../../store';
3
+ import { useCustomerInfo, useGlobalEscData } from '../../store';
4
4
 
5
5
  const Details = () => {
6
6
  // const [orderDetails] = useOrderDetails();
7
7
  const [customerInfo] = useCustomerInfo();
8
8
  const recipient = customerInfo?.recipient_name || '';
9
9
  const postcodeShow = customerInfo?.postcode || '';
10
+ const [globalEscData] = useGlobalEscData();
10
11
 
11
12
  return (
12
13
  <DetailsContainer>
13
14
  <Typo>
14
- CUSTOMER RETURN - {recipient} , {postcodeShow}
15
+ CUSTOMER RETURN - {recipient} , {postcodeShow} {}
16
+ {globalEscData?.length > 0 && (
17
+ <EscInfo>
18
+ {`${globalEscData[0]?.escalation_type?.level} (${globalEscData[0]?.escalation_type?.name})`}
19
+ </EscInfo>
20
+ )}
15
21
  </Typo>
16
22
  </DetailsContainer>
17
23
  );
@@ -27,10 +33,14 @@ const DetailsContainer = styled.div`
27
33
  `;
28
34
 
29
35
  const Typo = styled.div`
36
+ display: flex;
37
+ flex-direction: row;
38
+ gap: 15px;
39
+ align-items: center;
30
40
  font-size: 20px;
31
41
  font-style: normal;
32
42
  font-weight: 600;
33
- line-height: 32px; /* 160% */
43
+ line-height: 32px;
34
44
  text-transform: uppercase;
35
45
  margin: 0;
36
46
  padding: 0;
@@ -40,4 +50,19 @@ const Typo = styled.div`
40
50
  }
41
51
  `;
42
52
 
53
+ const Name = styled.div`
54
+ /* heading/h3-subHeader */
55
+ font-family: 'Roboto', sans-serif;
56
+ font-size: 20px;
57
+ font-style: normal;
58
+ font-weight: 900;
59
+ line-height: 32px; /* 160% */
60
+ text-transform: uppercase;
61
+ `;
62
+
63
+ const EscInfo = styled(Name)`
64
+ color: #6396e5;
65
+ font-size: 16px;
66
+ `;
67
+
43
68
  export default Details;
@@ -75,6 +75,7 @@ function ButtonsSection() {
75
75
  placeholder="Select Type"
76
76
  onChange={handleTaskTypeChange}
77
77
  value={selectedTypeId}
78
+ style={{ minWidth: '200px', width: 'auto' }}
78
79
  />
79
80
  </Flex>
80
81
  <Flex>
@@ -84,6 +85,7 @@ function ButtonsSection() {
84
85
  placeholder="Select Type"
85
86
  onChange={handlePriorityChange}
86
87
  value={taskPayload?.priority || flagById?.priority}
88
+ style={{ minWidth: '100px', width: 'auto' }}
87
89
  />
88
90
  </Flex>
89
91
  <Flex>