@bjsdistribution/dms-client-return 0.0.12 → 0.0.14
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.
- package/dist/components/order-daily-overview/common/css/TableStyle.d.ts +13 -30
- package/dist/components/order-view/store.d.ts +77 -28
- package/dist/components/order-view/types.d.ts +61 -11
- package/dist/components/order-view/utils.d.ts +4 -0
- package/dist/dms-client-return.cjs.development.js +1547 -1009
- package/dist/dms-client-return.cjs.development.js.map +1 -1
- package/dist/dms-client-return.cjs.production.min.js +1 -1
- package/dist/dms-client-return.cjs.production.min.js.map +1 -1
- package/dist/dms-client-return.esm.js +1549 -1011
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/common/expand-collapse/index.tsx +4 -4
- package/src/components/order-daily-overview/common/css/TableStyle.tsx +42 -342
- package/src/components/order-daily-overview/index.tsx +2 -2
- package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +2 -2
- package/src/components/order-daily-overview/return-order-table/ReturnTable.tsx +2 -2
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +2 -2
- package/src/components/order-daily-overview/table/table-data/styles.ts +1 -1
- package/src/components/order-view/DynamicTable.tsx +12 -3
- package/src/components/order-view/flags-action-modal/Actions.tsx +1 -2
- package/src/components/order-view/general-information/Status.tsx +13 -17
- package/src/components/order-view/generic-table/AuditLogs.tsx +81 -19
- package/src/components/order-view/index.tsx +192 -192
- package/src/components/order-view/modalsPopup/ModalManager.tsx +2 -2
- package/src/components/order-view/modalsPopup/ProductAction.tsx +1 -1
- package/src/components/order-view/notes/AddNote.tsx +2 -3
- package/src/components/order-view/notes/index.tsx +9 -22
- package/src/components/order-view/order-details/expanded-content/footer/index.tsx +90 -73
- package/src/components/order-view/order-details/expanded-content/instruction-section/DeliveryInstructions.tsx +2 -9
- package/src/components/order-view/order-details/expanded-content/orders-section/Droptime.tsx +2 -10
- package/src/components/order-view/order-details/expanded-content/orders-section/VehicleType.tsx +16 -15
- package/src/components/order-view/order-details/expanded-content/services-section/AssemblyType.tsx +88 -15
- package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx +1 -13
- package/src/components/order-view/order-details/expanded-content/services-section/OrderServices.tsx +141 -16
- package/src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx +1 -13
- package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx +19 -18
- package/src/components/order-view/products-info/expanded-content/products/index.tsx +2 -2
- package/src/components/order-view/return-client-products/ProductTable.tsx +1 -1
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +79 -70
- package/src/components/order-view/return-client-products/product-table-footer/ProductDetailsFooter.tsx +5 -5
- package/src/components/order-view/store.ts +216 -51
- package/src/components/order-view/system-event-logs/expanded-content/index.tsx +6 -10
- package/src/components/order-view/toolbox-resources/expanded-content/index.tsx +68 -6
- package/src/components/order-view/types.ts +89 -33
- package/src/components/order-view/utils.ts +20 -17
- package/src/index.tsx +13 -9
package/src/components/order-view/order-details/expanded-content/services-section/OrderServices.tsx
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import ServiceSlider from '../../../../../common/services-slider/ServiceSlider';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
useOrderDetails,
|
|
6
|
+
useOrderStaticData,
|
|
7
|
+
usePrevOrderDetails,
|
|
8
|
+
} from '../../../store';
|
|
5
9
|
import { OrderServiceType } from '../../../types';
|
|
6
10
|
|
|
7
11
|
function OrderServices() {
|
|
8
12
|
const [orderStaticData] = useOrderStaticData();
|
|
9
13
|
const [orderDetails, setOrderDetails] = useOrderDetails();
|
|
14
|
+
const [prevOrderDetails] = usePrevOrderDetails();
|
|
10
15
|
const orderServices = orderDetails?.order_services;
|
|
16
|
+
const prevOrderServices = prevOrderDetails?.order_services;
|
|
11
17
|
|
|
12
18
|
const orderServicesOptions = orderStaticData?.order_service_list;
|
|
13
19
|
|
|
@@ -16,12 +22,27 @@ function OrderServices() {
|
|
|
16
22
|
const selectedService = clone?.find(
|
|
17
23
|
(s: OrderServiceType) => s?.order_service_list_id === id
|
|
18
24
|
);
|
|
25
|
+
const assembleOrderService = orderStaticData?.order_service_list?.find(
|
|
26
|
+
(x: any) => x?.type?.toLowerCase() === 'assemble'
|
|
27
|
+
);
|
|
28
|
+
const disassembleOrderService = orderStaticData?.order_service_list?.find(
|
|
29
|
+
(x: any) => x?.type?.toLowerCase() === 'disassemble'
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const assemblyTypeService = clone?.find(
|
|
33
|
+
(x: any) => x?.order_service_list_id === assembleOrderService?.id
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const disassemblyTypeService = clone?.find(
|
|
37
|
+
(x: any) => x?.order_service_list_id === disassembleOrderService?.id
|
|
38
|
+
);
|
|
39
|
+
|
|
19
40
|
if (selectedService !== undefined) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
41
|
+
const isAssembleService =
|
|
42
|
+
assembleOrderService?.id === selectedService?.order_service_list_id;
|
|
43
|
+
|
|
44
|
+
const isDisassembleService =
|
|
45
|
+
disassembleOrderService?.id === selectedService?.order_service_list_id;
|
|
25
46
|
|
|
26
47
|
if (selectedService.new_id) {
|
|
27
48
|
const updatedOrderServices = clone.filter(
|
|
@@ -33,36 +54,140 @@ function OrderServices() {
|
|
|
33
54
|
};
|
|
34
55
|
setOrderDetails(newData);
|
|
35
56
|
} else {
|
|
36
|
-
|
|
57
|
+
let updatedSelectedService = {
|
|
37
58
|
...selectedService,
|
|
38
59
|
is_deleted: !selectedService.is_deleted,
|
|
39
60
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
61
|
+
|
|
62
|
+
let updatedOrderServices = [];
|
|
63
|
+
let newUpdatedOrderServices: any = [];
|
|
64
|
+
|
|
65
|
+
updatedOrderServices = clone.filter(
|
|
44
66
|
(service: OrderServiceType) => service.id !== selectedService.id
|
|
45
67
|
);
|
|
68
|
+
|
|
46
69
|
updatedOrderServices.push(updatedSelectedService);
|
|
70
|
+
if (
|
|
71
|
+
(isAssembleService &&
|
|
72
|
+
updatedSelectedService?.is_deleted === true &&
|
|
73
|
+
(disassemblyTypeService?.is_deleted === true ||
|
|
74
|
+
disassemblyTypeService === undefined ||
|
|
75
|
+
disassemblyTypeService === null)) ||
|
|
76
|
+
(isDisassembleService &&
|
|
77
|
+
updatedSelectedService?.is_deleted === true &&
|
|
78
|
+
(assemblyTypeService?.is_deleted === true ||
|
|
79
|
+
assemblyTypeService === undefined ||
|
|
80
|
+
assemblyTypeService === null))
|
|
81
|
+
) {
|
|
82
|
+
const prevSelectedService = prevOrderServices?.find(
|
|
83
|
+
(s: OrderServiceType) => s?.order_service_list_id === id
|
|
84
|
+
);
|
|
85
|
+
updatedSelectedService = {
|
|
86
|
+
...selectedService,
|
|
87
|
+
is_deleted: true,
|
|
88
|
+
service_category_id: prevSelectedService?.service_category_id,
|
|
89
|
+
};
|
|
90
|
+
updatedOrderServices = clone.filter(
|
|
91
|
+
(service: OrderServiceType) => service.id !== selectedService.id
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
updatedOrderServices.push(updatedSelectedService);
|
|
95
|
+
// new cases
|
|
96
|
+
if (
|
|
97
|
+
isAssembleService &&
|
|
98
|
+
disassemblyTypeService?.is_deleted === true &&
|
|
99
|
+
disassemblyTypeService !== undefined &&
|
|
100
|
+
disassemblyTypeService !== null
|
|
101
|
+
) {
|
|
102
|
+
const newUpdatedSelectedService = {
|
|
103
|
+
...disassemblyTypeService,
|
|
104
|
+
is_deleted: true,
|
|
105
|
+
service_category_id: prevSelectedService?.service_category_id,
|
|
106
|
+
};
|
|
107
|
+
newUpdatedOrderServices = updatedOrderServices?.filter(
|
|
108
|
+
(service: OrderServiceType) =>
|
|
109
|
+
service.id !== disassemblyTypeService.id
|
|
110
|
+
);
|
|
111
|
+
newUpdatedOrderServices?.push(newUpdatedSelectedService);
|
|
112
|
+
}
|
|
113
|
+
// new cases
|
|
114
|
+
if (
|
|
115
|
+
isDisassembleService &&
|
|
116
|
+
assemblyTypeService?.is_deleted === true &&
|
|
117
|
+
assemblyTypeService !== undefined &&
|
|
118
|
+
assemblyTypeService !== null
|
|
119
|
+
) {
|
|
120
|
+
const newUpdatedSelectedService = {
|
|
121
|
+
...assemblyTypeService,
|
|
122
|
+
is_deleted: true,
|
|
123
|
+
service_category_id: prevSelectedService?.service_category_id,
|
|
124
|
+
};
|
|
125
|
+
newUpdatedOrderServices = updatedOrderServices?.filter(
|
|
126
|
+
(service: OrderServiceType) =>
|
|
127
|
+
service.id !== assemblyTypeService.id
|
|
128
|
+
);
|
|
129
|
+
newUpdatedOrderServices?.push(newUpdatedSelectedService);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
47
133
|
const newData = {
|
|
48
134
|
...orderDetails,
|
|
49
|
-
order_services:
|
|
135
|
+
order_services:
|
|
136
|
+
newUpdatedOrderServices.length > 0
|
|
137
|
+
? newUpdatedOrderServices
|
|
138
|
+
: updatedOrderServices,
|
|
50
139
|
};
|
|
51
140
|
setOrderDetails(newData);
|
|
52
141
|
}
|
|
53
142
|
} else {
|
|
54
143
|
// service not exist case
|
|
55
144
|
// if not matched then treat it as an new service
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
145
|
+
let largestId: number;
|
|
146
|
+
if (clone === undefined || clone.length === 0) {
|
|
147
|
+
largestId = 0;
|
|
148
|
+
} else {
|
|
149
|
+
largestId = Math.max(
|
|
150
|
+
...clone?.map((o: OrderServiceType) => +o?.order_service_list_id!)
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
let service: OrderServiceType = {};
|
|
155
|
+
// Normal service addition
|
|
156
|
+
service = {
|
|
60
157
|
is_deleted: false,
|
|
61
158
|
order_service_list_id: id,
|
|
62
159
|
new_id:
|
|
63
160
|
largestId !== undefined && largestId !== null ? largestId + 1 : 1,
|
|
64
161
|
id: largestId !== undefined && largestId !== null ? largestId + 1 : 1,
|
|
65
162
|
};
|
|
163
|
+
// special case if assembly already exist and we are adding disassemble service and vice-versa
|
|
164
|
+
if (
|
|
165
|
+
assemblyTypeService?.is_deleted === false &&
|
|
166
|
+
disassembleOrderService?.id === id
|
|
167
|
+
) {
|
|
168
|
+
service = {
|
|
169
|
+
is_deleted: false,
|
|
170
|
+
order_service_list_id: id,
|
|
171
|
+
new_id:
|
|
172
|
+
largestId !== undefined && largestId !== null ? largestId + 1 : 1,
|
|
173
|
+
id: largestId !== undefined && largestId !== null ? largestId + 1 : 1,
|
|
174
|
+
service_category_id: assemblyTypeService?.service_category_id,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (
|
|
179
|
+
disassemblyTypeService?.is_deleted === false &&
|
|
180
|
+
assembleOrderService?.id === id
|
|
181
|
+
) {
|
|
182
|
+
service = {
|
|
183
|
+
is_deleted: false,
|
|
184
|
+
order_service_list_id: id,
|
|
185
|
+
new_id:
|
|
186
|
+
largestId !== undefined && largestId !== null ? largestId + 1 : 1,
|
|
187
|
+
id: largestId !== undefined && largestId !== null ? largestId + 1 : 1,
|
|
188
|
+
service_category_id: disassemblyTypeService?.service_category_id,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
66
191
|
clone.push(service);
|
|
67
192
|
const newData = { ...orderDetails, order_services: clone };
|
|
68
193
|
setOrderDetails(newData);
|
package/src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Label,
|
|
4
|
-
SelectDropdown,
|
|
5
|
-
dropdownStyles,
|
|
6
|
-
} from '@bjsdistribution/dms-component-library';
|
|
2
|
+
import { Label, SelectDropdown } from '@bjsdistribution/dms-component-library';
|
|
7
3
|
import { useOrderDetails, useOrderStaticData } from '../../../store';
|
|
8
4
|
import styled from 'styled-components';
|
|
9
5
|
import { capitalize } from '../../../utils';
|
|
@@ -36,14 +32,6 @@ function ServiceTypeDropdown() {
|
|
|
36
32
|
inputId="serviceTypeDropdown"
|
|
37
33
|
openMenuOnFocus
|
|
38
34
|
onChange={onChange}
|
|
39
|
-
styles={{
|
|
40
|
-
...dropdownStyles,
|
|
41
|
-
control: styles => ({
|
|
42
|
-
...styles,
|
|
43
|
-
borderRadius: '25px',
|
|
44
|
-
cursor: 'pointer',
|
|
45
|
-
}),
|
|
46
|
-
}}
|
|
47
35
|
/>
|
|
48
36
|
</Container>
|
|
49
37
|
);
|
package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { useOrderDetails, useOrderStaticData } from '../../../store';
|
|
3
|
-
import {
|
|
4
|
-
Label,
|
|
5
|
-
SelectDropdown,
|
|
6
|
-
dropdownStyles,
|
|
7
|
-
} from '@bjsdistribution/dms-component-library';
|
|
3
|
+
import { Label, SelectDropdown } from '@bjsdistribution/dms-component-library';
|
|
8
4
|
import styled from 'styled-components';
|
|
9
5
|
import { capitalize } from '../../../utils';
|
|
10
6
|
|
|
7
|
+
function convertTo12HourFormat(time24: any) {
|
|
8
|
+
const [hours, minutes] = time24?.split(':')?.map(Number);
|
|
9
|
+
const period = hours >= 12 ? 'PM' : 'AM';
|
|
10
|
+
const hours12 = hours % 12 || 12; // Convert to 12-hour format
|
|
11
|
+
return `${hours12}:${minutes?.toString()?.padStart(2, '0')} ${period}`;
|
|
12
|
+
}
|
|
13
|
+
|
|
11
14
|
function TimedServiceDropdown() {
|
|
12
15
|
const [orderStaticData] = useOrderStaticData();
|
|
13
16
|
const [orderData, setOrderData] = useOrderDetails();
|
|
@@ -15,10 +18,17 @@ function TimedServiceDropdown() {
|
|
|
15
18
|
const timesServiceId = orderData?.order_services_detail?.timed_service_id;
|
|
16
19
|
|
|
17
20
|
const timedServicesOptions = orderStaticData?.order_timed_services?.map(
|
|
18
|
-
(option: any) =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
(option: any) => {
|
|
22
|
+
const startTime = convertTo12HourFormat(option?.start_time);
|
|
23
|
+
const endTime = convertTo12HourFormat(option?.end_time);
|
|
24
|
+
const label = `${capitalize(
|
|
25
|
+
option?.type?.replaceAll('_', ' ')
|
|
26
|
+
)} (${startTime} - ${endTime})`;
|
|
27
|
+
return {
|
|
28
|
+
label: label,
|
|
29
|
+
value: option?.id,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
22
32
|
);
|
|
23
33
|
|
|
24
34
|
const onChange = (event: any) => {
|
|
@@ -41,15 +51,6 @@ function TimedServiceDropdown() {
|
|
|
41
51
|
)}
|
|
42
52
|
inputId="timedServiceDropdown"
|
|
43
53
|
onChange={onChange}
|
|
44
|
-
styles={{
|
|
45
|
-
...dropdownStyles,
|
|
46
|
-
|
|
47
|
-
control: styles => ({
|
|
48
|
-
...styles,
|
|
49
|
-
borderRadius: '25px',
|
|
50
|
-
cursor: 'pointer',
|
|
51
|
-
}),
|
|
52
|
-
}}
|
|
53
54
|
/>
|
|
54
55
|
</Container>
|
|
55
56
|
);
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import Badge from './Badge';
|
|
15
15
|
import {
|
|
16
16
|
countReducerAtom,
|
|
17
|
-
|
|
17
|
+
letselectedProductIdAtom,
|
|
18
18
|
useAtom,
|
|
19
19
|
useProductDetails,
|
|
20
20
|
} from '../../../store';
|
|
@@ -33,7 +33,7 @@ function Product({ status, productId }: IProps) {
|
|
|
33
33
|
const [, dispatch] = useAtom(countReducerAtom);
|
|
34
34
|
const [multiProduct] = useProductDetails();
|
|
35
35
|
const productdata = multiProduct?.find((item: any) => item.id === productId);
|
|
36
|
-
const [, setSelectedProductId] = useAtom(
|
|
36
|
+
const [, setSelectedProductId] = useAtom(letselectedProductIdAtom);
|
|
37
37
|
if (!productdata) {
|
|
38
38
|
return null;
|
|
39
39
|
}
|
package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx
CHANGED
|
@@ -1,32 +1,56 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useEffect, useState, useCallback } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
StyledTable,
|
|
4
4
|
StyledTableWrapper,
|
|
5
5
|
} from '../../../order-daily-overview/return-order-table/return-orders-filters/returnstyles';
|
|
6
|
-
import { Checkbox } from '@bjsdistribution/dms-component-library';
|
|
7
|
-
// import { data } from '../../../order-daily-overview/table/table-data/Fakedata';
|
|
6
|
+
import { Checkbox, useApiHook } from '@bjsdistribution/dms-component-library';
|
|
8
7
|
import ActionIcon from '../../../../assets/icons/ActionIcon';
|
|
9
8
|
import { useSelectedOrders } from '../../../store';
|
|
10
|
-
import { useProductDetails } from '../../store';
|
|
9
|
+
import { useOrderId, useProductDetails } from '../../store';
|
|
10
|
+
import { ApiResponse } from '../../types';
|
|
11
11
|
|
|
12
12
|
const ReturnProductTable = () => {
|
|
13
13
|
const [selectedInvoices] = useSelectedOrders();
|
|
14
|
-
const [selectAll] = useState(false);
|
|
15
|
-
const [productData] = useProductDetails();
|
|
14
|
+
const [selectAll, setSelectAll] = useState(false);
|
|
15
|
+
const [productData, setProductData] = useProductDetails();
|
|
16
|
+
const [selectedRowId, setSelectedRowId] = useState<number | null>(null);
|
|
17
|
+
const [orderId] = useOrderId();
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
19
|
+
const handleActionClick = useCallback((id: number) => {
|
|
20
|
+
setSelectedRowId(id);
|
|
21
|
+
}, []);
|
|
22
|
+
|
|
23
|
+
const { data: isresponse, setShouldPerformAction: setaction } = useApiHook<{
|
|
24
|
+
data: ApiResponse[];
|
|
25
|
+
}>({
|
|
26
|
+
endpoint: `order/order_products/delete/`,
|
|
27
|
+
method: 'DELETE',
|
|
28
|
+
body: [{ id: selectedRowId, order_id: orderId }],
|
|
29
|
+
performAction: false,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (isresponse && isresponse.data) {
|
|
34
|
+
handleRemoveRow();
|
|
35
|
+
setSelectedRowId(null);
|
|
36
|
+
}
|
|
37
|
+
}, [isresponse]);
|
|
38
|
+
|
|
39
|
+
const handleRemoveRow = useCallback(() => {
|
|
40
|
+
if (selectedRowId !== null) {
|
|
41
|
+
setProductData((prevData: any) =>
|
|
42
|
+
prevData.filter((item: any) => item.id !== selectedRowId)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
}, [selectedRowId, setProductData]);
|
|
46
|
+
|
|
47
|
+
const onDeleteProducts = useCallback(() => {
|
|
48
|
+
setaction(true);
|
|
49
|
+
}, [setaction, selectedRowId]);
|
|
50
|
+
|
|
51
|
+
const handleSelectAll = useCallback(() => {
|
|
52
|
+
setSelectAll(prevSelectAll => !prevSelectAll);
|
|
53
|
+
}, []);
|
|
30
54
|
|
|
31
55
|
return (
|
|
32
56
|
<div>
|
|
@@ -35,69 +59,54 @@ const ReturnProductTable = () => {
|
|
|
35
59
|
<thead>
|
|
36
60
|
<tr>
|
|
37
61
|
<th className="emailInvoiceCheckbox">
|
|
38
|
-
<Checkbox checked={selectAll} onChange={
|
|
62
|
+
<Checkbox checked={selectAll} onChange={handleSelectAll} />
|
|
39
63
|
</th>
|
|
40
|
-
<th>
|
|
64
|
+
<th>Location</th>
|
|
41
65
|
<th>Sender</th>
|
|
42
66
|
<th>Code</th>
|
|
43
|
-
<th>
|
|
67
|
+
<th>Description</th>
|
|
44
68
|
<th>Return Reason</th>
|
|
45
69
|
<th>Part</th>
|
|
46
|
-
<th>
|
|
70
|
+
<th>Action</th>
|
|
47
71
|
</tr>
|
|
48
72
|
</thead>
|
|
49
73
|
<tbody>
|
|
50
|
-
{productData
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
(
|
|
56
|
-
selectedInvoice
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</td>
|
|
60
|
-
|
|
61
|
-
<td>{'N/A'}</td>
|
|
62
|
-
|
|
63
|
-
<td>
|
|
64
|
-
{/* <ul style={{ listStyleType: 'none', padding: 0 }}> */}
|
|
65
|
-
{/* <li> */}
|
|
66
|
-
{'N/A'}
|
|
67
|
-
{/* </li> */}
|
|
68
|
-
{/* </ul> */}
|
|
69
|
-
</td>
|
|
70
|
-
|
|
71
|
-
<td>{invoice?.code}</td>
|
|
72
|
-
<td>{invoice?.description}</td>
|
|
73
|
-
<td>{'N/A'}</td>
|
|
74
|
-
<td>1 of 1</td>
|
|
75
|
-
|
|
76
|
-
{/* <td onClick={() => dispatch({ type: 'email-sent' })}>
|
|
77
|
-
<IconContainers>
|
|
78
|
-
<i>
|
|
79
|
-
<ExportIcon />
|
|
80
|
-
</i>
|
|
81
|
-
</IconContainers>
|
|
74
|
+
{productData && productData.length > 0 ? (
|
|
75
|
+
productData.map((invoice: any) => (
|
|
76
|
+
<tr key={invoice.id}>
|
|
77
|
+
<td>
|
|
78
|
+
<Checkbox
|
|
79
|
+
checked={selectedInvoices.some(
|
|
80
|
+
selectedInvoice => selectedInvoice.id === invoice.id
|
|
81
|
+
)}
|
|
82
|
+
/>
|
|
82
83
|
</td>
|
|
84
|
+
<td>{'N/A'}</td>
|
|
85
|
+
<td>{'N/A'}</td>
|
|
86
|
+
<td>{invoice.code}</td>
|
|
87
|
+
<td>{invoice.description}</td>
|
|
88
|
+
<td>{'N/A'}</td>
|
|
89
|
+
<td>1 of 1</td>
|
|
83
90
|
<td>
|
|
84
|
-
<
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
<div
|
|
92
|
+
onClick={() => {
|
|
93
|
+
handleActionClick(invoice.id);
|
|
94
|
+
onDeleteProducts();
|
|
95
|
+
}}
|
|
96
|
+
style={{ cursor: 'pointer' }}
|
|
97
|
+
>
|
|
98
|
+
<ActionIcon />
|
|
99
|
+
</div>
|
|
100
|
+
</td>
|
|
101
|
+
</tr>
|
|
102
|
+
))
|
|
103
|
+
) : (
|
|
104
|
+
<tr>
|
|
105
|
+
<td colSpan={8} style={{ textAlign: 'center' }}>
|
|
106
|
+
No records found
|
|
98
107
|
</td>
|
|
99
108
|
</tr>
|
|
100
|
-
)
|
|
109
|
+
)}
|
|
101
110
|
</tbody>
|
|
102
111
|
</StyledTable>
|
|
103
112
|
</StyledTableWrapper>
|
|
@@ -2,15 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { Button } from '@bjsdistribution/dms-component-library';
|
|
4
4
|
import NewReturnDropdown from '../../notes/order-dropdown/NewReturnDropdown';
|
|
5
|
-
import { notification } from 'antd';
|
|
5
|
+
// import { notification } from 'antd';
|
|
6
6
|
|
|
7
7
|
function OrderDetailsFooter() {
|
|
8
8
|
const onSave = () => {
|
|
9
9
|
// alert('saved');
|
|
10
|
-
notification.success({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
});
|
|
10
|
+
// notification.success({
|
|
11
|
+
// message: 'Success',
|
|
12
|
+
// description: ' Saved successfully.',
|
|
13
|
+
// });
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
return (
|