@bjsdistribution/dms-client-return 0.0.17 → 0.0.19

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 (81) hide show
  1. package/dist/assets/icons/DustbinIcon.d.ts +3 -0
  2. package/dist/common/date-picker/header/ClearDate.d.ts +1 -1
  3. package/dist/components/order-daily-overview/header-filters/overViewFilter.d.ts +16 -0
  4. package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.d.ts +1 -1
  5. package/dist/components/order-daily-overview/store/store.d.ts +2 -0
  6. package/dist/components/order-daily-overview/table-view/ReturnPagination.d.ts +3 -0
  7. package/dist/components/order-daily-overview/table-view/TableStyle.d.ts +4 -4
  8. package/dist/components/order-view/fakedata.d.ts +1 -1
  9. package/dist/components/order-view/order-actions/Dropdown.d.ts +6 -2
  10. package/dist/components/order-view/order-actions/actions/confirm-order/customer-info/ContactWith.d.ts +3 -0
  11. package/dist/components/order-view/order-actions/actions/confirm-order/tables/NotesTable.d.ts +1 -1
  12. package/dist/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.d.ts +1 -1
  13. package/dist/components/order-view/order-actions/actions/confirm-order/tables/ReminderStyles.d.ts +9 -0
  14. package/dist/components/order-view/order-actions/store.d.ts +34 -1
  15. package/dist/components/order-view/order-actions/types.d.ts +5 -0
  16. package/dist/components/order-view/store.d.ts +1 -0
  17. package/dist/components/order-view/types.d.ts +5 -2
  18. package/dist/dms-client-return.cjs.development.js +2371 -1678
  19. package/dist/dms-client-return.cjs.development.js.map +1 -1
  20. package/dist/dms-client-return.cjs.production.min.js +1 -1
  21. package/dist/dms-client-return.cjs.production.min.js.map +1 -1
  22. package/dist/dms-client-return.esm.js +2374 -1681
  23. package/dist/dms-client-return.esm.js.map +1 -1
  24. package/package.json +2 -2
  25. package/src/assets/icons/DustbinIcon.tsx +20 -0
  26. package/src/common/modals/order-action-modal/OrderActionModal.tsx +4 -2
  27. package/src/components/order-daily-overview/header-filters/filterStore.ts +19 -18
  28. package/src/components/order-daily-overview/header-filters/overViewFilter.ts +80 -0
  29. package/src/components/order-daily-overview/index.tsx +27 -33
  30. package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +47 -5
  31. package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +9 -5
  32. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +1 -1
  33. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +2 -2
  34. package/src/components/order-daily-overview/return-order-table/ReturnTable.tsx +25 -1
  35. package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +29 -11
  36. package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +1 -0
  37. package/src/components/order-daily-overview/store/store.ts +11 -1
  38. package/src/components/order-daily-overview/table-view/Pagination.tsx +2 -1
  39. package/src/components/order-daily-overview/table-view/ReturnPagination.tsx +136 -0
  40. package/src/components/order-view/details-filters/left-side-filters/dropdowns/OptionsDropDown.tsx +26 -12
  41. package/src/components/order-view/details-filters/right-side-filters/Details.tsx +8 -1
  42. package/src/components/order-view/fakedata.ts +5 -9
  43. package/src/components/order-view/general-information/dropdowns/BjsMenu.tsx +15 -4
  44. package/src/components/order-view/general-information/dropdowns/Print.tsx +79 -39
  45. package/src/components/order-view/general-information/dropdowns/index.tsx +0 -13
  46. package/src/components/order-view/general-information/index.tsx +3 -19
  47. package/src/components/order-view/generic-table/AuditLogs.tsx +7 -5
  48. package/src/components/order-view/index.tsx +1 -2
  49. package/src/components/order-view/modalsPopup/ModalManager.tsx +45 -199
  50. package/src/components/order-view/notes/AddNote.tsx +4 -14
  51. package/src/components/order-view/notes/index.tsx +8 -13
  52. package/src/components/order-view/order-actions/Dropdown.tsx +8 -3
  53. package/src/components/order-view/order-actions/actions/cancel-order/index.tsx +146 -12
  54. package/src/components/order-view/order-actions/actions/charge-log/index.tsx +126 -79
  55. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/ActionDropdown.tsx +21 -9
  56. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/ContactMobile.tsx +64 -1
  57. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/ContactPhone.tsx +67 -1
  58. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/ContactTypeDropdown.tsx +19 -7
  59. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/ContactWith.tsx +28 -0
  60. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/ContactWork.tsx +65 -1
  61. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/DeliveryDate.tsx +40 -3
  62. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/EmailAddress.tsx +47 -2
  63. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/TimedServiceDropdown.tsx +38 -9
  64. package/src/components/order-view/order-actions/actions/confirm-order/customer-info/index.tsx +4 -1
  65. package/src/components/order-view/order-actions/actions/confirm-order/index.tsx +196 -6
  66. package/src/components/order-view/order-actions/actions/confirm-order/slot-and-instructions/index.tsx +5 -1
  67. package/src/components/order-view/order-actions/actions/confirm-order/tables/NotesTable.tsx +121 -20
  68. package/src/components/order-view/order-actions/actions/confirm-order/tables/ProductTable.tsx +54 -32
  69. package/src/components/order-view/order-actions/actions/confirm-order/tables/ReminderStyles.tsx +289 -0
  70. package/src/components/order-view/order-actions/actions/create-task-reminder/CreateReminderModal.tsx +41 -8
  71. package/src/components/order-view/order-actions/actions/create-task-reminder/index.tsx +11 -83
  72. package/src/components/order-view/order-actions/actions/hold-order/HoldOrderModal.tsx +61 -14
  73. package/src/components/order-view/order-actions/actions/release-order/ReleaseOrder.tsx +93 -25
  74. package/src/components/order-view/order-actions/actions/split-order/SplitOrderTable.tsx +102 -247
  75. package/src/components/order-view/order-actions/actions/split-order/index.tsx +57 -9
  76. package/src/components/order-view/order-actions/index.tsx +7 -2
  77. package/src/components/order-view/order-actions/store.ts +45 -0
  78. package/src/components/order-view/order-actions/types.ts +5 -0
  79. package/src/components/order-view/order-details/expanded-content/footer/index.tsx +15 -12
  80. package/src/components/order-view/store.ts +7 -0
  81. package/src/components/order-view/types.ts +5 -2
