@bjsdistribution/dms-client-return 0.0.27 → 0.0.29
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/dms-client-return.cjs.development.js +426 -388
- 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 +427 -389
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +4 -3
- package/src/components/order-daily-overview/shared/utlis.ts +1 -3
- package/src/components/order-view/hooks/useGetSystemLogs.tsx +2 -1
- package/src/components/order-view/modalsPopup/ModalManager.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx +3 -12
- package/src/components/order-view/order-details/expanded-content/services-section/OrderServices.tsx +2 -13
- package/src/components/order-view/order-details/expanded-content/services-section/ServiceLevel.tsx +4 -18
- package/src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx +1 -10
- package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx +2 -12
- package/src/components/order-view/order-details/expanded-content/services-section/index.tsx +0 -5
- package/src/components/order-view/products-info/collapsed-content/index.tsx +90 -9
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +1 -15
package/package.json
CHANGED
|
@@ -88,8 +88,8 @@ function SelectionFilter() {
|
|
|
88
88
|
const selectedLabel = option?.label as string;
|
|
89
89
|
const selectedValue = option?.id as number;
|
|
90
90
|
const selectedUuids = option?.uuid as string;
|
|
91
|
-
const selectAccountNumber = option
|
|
92
|
-
const selectedCustomerId = option
|
|
91
|
+
const selectAccountNumber = option?.account_number as string;
|
|
92
|
+
const selectedCustomerId = option?.gsit_customer_id as number;
|
|
93
93
|
setSelectedClient(selectedValue);
|
|
94
94
|
setName(selectedLabel);
|
|
95
95
|
// storedName(selectedLabel);
|
|
@@ -263,7 +263,8 @@ function SelectionFilter() {
|
|
|
263
263
|
useEffect(() => {
|
|
264
264
|
if (clearState) {
|
|
265
265
|
dispatch({ type: 'CLEAR_CLIENT' });
|
|
266
|
-
window.location.href = '/returnclient';
|
|
266
|
+
// window.location.href = '/returnclient';
|
|
267
|
+
window.location.replace('/returnclient');
|
|
267
268
|
}
|
|
268
269
|
}, [clearState]);
|
|
269
270
|
|
|
@@ -69,9 +69,7 @@ export const formatDate = (date: any) => {
|
|
|
69
69
|
// const minutes = padZero(date.getMinutes());
|
|
70
70
|
// const seconds = padZero(date.getSeconds());
|
|
71
71
|
|
|
72
|
-
return
|
|
73
|
-
${day}/${month}/${year}
|
|
74
|
-
`;
|
|
72
|
+
return `${year}-${month}-${day}`;
|
|
75
73
|
};
|
|
76
74
|
|
|
77
75
|
export const displayValueOrNA = (value: any) => {
|
package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx
CHANGED
|
@@ -26,13 +26,10 @@ function DeliveryPointDropdown() {
|
|
|
26
26
|
const newData = { ...orderData, order_services_detail: updatedServices };
|
|
27
27
|
setOrderData(newData);
|
|
28
28
|
};
|
|
29
|
-
|
|
30
|
-
const isDisabled = true;
|
|
31
|
-
|
|
32
29
|
return (
|
|
33
30
|
<Container>
|
|
34
31
|
<Label label="Delivery Point" htmlFor="deliveryPointDropdown" />
|
|
35
|
-
<
|
|
32
|
+
<SelectDropdown
|
|
36
33
|
placeholder="Select Delivery Point"
|
|
37
34
|
options={deliveryPointOptions || []}
|
|
38
35
|
inputId="deliveryPointDropdown"
|
|
@@ -41,8 +38,7 @@ function DeliveryPointDropdown() {
|
|
|
41
38
|
)}
|
|
42
39
|
openMenuOnFocus
|
|
43
40
|
onChange={onChange}
|
|
44
|
-
|
|
45
|
-
className={isDisabled ? 'disabled' : ''}
|
|
41
|
+
isDisabled={true}
|
|
46
42
|
/>
|
|
47
43
|
</Container>
|
|
48
44
|
);
|
|
@@ -54,10 +50,5 @@ const Container = styled.div`
|
|
|
54
50
|
gap: 6px;
|
|
55
51
|
flex: 1;
|
|
56
52
|
`;
|
|
57
|
-
|
|
58
|
-
&.disabled {
|
|
59
|
-
pointer-events: none;
|
|
60
|
-
opacity: 0.7;
|
|
61
|
-
}
|
|
62
|
-
`;
|
|
53
|
+
|
|
63
54
|
export default DeliveryPointDropdown;
|
package/src/components/order-view/order-details/expanded-content/services-section/OrderServices.tsx
CHANGED
|
@@ -193,10 +193,9 @@ function OrderServices() {
|
|
|
193
193
|
setOrderDetails(newData);
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
|
-
const isDisabled = true;
|
|
197
196
|
|
|
198
197
|
return (
|
|
199
|
-
<Container
|
|
198
|
+
<Container>
|
|
200
199
|
{orderServicesOptions?.map((service: any) => {
|
|
201
200
|
const selected = !!orderServices?.find(
|
|
202
201
|
(s: OrderServiceType) =>
|
|
@@ -217,22 +216,12 @@ function OrderServices() {
|
|
|
217
216
|
);
|
|
218
217
|
}
|
|
219
218
|
|
|
220
|
-
const Container = styled.div
|
|
219
|
+
const Container = styled.div`
|
|
221
220
|
display: flex;
|
|
222
221
|
gap: 30px;
|
|
223
222
|
flex: 1;
|
|
224
223
|
@media screen and (max-width: 1170px) {
|
|
225
224
|
flex-wrap: wrap;
|
|
226
|
-
|
|
227
|
-
${({ disabled }) =>
|
|
228
|
-
disabled &&
|
|
229
|
-
`
|
|
230
|
-
pointer-events: none;
|
|
231
|
-
|
|
232
|
-
> * {
|
|
233
|
-
pointer-events: none;
|
|
234
|
-
}
|
|
235
|
-
`}
|
|
236
225
|
}
|
|
237
226
|
`;
|
|
238
227
|
|
package/src/components/order-view/order-details/expanded-content/services-section/ServiceLevel.tsx
CHANGED
|
@@ -26,40 +26,26 @@ function ServiceLevel() {
|
|
|
26
26
|
const newData = { ...orderData, order_services_detail: updatedServices };
|
|
27
27
|
setOrderData(newData);
|
|
28
28
|
};
|
|
29
|
-
|
|
30
|
-
const isDisabled = true; // Example value
|
|
31
|
-
|
|
32
29
|
return (
|
|
33
|
-
<Container
|
|
30
|
+
<Container>
|
|
34
31
|
<RadioButtonGroup
|
|
35
32
|
selectedValue={serviceLevelId?.toString() || ''}
|
|
36
33
|
heading="Service Level"
|
|
37
34
|
options={serviceLevelOptions || []}
|
|
38
35
|
onChange={radioGroupHandler}
|
|
39
36
|
required={true}
|
|
40
|
-
isDisabled={
|
|
37
|
+
isDisabled={true}
|
|
41
38
|
/>
|
|
42
39
|
</Container>
|
|
43
40
|
);
|
|
44
41
|
}
|
|
45
42
|
|
|
46
|
-
const Container = styled.div
|
|
43
|
+
const Container = styled.div`
|
|
47
44
|
display: flex;
|
|
48
45
|
flex-direction: column;
|
|
49
46
|
gap: 6px;
|
|
50
47
|
flex: 1;
|
|
51
|
-
|
|
52
|
-
${({ disabled }) =>
|
|
53
|
-
disabled &&
|
|
54
|
-
`
|
|
55
|
-
cursor: not-allowed;
|
|
56
|
-
pointer-events: none;
|
|
57
|
-
|
|
58
|
-
> * {
|
|
59
|
-
cursor: not-allowed;
|
|
60
|
-
}
|
|
61
|
-
`}
|
|
62
|
-
|
|
48
|
+
/* temporary change will add this in library */
|
|
63
49
|
> fieldset {
|
|
64
50
|
> div {
|
|
65
51
|
> div {
|
package/src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx
CHANGED
|
@@ -21,12 +21,11 @@ function ServiceTypeDropdown() {
|
|
|
21
21
|
const newData = { ...orderData, order_type_id: event.value };
|
|
22
22
|
setOrderData(newData);
|
|
23
23
|
};
|
|
24
|
-
const isDisabled = true;
|
|
25
24
|
|
|
26
25
|
return (
|
|
27
26
|
<Container>
|
|
28
27
|
<Label label="Service Type" htmlFor="serviceTypeDropdown" />
|
|
29
|
-
<
|
|
28
|
+
<SelectDropdown
|
|
30
29
|
placeholder="Select Service Type"
|
|
31
30
|
options={serviceTypeOptions || []}
|
|
32
31
|
value={serviceTypeOptions?.filter((f: any) => f.value === orderTypeId)}
|
|
@@ -34,7 +33,6 @@ function ServiceTypeDropdown() {
|
|
|
34
33
|
openMenuOnFocus
|
|
35
34
|
onChange={onChange}
|
|
36
35
|
isDisabled={true}
|
|
37
|
-
className={isDisabled ? 'disabled' : ''}
|
|
38
36
|
/>
|
|
39
37
|
</Container>
|
|
40
38
|
);
|
|
@@ -47,11 +45,4 @@ const Container = styled.div`
|
|
|
47
45
|
flex: 1;
|
|
48
46
|
`;
|
|
49
47
|
|
|
50
|
-
const StyledSelectDropdown = styled(SelectDropdown)`
|
|
51
|
-
&.disabled {
|
|
52
|
-
cursor: not-allowed !important;
|
|
53
|
-
opacity: 0.7;
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
|
|
57
48
|
export default ServiceTypeDropdown;
|
package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx
CHANGED
|
@@ -40,12 +40,10 @@ function TimedServiceDropdown() {
|
|
|
40
40
|
setOrderData(newData);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
const isDisabled = true;
|
|
44
|
-
|
|
45
43
|
return (
|
|
46
44
|
<Container>
|
|
47
45
|
<Label label="Timed Service" htmlFor="timedServiceDropdown" />
|
|
48
|
-
<
|
|
46
|
+
<SelectDropdown
|
|
49
47
|
placeholder="Select Timed Service"
|
|
50
48
|
options={timedServicesOptions || []}
|
|
51
49
|
value={timedServicesOptions?.filter(
|
|
@@ -53,8 +51,7 @@ function TimedServiceDropdown() {
|
|
|
53
51
|
)}
|
|
54
52
|
inputId="timedServiceDropdown"
|
|
55
53
|
onChange={onChange}
|
|
56
|
-
|
|
57
|
-
className={isDisabled ? 'disabled' : ''}
|
|
54
|
+
isDisabled={true}
|
|
58
55
|
/>
|
|
59
56
|
</Container>
|
|
60
57
|
);
|
|
@@ -67,11 +64,4 @@ const Container = styled.div`
|
|
|
67
64
|
flex: 1;
|
|
68
65
|
`;
|
|
69
66
|
|
|
70
|
-
const StyledSelectDropdown = styled(SelectDropdown)`
|
|
71
|
-
&.disabled {
|
|
72
|
-
pointer-events: none;
|
|
73
|
-
opacity: 0.7;
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
76
|
-
|
|
77
67
|
export default TimedServiceDropdown;
|
|
@@ -66,11 +66,6 @@ const CustomFormSection = styled(FormSection)`
|
|
|
66
66
|
border-radius: 8px;
|
|
67
67
|
background: #f8fafc;
|
|
68
68
|
box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1);
|
|
69
|
-
label,
|
|
70
|
-
input,
|
|
71
|
-
span {
|
|
72
|
-
cursor: default !important;
|
|
73
|
-
}
|
|
74
69
|
`;
|
|
75
70
|
|
|
76
71
|
export default ServicesSection;
|
|
@@ -1,28 +1,109 @@
|
|
|
1
1
|
import { SectionHeader } from '@bjsdistribution/dms-component-library';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
+
// import ModalManager from '../../modalsPopup/ModalManager';
|
|
5
|
+
// import { countReducerAtom, useProductDetails } from '../../store';
|
|
6
|
+
// import { useAtom } from 'jotai';
|
|
4
7
|
|
|
5
8
|
function CollapsedContent() {
|
|
9
|
+
// const [, dispatch] = useAtom(countReducerAtom);
|
|
10
|
+
// const [productdata] = useProductDetails();
|
|
11
|
+
// const totalItems = productdata?.length;
|
|
12
|
+
|
|
13
|
+
// const totalCube = () => {
|
|
14
|
+
// let cubeData = 0;
|
|
15
|
+
// for (let i = 0; i < productdata?.length; i++) {
|
|
16
|
+
// cubeData += parseFloat(productdata[i].cube);
|
|
17
|
+
// }
|
|
18
|
+
// return `${cubeData.toFixed(2)}m³`;
|
|
19
|
+
// };
|
|
20
|
+
|
|
21
|
+
// const totalWeight = () => {
|
|
22
|
+
// let weightData = 0;
|
|
23
|
+
// for (let i = 0; i < productdata?.length; i++) {
|
|
24
|
+
// weightData += parseFloat(productdata[i].weight);
|
|
25
|
+
// }
|
|
26
|
+
// return `${weightData.toFixed(2)} KG`;
|
|
27
|
+
// };
|
|
6
28
|
return (
|
|
7
29
|
<Container>
|
|
8
30
|
<SectionHeader label="Products" />
|
|
9
|
-
<
|
|
31
|
+
{/* <Left>
|
|
32
|
+
<Items>{totalItems} Delivery Items</Items>
|
|
33
|
+
<Dimensions>
|
|
34
|
+
{totalWeight()}/ {totalCube()}
|
|
35
|
+
</Dimensions>
|
|
36
|
+
</Left>
|
|
37
|
+
<Right>
|
|
38
|
+
<ActionContainer onClick={() => dispatch({ type: 'bulkUpdate' })}>
|
|
39
|
+
<Action>Bulk Update</Action>
|
|
40
|
+
</ActionContainer>
|
|
41
|
+
<ActionContainer onClick={() => dispatch({ type: 'addProduct' })}>
|
|
42
|
+
<Action>ADD NEW PRODUCT(S)</Action>
|
|
43
|
+
</ActionContainer>
|
|
44
|
+
<ActionContainer onClick={() => dispatch({ type: 'deleteProduct' })}>
|
|
45
|
+
<Action>DELETE PRODUCT(S)</Action>
|
|
46
|
+
</ActionContainer>
|
|
47
|
+
</Right>
|
|
48
|
+
<ModalManager /> */}
|
|
10
49
|
</Container>
|
|
11
50
|
);
|
|
12
51
|
}
|
|
13
52
|
|
|
14
|
-
const Dimensions = styled.span`
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
`;
|
|
53
|
+
// const Dimensions = styled.span`
|
|
54
|
+
// font-family: 'Lato', sans-serif;
|
|
55
|
+
// font-size: 13px;
|
|
56
|
+
// font-weight: 500;
|
|
57
|
+
// line-height: 16px;
|
|
58
|
+
// color: #8e8a85;
|
|
59
|
+
// `;
|
|
60
|
+
|
|
61
|
+
// const Right = styled.div`
|
|
62
|
+
// margin-left: auto;
|
|
63
|
+
// display: flex;
|
|
64
|
+
// gap: 10px;
|
|
65
|
+
// margin-right: 10px;
|
|
66
|
+
// `;
|
|
67
|
+
|
|
68
|
+
// const Action = styled.span`
|
|
69
|
+
// color: #3a3630;
|
|
70
|
+
// font-family: 'Lato', sans-serif;
|
|
71
|
+
// font-size: 12px;
|
|
72
|
+
// font-style: normal;
|
|
73
|
+
// font-weight: 600;
|
|
74
|
+
// line-height: 20px;
|
|
75
|
+
// text-transform: uppercase;
|
|
76
|
+
// `;
|
|
77
|
+
|
|
78
|
+
// const ActionContainer = styled.div`
|
|
79
|
+
// padding: 5px 10px;
|
|
80
|
+
// border-radius: 4px;
|
|
81
|
+
// border: 1px solid #edebe8;
|
|
82
|
+
// background: #edebe8;
|
|
83
|
+
// box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
84
|
+
// cursor: pointer;
|
|
85
|
+
// `;
|
|
86
|
+
|
|
87
|
+
// const Items = styled.span`
|
|
88
|
+
// font-family: 'Roboto', sans-serif;
|
|
89
|
+
// font-size: 14px;
|
|
90
|
+
// font-weight: 500;
|
|
91
|
+
// line-height: 24px;
|
|
92
|
+
// color: #8e8a85;
|
|
93
|
+
// text-transform: capitalize;
|
|
94
|
+
// color: #aea9a1;
|
|
95
|
+
// `;
|
|
96
|
+
|
|
97
|
+
// const Left = styled.div`
|
|
98
|
+
// display: flex;
|
|
99
|
+
// align-items: center;
|
|
100
|
+
// gap: 30px;
|
|
101
|
+
// `;
|
|
21
102
|
|
|
22
103
|
const Container = styled.div`
|
|
23
104
|
display: flex;
|
|
24
105
|
align-items: center;
|
|
25
|
-
|
|
106
|
+
justify-content: space-between;
|
|
26
107
|
width: 100%;
|
|
27
108
|
gap: 30px;
|
|
28
109
|
`;
|
package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx
CHANGED
|
@@ -8,8 +8,6 @@ import ActionIcon from '../../../../assets/icons/ActionIcon';
|
|
|
8
8
|
import { useSelectedOrders } from '../../../store';
|
|
9
9
|
import { useOrderId, useOrderStaticData, useProductDetails } from '../../store';
|
|
10
10
|
import { ApiResponse } from '../../types';
|
|
11
|
-
import Loader from '../../../order-daily-overview/header/loader/Loader';
|
|
12
|
-
import { notification } from 'antd';
|
|
13
11
|
|
|
14
12
|
const ReturnProductTable = () => {
|
|
15
13
|
const [selectedInvoices] = useSelectedOrders();
|
|
@@ -22,11 +20,7 @@ const ReturnProductTable = () => {
|
|
|
22
20
|
setSelectedRowId(id);
|
|
23
21
|
}, []);
|
|
24
22
|
|
|
25
|
-
const {
|
|
26
|
-
data: isresponse,
|
|
27
|
-
setShouldPerformAction: setaction,
|
|
28
|
-
loading,
|
|
29
|
-
} = useApiHook<{
|
|
23
|
+
const { data: isresponse, setShouldPerformAction: setaction } = useApiHook<{
|
|
30
24
|
data: ApiResponse[];
|
|
31
25
|
}>({
|
|
32
26
|
endpoint: `order/order_products/delete/`,
|
|
@@ -37,13 +31,6 @@ const ReturnProductTable = () => {
|
|
|
37
31
|
|
|
38
32
|
useEffect(() => {
|
|
39
33
|
if (isresponse && isresponse.data) {
|
|
40
|
-
notification.success({
|
|
41
|
-
message: 'Success',
|
|
42
|
-
description:
|
|
43
|
-
//@ts-ignore
|
|
44
|
-
isresponse?.message ||
|
|
45
|
-
'An error has occurred. Please try again later.',
|
|
46
|
-
});
|
|
47
34
|
handleRemoveRow();
|
|
48
35
|
setSelectedRowId(null);
|
|
49
36
|
}
|
|
@@ -84,7 +71,6 @@ const ReturnProductTable = () => {
|
|
|
84
71
|
|
|
85
72
|
return (
|
|
86
73
|
<div>
|
|
87
|
-
{loading && <Loader title="Deleting" />}
|
|
88
74
|
<StyledTableWrapper id="tableScrolling">
|
|
89
75
|
<StyledTable>
|
|
90
76
|
<thead>
|