@@ -1,39 +1,107 @@
1
- import { Alert } from '@bjsdistribution/dms-component-library';
2
- import React from 'react';
1
+ // import { Alert } from '@bjsdistribution/dms-component-library';
2
+ import React, { useEffect } from 'react';
3
3
  import styled from 'styled-components';
4
- import { useCurrentAction } from '../../../store';
4
+ import { useCurrentAction, useLiveRecalling, useOrderId } from '../../../store';
5
+ import {
6
+ CancelAndCompleteAction,
7
+ CancelationModal,
8
+ useApiHook,
9
+ } from '@bjsdistribution/dms-component-library';
10
+ import { ApiResponse } from '../../../types';
11
+ import { notification } from 'antd';
5
12
 
6
13
  function ReleaseOrder() {
14
+ const [orderId] = useOrderId();
7
15
  const [, setCurrentAction] = useCurrentAction();
16
+ const [, setRecalling] = useLiveRecalling();
8
17
 
9
- const onClose = () => {
18
+ const {
19
+ data: response,
20
+ setShouldPerformAction: setPerformAction,
21
+ } = useApiHook<{
22
+ data: ApiResponse[];
23
+ }>({
24
+ endpoint: `orders/${orderId}/released/`,
25
+ method: 'POST',
26
+ performAction: false,
27
+ });
28
+
29
+ useEffect(() => {
30
+ if (response && response?.data) {
31
+ notification.success({
32
+ message: 'Success',
33
+ //@ts-ignore
34
+ description: response?.message || 'Successfully updated',
35
+ });
36
+ setCurrentAction(undefined);
37
+ setRecalling(true);
38
+ setTimeout(() => {
39
+ setRecalling(false);
40
+ }, 1000);
41
+ }
42
+ if (response?.data === null) {
43
+ notification.error({
44
+ message: 'Error',
45
+ description:
46
+ //@ts-ignore
47
+ response?.error_traceback ||
48
+ 'An error has occurred. Please try again later.',
49
+ });
50
+ setCurrentAction(undefined);
51
+ }
52
+ }, [response]);
53
+
54
+ const saveButton = () => {
55
+ setRecalling(false);
56
+ if (orderId) {
57
+ setPerformAction(true);
58
+ }
59
+ };
60
+
61
+ const closeModal = () => {
10
62
  setCurrentAction(undefined);
11
63
  };
12
64
 
65
+ // <ReleaseContainer>
66
+ // <Alert
67
+ // type="info"
68
+ // title="Release"
69
+ // description="Order Already Released"
70
+ // onClose={() => alert(onClose())}
71
+ // showCloseIcon={true} // Show or hide the close icon
72
+ // showOkButton={true} // Show or hide the OK button
73
+ // styleAlert="rounded" // Set the style variant of the alert
74
+ // />
75
+ // </ReleaseContainer>
13
76
  return (
14
- <ReleaseContainer>
15
- <Alert
16
- type="info"
17
- title="Release"
18
- description="Order Already Released"
19
- onClose={() => alert(onClose())}
20
- showCloseIcon={true} // Show or hide the close icon
21
- showOkButton={true} // Show or hide the OK button
22
- styleAlert="rounded" // Set the style variant of the alert
23
- />
24
- </ReleaseContainer>
77
+ <CancelationModal
78
+ title="Release Order"
79
+ description="Are you sure, you want to release the Order?"
80
+ actions={
81
+ <CustomCancelAndCompleteAction
82
+ cancelLabel="Cancel"
83
+ onCancel={closeModal}
84
+ completeLabel="Confirm"
85
+ onComplete={saveButton}
86
+ />
87
+ }
88
+ />
25
89
  );
26
90
  }
27
91
 
28
- const ReleaseContainer = styled.div`
29
- top: -114px;
30
- right: 81px;
31
- opacity: 1;
32
- overflow: unset;
33
- color: inherit;
34
- pointer-events: auto;
35
- position: absolute;
36
- transform: translate3d(57px, 308px, 0px) scaleX(1);
92
+ // const ReleaseContainer = styled.div`
93
+ // top: -114px;
94
+ // right: 81px;
95
+ // opacity: 1;
96
+ // overflow: unset;
97
+ // color: inherit;
98
+ // pointer-events: auto;
99
+ // position: absolute;
100
+ // transform: translate3d(57px, 308px, 0px) scaleX(1);
101
+ // `;
102
+
103
+ const CustomCancelAndCompleteAction = styled(CancelAndCompleteAction)`
104
+ justify-content: center;
37
105
  `;
38
106
 
39
- export default ReleaseOrder;
107
+ export default ReleaseOrder;
@@ -1,260 +1,115 @@
1
- import React from 'react';
2
- import styled from 'styled-components';
1
+ import React, { useEffect, useState } from 'react';
2
+ import { useProductDetails } from '../../../store';
3
+
4
+ import { Empty, Skeleton } from 'antd';
5
+ import { useLoading } from '../../../../order-daily-overview/store/store';
6
+ import { Checkbox } from '@bjsdistribution/dms-component-library';
7
+ import { useSelectedSplit, useSplitOrderPayload } from '../../store';
8
+ import {
9
+ EmptyDataContainer,
10
+ StyledTableWrapper,
11
+ } from '../confirm-order/tables/ReminderStyles';
12
+ import { StyledTable } from '../modalstyle';
3
13
 
4
14
  function SplitOrderTable() {
15
+ const [orderProductDetails] = useProductDetails();
16
+ const [loading] = useLoading();
17
+ const [selectedSplits, setSelectedSplit] = useSelectedSplit();
18
+ const [selectAll, setSelectAll] = useState(false);
19
+ const [payload, setPayload] = useSplitOrderPayload();
20
+
21
+ const handleSelectAll = (e: any) => {
22
+ setSelectAll(e.target.checked);
23
+ if (e.target.checked) {
24
+ setSelectedSplit(
25
+ orderProductDetails.map((order: any) => ({
26
+ id: order.id,
27
+ }))
28
+ );
29
+ } else {
30
+ setSelectedSplit([]);
31
+ }
32
+ };
33
+
34
+ const handleSelectedSplitList = (id: any) => {
35
+ setSelectedSplit((prevSelectedOrder: any) => {
36
+ const isSelected = prevSelectedOrder?.some(
37
+ (order: any) => order.id === id
38
+ );
39
+
40
+ if (isSelected) {
41
+ return prevSelectedOrder?.filter((order: any) => order.id !== id);
42
+ } else {
43
+ return [...prevSelectedOrder, { id: id }];
44
+ }
45
+ });
46
+ };
47
+
48
+ useEffect(() => {
49
+ setPayload({
50
+ ...payload,
51
+ return_order: 0,
52
+ products: selectedSplits?.map(order => order.id),
53
+ force: true,
54
+ });
55
+ }, [orderProductDetails, selectedSplits]);
56
+
5
57
  return (
6
- <GLobalPopupContent>
7
- <TableSkelton>
8
- <table>
9
- <thead>
10
- <tr>
11
- <th>
12
- <CustomCheckBox>
13
- <label className="container">
14
- <input type="checkbox" />
15
- <span className="checkmark"></span>
16
- </label>
17
- </CustomCheckBox>
18
- </th>
19
- <th>Type</th>
20
- <th>Code</th>
21
- <th>Scan</th>
22
- <th>Description</th>
23
- <th>Delivery Instructions</th>
24
- <th>Barcode</th>
25
- </tr>
26
- </thead>
27
- <tbody>
58
+ <StyledTableWrapper id="tableScrolling">
59
+ <StyledTable>
60
+ <thead>
61
+ <tr>
62
+ <th>
63
+ <Checkbox checked={selectAll} onChange={handleSelectAll} />
64
+ </th>
65
+ <th>Type</th>
66
+ <th>Code</th>
67
+ <th>Scan</th>
68
+ <th>Description</th>
69
+ <th>Delivery Instructions</th>
70
+ <th>Barcode</th>
71
+ </tr>
72
+ </thead>
73
+ <tbody>
74
+ {loading ? (
28
75
  <tr>
29
- <td>
30
- <CustomCheckBox>
31
- <label className="container">
32
- <input type="checkbox" />
33
- <span className="checkmark"></span>
34
- </label>
35
- </CustomCheckBox>
76
+ <td colSpan={6}>
77
+ <Skeleton active />
36
78
  </td>
37
- <td>
38
- Return
39
- </td>
40
- <td>FFLMW-B1</td>
41
- <td>Delivered</td>
42
- <td>
43
- Flair Furnishings Loop Midsleeper White /DOUBLE COXMOOR NEST OF
44
- 3 TABLES - OAK
45
- </td>
46
- <td>
47
- Flair Furnishings Loop Midsleeper White /DOUBLE COXMOOR NEST OF
48
- 3 TABLES - OAK
49
- </td>
50
- <td>007022530015429326</td>
79
+ <td colSpan={6}></td>
51
80
  </tr>
81
+ ) : orderProductDetails?.length === 0 ? (
52
82
  <tr>
53
- <td>
54
- <CustomCheckBox>
55
- <label className="container">
56
- <input type="checkbox" />
57
- <span className="checkmark"></span>
58
- </label>
59
- </CustomCheckBox>
60
- </td>
61
- <td>
62
- Deliver
63
- </td>
64
- <td>FFLMW-B1</td>
65
- <td>Location</td>
66
- <td>
67
- Flair Furnishings Loop Midsleeper White /DOUBLE COXMOOR NEST OF
68
- 3 TABLES - OAK
83
+ <td className="emptyTd" colSpan={7}>
84
+ <EmptyDataContainer>
85
+ <Empty />
86
+ </EmptyDataContainer>
69
87
  </td>
70
- <td>
71
- Flair Furnishings Loop Midsleeper White /DOUBLE COXMOOR NEST OF
72
- 3 TABLES - OAK
73
- </td>
74
- <td>007022530015429326</td>
75
88
  </tr>
76
- <tr>
77
- <td>
78
- <CustomCheckBox>
79
- <label className="container">
80
- <input type="checkbox" />
81
- <span className="checkmark"></span>
82
- </label>
83
- </CustomCheckBox>
84
- </td>
85
- <td>
86
- Return
87
- </td>
88
- <td>FFLMW-B1</td>
89
- <td>Outstanding</td>
90
- <td>
91
- Flair Furnishings Loop Midsleeper White /DOUBLE COXMOOR NEST OF
92
- 3 TABLES - OAK
93
- </td>
94
- <td>
95
- Flair Furnishings Loop Midsleeper White /DOUBLE COXMOOR NEST OF
96
- 3 TABLES - OAK
97
- </td>
98
- <td>007022530015429326</td>
99
- </tr>
100
- </tbody>
101
- </table>
102
- </TableSkelton>
103
- </GLobalPopupContent>
89
+ ) : (
90
+ orderProductDetails?.map((order: any) => (
91
+ <tr key={order.id}>
92
+ <td>
93
+ <Checkbox
94
+ checked={selectedSplits?.some(
95
+ (selectedInvoice: any) => selectedInvoice?.id === order.id
96
+ )}
97
+ onChange={() => handleSelectedSplitList(order.id)}
98
+ />
99
+ </td>
100
+ <td>{order?.order_product_type?.type}</td>
101
+ <td>{order?.code}</td>
102
+ <td>{order?.description}</td>
103
+ <td>{order?.description}</td>
104
+ <td>{order?.description}</td>
105
+ <td>{order?.sku}</td>
106
+ </tr>
107
+ ))
108
+ )}
109
+ </tbody>
110
+ </StyledTable>
111
+ </StyledTableWrapper>
104
112
  );
105
113
  }
106
114
 
107
- const GLobalPopupContent = styled.div`
108
- section {
109
- padding: 0px 0 15px;
110
- .filterCover {
111
- border-radius: 16px;
112
- border: 1px solid var(--tonal-brown-10, #edebe8);
113
- background: #f8fafc;
114
- display: flex;
115
- gap: 30px;
116
- padding: 15px;
117
- gap: 15px;
118
- .col {
119
- width: 21%;
120
- label {
121
- color: #8d8f90;
122
- font-size: 14px;
123
- font-weight: 500;
124
- line-height: 20px;
125
- display: block;
126
- margin-bottom: 4px;
127
- }
128
- .ant-select-single {
129
- width: 100%;
130
- }
131
- select {
132
- width: 100%;
133
- }
134
- &:first-child {
135
- width: 43%;
136
- }
137
- &:last-child {
138
- width: 33%;
139
- }
140
- }
141
- }
142
- }
143
- `;
144
-
145
- const TableSkelton = styled.div`
146
- margin-top: -8px;
147
- min-height: 400px;
148
- table {
149
- border-collapse: separate;
150
- width: 100%;
151
- border-spacing: 0px 8px;
152
- thead {
153
- tr {
154
- th {
155
- font-size: 14px;
156
- font-weight: 600;
157
- padding: 8px 15px;
158
- text-align: left;
159
- border-top: 1px solid rgba(0, 0, 0, 0.08);
160
- border-bottom: 1px solid rgba(0, 0, 0, 0.08);
161
-
162
- background: #f0f2f2;
163
- &:first-child {
164
- border-radius: 20px 0 0 20px;
165
- }
166
- &:last-child {
167
- border-radius: 0 20px 20px 0;
168
- }
169
- }
170
- }
171
- }
172
- tbody {
173
- tr {
174
- td {
175
- color: #3a3630;
176
- font-size: 13px;
177
- font-weight: 400;
178
- line-height: 16px;
179
- padding: 6px 15px;
180
- text-align: left;
181
- box-shadow: 3px 1px 3px 0px rgba(16, 24, 40, 0.1);
182
-
183
- background: #fff;
184
-
185
- &:first-child {
186
- border-radius: 20px 0 0 20px;
187
- }
188
-
189
- &:last-child {
190
- border-radius: 0 20px 20px 0;
191
- }
192
- }
193
- }
194
- }
195
- }
196
- `;
197
-
198
- const CustomCheckBox = styled.div`
199
- .container {
200
- display: block;
201
- position: relative;
202
- cursor: pointer;
203
- -webkit-user-select: none;
204
- -moz-user-select: none;
205
- -ms-user-select: none;
206
- user-select: none;
207
- width: 20px;
208
- height: 20px;
209
- }
210
-
211
- .container input {
212
- position: absolute;
213
- opacity: 0;
214
- cursor: pointer;
215
- height: 100%;
216
- width: 100%;
217
- }
218
-
219
- .checkmark {
220
- position: absolute;
221
- top: 0;
222
- left: 0;
223
- width: 100%;
224
- height: 100%;
225
- border: 1px solid #cfcfcf;
226
- border-radius: 4px;
227
- }
228
-
229
- .container:hover input ~ .checkmark {
230
- border-color: #7f7a7a;
231
- }
232
-
233
- .container input:checked ~ .checkmark {
234
- background-color: #000;
235
- }
236
-
237
- .checkmark:after {
238
- content: '';
239
- position: absolute;
240
- display: none;
241
- }
242
-
243
- .container input:checked ~ .checkmark:after {
244
- display: block;
245
- }
246
-
247
- .container .checkmark:after {
248
- left: 8px;
249
- top: 4px;
250
- width: 3px;
251
- height: 6px;
252
- border: solid white;
253
- border-width: 0 2px 2px 0;
254
- -webkit-transform: rotate(45deg);
255
- -ms-transform: rotate(45deg);
256
- transform: rotate(45deg);
257
- }
258
- `;
259
-
260
115
  export default SplitOrderTable;
@@ -2,23 +2,67 @@ import React from 'react';
2
2
  import OrderActionModal from '../../../../../common/modals/order-action-modal/OrderActionModal';
3
3
  import styled from 'styled-components';
4
4
  import SplitOrderTable from './SplitOrderTable';
5
- import { useCurrentAction } from '../../../store';
5
+ import { useCurrentAction, useOrderDetails, useOrderId } from '../../../store';
6
+ import { useApiHook } from '@bjsdistribution/dms-component-library';
7
+ import { ApiResponse } from '../../../types';
8
+
9
+ import { useSelectedSplit, useSplitOrderPayload } from '../../store';
6
10
 
7
11
  function SplitOrder() {
8
12
  const [, setCurrentAction] = useCurrentAction();
13
+ const [orderDetails] = useOrderDetails();
14
+ const orderRecipient = orderDetails?.order_recipient;
15
+ const infoText = `${orderRecipient?.recipient_name}, ${orderRecipient?.postcode}`;
16
+ const [orderId] = useOrderId();
17
+ const [payload] = useSplitOrderPayload();
18
+ const [seledtedSplitOrder, setSelectedSplit] = useSelectedSplit();
9
19
 
10
20
  const onClose = () => {
11
21
  setCurrentAction(undefined);
12
22
  };
13
23
 
24
+ const { setShouldPerformAction: setPerformAction } = useApiHook<{
25
+ data: ApiResponse[];
26
+ }>({
27
+ endpoint: `orders/split_order/${orderId}`,
28
+ method: 'POST',
29
+ body: payload,
30
+ performAction: false,
31
+ });
32
+
33
+ const onSubmitSplitOrder = () => {
34
+ if (orderId) {
35
+ setPerformAction(true);
36
+ }
37
+ setSelectedSplit([]);
38
+ };
39
+
40
+ const isSubmitDisabled = () => {
41
+ if (seledtedSplitOrder?.length > 0) {
42
+ return !seledtedSplitOrder;
43
+ }
44
+ return true;
45
+ };
46
+
14
47
  return (
15
48
  <OrderActionModal
16
49
  headerTitle="Split Order"
17
50
  showAdditionalInfo
18
- infoText="NICK OLIVER, YO42 2ST"
51
+ infoText={infoText}
19
52
  onCloseHeader={onClose}
20
- onSubmit={() => {}}
53
+ onSubmit={onSubmitSplitOrder}
21
54
  submitBtnTitle="Split Order"
55
+ footerActions={
56
+ <>
57
+ {/* <CheckContainer>
58
+ <label className="check">
59
+ <input type="checkbox" />
60
+ Force Split
61
+ </label>
62
+ </CheckContainer> */}
63
+ </>
64
+ }
65
+ isSubmitDisabled={isSubmitDisabled()}
22
66
  >
23
67
  <ContentContainer>
24
68
  <SplitOrderTable />
@@ -28,15 +72,19 @@ function SplitOrder() {
28
72
  }
29
73
 
30
74
  const ContentContainer = styled.div`
31
- display: flex;
75
+ /* display: flex; */
32
76
  padding: 15px 12px;
33
- flex-direction: column;
34
- justify-content: center;
35
- align-items: flex-start;
36
- gap: 15px;
37
77
  flex: 1 0 0;
38
78
  border-radius: 15px;
39
- background: #f8fafc;
79
+ background: white;
80
+ display: flex;
81
+ flex-direction: column;
82
+ gap: 15px;
83
+ overflow: auto;
84
+ min-height: 500px;
85
+ overflow-x: hidden;
86
+ max-height: 500px;
87
+ scrollbar-width: thin;
40
88
  `;
41
89
 
42
90
  export default SplitOrder;
@@ -24,8 +24,7 @@ import ReleaseOrder from './actions/release-order/ReleaseOrder';
24
24
 
25
25
  function OrderActions() {
26
26
  const [currentAction] = useCurrentAction();
27
-
28
- // console.log(currentAction, 'currentAction');
27
+
29
28
  const renderContent = () => {
30
29
  switch (currentAction) {
31
30
  case 'add-resources':
@@ -36,10 +35,14 @@ function OrderActions() {
36
35
  return <SplitOrder />;
37
36
  case 'release-order':
38
37
  return <ReleaseOrder />;
38
+ // case 'unrelease-order':
39
+ // return <UnreleaseOrder />;
39
40
  case 'log-service-refusal':
40
41
  return <LogServiceRefusal />;
41
42
  case 'cancel-order':
42
43
  return <CancelOrder />;
44
+ // case 'uncancel-order':
45
+ // return <UncancelOrder />;
43
46
  case 'confirm-order':
44
47
  return <ConfirmOrder />;
45
48
  case 'send-sms':
@@ -68,6 +71,8 @@ function OrderActions() {
68
71
  return <OrderLock />;
69
72
  case 'view-flag':
70
73
  return <ViewFlag />;
74
+ // case 'clear-date':
75
+ // return <ClearBookingStatus />;
71
76
  default:
72
77
  return null;
73
78
  }
@@ -6,7 +6,10 @@ import {
6
6
  SingleResolvedPayload,
7
7
  UpdateReminderPayload,
8
8
  allTypes,
9
+ splitOrderType,
9
10
  } from './types';
11
+ import { OrdersType } from '../types';
12
+ import { ordersInitialValue } from '../store';
10
13
 
11
14
  export const initialPayload: CreateTaskPayload = {
12
15
  details: '',
@@ -134,6 +137,48 @@ export function useTaskLoading() {
134
137
  return useAtom(taskLoading);
135
138
  }
136
139
 
140
+ export const initialConfirmOrderErrValues = {
141
+ homeContactError: '',
142
+ workContactError: '',
143
+ mobileError: '',
144
+ emailError: '',
145
+ };
146
+ export const splitOrderinitialValue: splitOrderType = {
147
+ return_order: 0,
148
+ products: [],
149
+ force: false,
150
+ };
151
+
152
+ const errorConfirmOrderAtom = atom(initialConfirmOrderErrValues);
153
+
154
+ export function useErrorConfirmOrder() {
155
+ return useAtom(errorConfirmOrderAtom);
156
+ }
157
+
158
+ //confirm order
159
+ const confirmOrderDate = atom<any>(null);
160
+
161
+ export function useConfirmOrderDate() {
162
+ return useAtom(confirmOrderDate);
163
+ }
164
+
165
+ const OrderDetailsConfirmOrder = atom<OrdersType>(ordersInitialValue);
166
+ export function useOrderDetailsConfirmOrder() {
167
+ return useAtom(OrderDetailsConfirmOrder);
168
+ }
169
+
170
+ const splitOrderPayload = atom<splitOrderType>(splitOrderinitialValue);
171
+
172
+ export function useSplitOrderPayload() {
173
+ return useAtom(splitOrderPayload);
174
+ }
175
+ const selectedSplitList = atom<any[]>([]);
176
+
177
+ export function useSelectedSplit() {
178
+ return useAtom(selectedSplitList);
179
+ }
180
+
181
+
137
182
  export function useLoadingText() {
138
183
  return useAtom(loadingText);
139
184
  }
@@ -96,3 +96,8 @@ export interface UpdateReminderPayload {
96
96
  due_time: any;
97
97
  status_id: number | null;
98
98
  }
99
+ export interface splitOrderType {
100
+ return_order: number;
101
+ products: any[];
102
+ force: boolean;
103
+ }