@bjsdistribution/dms-client-return 0.0.1 → 0.0.3
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/interface.d.ts +22 -0
- package/dist/components/order-daily-overview/header-filters/Styledfilters.d.ts +1 -2
- package/dist/components/order-daily-overview/header-filters/filterStore.d.ts +16 -0
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.d.ts +1 -0
- package/dist/components/order-daily-overview/shared/utlis.d.ts +2 -2
- package/dist/components/order-daily-overview/store/store.d.ts +4 -0
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.d.ts +3 -1
- package/dist/components/order-view/store.d.ts +5 -1
- package/dist/components/store.d.ts +5 -2
- package/dist/components/types.d.ts +1 -1
- package/dist/dms-client-return.cjs.development.js +1065 -964
- 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 +1067 -966
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/order-daily-overview/common/fakedata.tsx +5 -6
- package/src/components/order-daily-overview/common/interface.ts +120 -97
- package/src/components/order-daily-overview/filters/Filters.tsx +1 -8
- package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +56 -67
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +160 -223
- package/src/components/order-daily-overview/header-filters/Styledfilters.tsx +19 -7
- package/src/components/order-daily-overview/header-filters/filterStore.ts +145 -0
- package/src/components/order-daily-overview/index.tsx +59 -6
- package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +24 -1
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +177 -234
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +63 -6
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +5 -47
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +51 -185
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +62 -0
- package/src/components/order-daily-overview/store/store.ts +23 -12
- package/src/components/order-daily-overview/table/ReturnTable.tsx +193 -205
- package/src/components/order-view/details-filters/DetailsFilters.tsx +3 -2
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.tsx +57 -46
- package/src/components/order-view/general-information/Status.tsx +1 -1
- package/src/components/order-view/index.tsx +6 -4
- package/src/components/order-view/modalsPopup/UnReceiveProduct.tsx +1 -1
- package/src/components/order-view/order-actions/actions/escalation/EscalationModal.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/customer-section/RecipientName.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactEmail.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactWork.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Address.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Postcode.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/What3words.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/footer/index.tsx +3 -2
- package/src/components/order-view/order-details/expanded-content/index.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/Carrier.tsx +7 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/DeliveryDate.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/orders-section/Depot.tsx +14 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/Droptime.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/OrderNumber.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/RecipientReference.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/ScheduleAfter.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/orders-section/VehicleType.tsx +13 -1
- package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx +13 -1
- package/src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx +13 -1
- package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx +14 -1
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +2 -2
- package/src/components/order-view/store.ts +40 -12
- package/src/components/store.ts +26 -4
- package/src/components/types.ts +2 -6
- package/dist/components/order-daily-overview/table/InfiniteScrolling.d.ts +0 -5
- package/dist/components/order-daily-overview/table/Return.d.ts +0 -3
- package/dist/components/order-daily-overview/table/table-data/MyTable.d.ts +0 -18
- package/dist/components/order-daily-overview/table/table-data/Table.d.ts +0 -18
- package/src/components/order-daily-overview/table/InfiniteScrolling.tsx +0 -54
- package/src/components/order-daily-overview/table/Return.tsx +0 -156
- package/src/components/order-daily-overview/table/table-data/MyTable.tsx +0 -433
- package/src/components/order-daily-overview/table/table-data/Table.tsx +0 -445
package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import {
|
|
3
|
-
// FilterConatiner,
|
|
4
|
-
// FilterIconConatiner,
|
|
5
3
|
LeftSideConatiner,
|
|
6
4
|
StyledFIlterELements,
|
|
7
5
|
StyledFiter,
|
|
@@ -13,8 +11,62 @@ import DownArrowIcon from '../../../../assets/icons/DownArrowIcon';
|
|
|
13
11
|
import StatusIcon from '../../../../assets/icons/StatusIcon';
|
|
14
12
|
import ClientIcon from '../../../../assets/icons/ClientIcon';
|
|
15
13
|
import AssigneIcon from '../../../../assets/icons/AssigneIcon';
|
|
14
|
+
import { DatePicker, DatePickerProps } from 'antd';
|
|
15
|
+
import {
|
|
16
|
+
useOrderDetails,
|
|
17
|
+
usePrevOrderDetails,
|
|
18
|
+
} from '../../../order-view/store';
|
|
19
|
+
import dayjs from 'dayjs';
|
|
16
20
|
|
|
17
21
|
const ReturnOrderFilter = () => {
|
|
22
|
+
const [isDatePickerVisible, setDatePickerVisible] = useState(false);
|
|
23
|
+
|
|
24
|
+
const handleDateIconClick = () => {
|
|
25
|
+
setDatePickerVisible(prevState => !prevState);
|
|
26
|
+
};
|
|
27
|
+
const [orderDetails, setOrderDetails] = useOrderDetails();
|
|
28
|
+
const [prevOrderDetails] = usePrevOrderDetails();
|
|
29
|
+
|
|
30
|
+
const actionDate = orderDetails?.action_date
|
|
31
|
+
? new Date(orderDetails?.action_date)
|
|
32
|
+
: null;
|
|
33
|
+
|
|
34
|
+
const onChange: DatePickerProps['onChange'] = (
|
|
35
|
+
date: any,
|
|
36
|
+
_dateString: any
|
|
37
|
+
) => {
|
|
38
|
+
const selectedDate = date?.format('YYYY-MM-DDTHH:mm:ss');
|
|
39
|
+
if (
|
|
40
|
+
selectedDate !== undefined &&
|
|
41
|
+
prevOrderDetails.action_date !== undefined
|
|
42
|
+
) {
|
|
43
|
+
if (
|
|
44
|
+
new Date(selectedDate).toLocaleDateString() ===
|
|
45
|
+
new Date(prevOrderDetails.action_date!).toLocaleDateString()
|
|
46
|
+
) {
|
|
47
|
+
setOrderDetails(prev => {
|
|
48
|
+
return {
|
|
49
|
+
...prev,
|
|
50
|
+
action_date: prevOrderDetails.action_date,
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
setOrderDetails(prev => {
|
|
55
|
+
return {
|
|
56
|
+
...prev,
|
|
57
|
+
action_date: selectedDate,
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
setOrderDetails(prev => {
|
|
63
|
+
return {
|
|
64
|
+
...prev,
|
|
65
|
+
action_date: null,
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
18
70
|
return (
|
|
19
71
|
<>
|
|
20
72
|
<StyledFiter>
|
|
@@ -27,10 +79,17 @@ const ReturnOrderFilter = () => {
|
|
|
27
79
|
<div className="textcont">Filters</div>
|
|
28
80
|
</div>
|
|
29
81
|
<div className="datefilter">
|
|
30
|
-
<div className="dateiconcontainer">
|
|
82
|
+
<div className="dateiconcontainer" onClick={handleDateIconClick}>
|
|
31
83
|
<DateIcon />
|
|
32
84
|
</div>
|
|
33
85
|
<div className="datetext">Date</div>
|
|
86
|
+
{isDatePickerVisible && (
|
|
87
|
+
<DatePicker
|
|
88
|
+
onChange={onChange}
|
|
89
|
+
value={actionDate === null ? actionDate : dayjs(actionDate)}
|
|
90
|
+
format="DD/MM/YY"
|
|
91
|
+
/>
|
|
92
|
+
)}
|
|
34
93
|
<div className="roundbox">
|
|
35
94
|
<DownArrowIcon />
|
|
36
95
|
</div>
|
|
@@ -41,7 +100,6 @@ const ReturnOrderFilter = () => {
|
|
|
41
100
|
<StatusIcon />
|
|
42
101
|
</div>
|
|
43
102
|
<div className="datetext">Status of Order</div>
|
|
44
|
-
|
|
45
103
|
<div className="roundbox">
|
|
46
104
|
<DownArrowIcon />
|
|
47
105
|
</div>
|
|
@@ -60,7 +118,6 @@ const ReturnOrderFilter = () => {
|
|
|
60
118
|
<AssigneIcon />
|
|
61
119
|
</div>
|
|
62
120
|
<div className="datetext">Assignee</div>
|
|
63
|
-
|
|
64
121
|
<div className="roundbox">
|
|
65
122
|
<DownArrowIcon />
|
|
66
123
|
</div>
|
|
@@ -1,64 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
StyledFIlterELements,
|
|
4
|
+
StyledFiter,
|
|
5
|
+
StyledTableFilter,
|
|
6
|
+
} from '../../filters/FilterStyle';
|
|
3
7
|
import RightFilters from './RightFilters';
|
|
4
8
|
|
|
5
|
-
|
|
6
9
|
const ReturnFilter = () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
10
|
return (
|
|
11
11
|
<>
|
|
12
12
|
<StyledFiter>
|
|
13
13
|
<StyledFIlterELements>
|
|
14
|
-
<Text>Client Return</Text>
|
|
15
|
-
{/* <em>
|
|
16
|
-
<IconContainer>
|
|
17
|
-
<ButtonCon
|
|
18
|
-
className={DataView ? 'active' : ''}
|
|
19
|
-
onClick={() => ToggleView()}
|
|
20
|
-
>
|
|
21
|
-
<TableIcon />
|
|
22
|
-
</ButtonCon>
|
|
23
|
-
<ButtonCon
|
|
24
|
-
className={!DataView ? 'active' : ''}
|
|
25
|
-
onClick={() => ToggleView()}
|
|
26
|
-
>
|
|
27
|
-
<CardsIcon />
|
|
28
|
-
</ButtonCon>
|
|
29
|
-
</IconContainer>
|
|
30
|
-
</em> */}
|
|
31
14
|
<StyledTableFilter />
|
|
32
15
|
</StyledFIlterELements>
|
|
33
16
|
<RightFilters />
|
|
34
17
|
</StyledFiter>
|
|
35
|
-
|
|
36
|
-
{/* {DataView ? (
|
|
37
|
-
<MyTable TableData={TableData} data={data} apiLoading={apiLoading}/>
|
|
38
|
-
) : (
|
|
39
|
-
<CardTable />
|
|
40
|
-
)} */}
|
|
41
18
|
</>
|
|
42
19
|
);
|
|
43
20
|
};
|
|
44
21
|
|
|
45
|
-
// const IconContainer = styled.div`
|
|
46
|
-
// display: flex;
|
|
47
|
-
// gap: 10px;
|
|
48
|
-
// cursor: pointer;
|
|
49
|
-
// `;
|
|
50
|
-
|
|
51
|
-
// const ButtonCon = styled.div`
|
|
52
|
-
// border-radius: 6px;
|
|
53
|
-
// width: 24px;
|
|
54
|
-
// height: 24px;
|
|
55
|
-
// display: flex;
|
|
56
|
-
// align-items: center;
|
|
57
|
-
// justify-content: center;
|
|
58
|
-
// padding: 2px;
|
|
59
|
-
// &.active {
|
|
60
|
-
// background: #ecf1fc;
|
|
61
|
-
// }
|
|
62
|
-
// `;
|
|
63
|
-
|
|
64
22
|
export default ReturnFilter;
|
|
@@ -1,164 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// import { useApiHook } from '@bjsdistribution/dms-component-library';
|
|
4
|
-
// // import { useInQueueData } from '../readyforinvoice/store';
|
|
5
|
-
// // import { useStaticData } from './store';
|
|
6
|
-
// // import useInfiniteScroll from '../readyforinvoice/InfiniteScrolling';
|
|
7
|
-
// import { useAtom } from 'jotai';
|
|
8
|
-
// import { ApiResponse, Column } from '../../../types';
|
|
9
|
-
// import MyTable from '../../table/table-data/MyTable';
|
|
10
|
-
// import { overviewFiltersReducerAtom } from '../FilterStore';
|
|
11
|
-
// import { useInQueueData, useStaticData } from '../../../store';
|
|
12
|
-
// import useInfiniteScroll from '../../../../common/infiniteScrolling';
|
|
13
|
-
// import { data } from '../../table/table-data/Fakedata';
|
|
14
|
-
// // import { overviewFiltersReducerAtom } from '../header-for-invoice/invoice-selection/FilterStore';
|
|
15
|
-
|
|
16
|
-
// const ReturnOrderTable: React.FC = () => {
|
|
17
|
-
// const getStatusId = (data: any) => {
|
|
18
|
-
// console.log(data, 'datadatadatadata');
|
|
19
|
-
// };
|
|
20
|
-
|
|
21
|
-
// const columns: Column[] = [
|
|
22
|
-
// { Header: 'Date', accessor: 'name' },
|
|
23
|
-
// { Header: 'Client', accessor: 'customer_name' },
|
|
24
|
-
// { Header: 'Account No', accessor: 'account_number' },
|
|
25
|
-
// { Header: 'Total Orders', accessor: 'total_orders' },
|
|
26
|
-
// { Header: 'Total Items', accessor: 'total_items' },
|
|
27
|
-
// { Header: 'Discount', accessor: 'discount' },
|
|
28
|
-
// { Header: 'Amount', accessor: 'amount' },
|
|
29
|
-
// { Header: 'VAT', accessor: 'vat_rate' },
|
|
30
|
-
// { Header: 'Total', accessor: 'total_amount' },
|
|
31
|
-
// { Header: 'Update Status', accessor: 'status_id', callback: getStatusId },
|
|
32
|
-
// ];
|
|
33
|
-
|
|
34
|
-
// const [filterState, dispatchOverviewFilter] = useAtom(
|
|
35
|
-
// overviewFiltersReducerAtom
|
|
36
|
-
// );
|
|
37
|
-
// const { 'x-pagination': pagination } = filterState;
|
|
38
|
-
|
|
39
|
-
// const [, setQueueData] = useInQueueData(); //data
|
|
40
|
-
// const [, setStaticData] = useStaticData();
|
|
41
|
-
|
|
42
|
-
// const {
|
|
43
|
-
// data: fetchedInvoiceData,
|
|
44
|
-
// // loadingskeleton,
|
|
45
|
-
// paginationData,
|
|
46
|
-
// setShouldPerformAction,
|
|
47
|
-
// } = useApiHook<ApiResponse>({
|
|
48
|
-
// endpoint: `/invoices/`,
|
|
49
|
-
// method: 'GET',
|
|
50
|
-
// performAction: true,
|
|
51
|
-
// pagination: pagination,
|
|
52
|
-
// filters: [
|
|
53
|
-
// { field: 'invoice_discount_queues.status_id', op: '=', value: 1 },
|
|
54
|
-
// ],
|
|
55
|
-
// });
|
|
56
|
-
|
|
57
|
-
// // infinite scrolling code start here
|
|
58
|
-
// const { page, scrollActivated } = useInfiniteScroll(
|
|
59
|
-
// paginationData,
|
|
60
|
-
// setShouldPerformAction,
|
|
61
|
-
// 'tableScrolling'
|
|
62
|
-
// );
|
|
63
|
-
|
|
64
|
-
// useEffect(() => {
|
|
65
|
-
// dispatchOverviewFilter({ type: 'SET_PAGE', payload: page });
|
|
66
|
-
// }, [page]);
|
|
67
|
-
|
|
68
|
-
// useEffect(() => {
|
|
69
|
-
// if (fetchedInvoiceData && fetchedInvoiceData?.data) {
|
|
70
|
-
// const invoiceData = fetchedInvoiceData?.data;
|
|
71
|
-
|
|
72
|
-
// if (scrollActivated) {
|
|
73
|
-
// setQueueData((prev: any) => {
|
|
74
|
-
// const newData = invoiceData?.filter(
|
|
75
|
-
// (newItem: any) =>
|
|
76
|
-
// !prev?.some((prevItem: any) => prevItem?.id === newItem?.id)
|
|
77
|
-
// );
|
|
78
|
-
// return [...prev, ...newData];
|
|
79
|
-
// });
|
|
80
|
-
// } else {
|
|
81
|
-
// setQueueData(invoiceData);
|
|
82
|
-
// }
|
|
83
|
-
// }
|
|
84
|
-
// }, [fetchedInvoiceData, scrollActivated, setQueueData]);
|
|
85
|
-
|
|
86
|
-
// //for static data
|
|
87
|
-
// const { data: fetchedStaticData } = useApiHook<any>({
|
|
88
|
-
// endpoint: `/invoices/getStaticData/all/`,
|
|
89
|
-
// method: 'GET',
|
|
90
|
-
// });
|
|
91
|
-
|
|
92
|
-
// useEffect(() => {
|
|
93
|
-
// if (fetchedStaticData && fetchedStaticData?.data) {
|
|
94
|
-
// const staticData = fetchedStaticData?.data[0];
|
|
95
|
-
// setStaticData(staticData);
|
|
96
|
-
// }
|
|
97
|
-
// }, [fetchedStaticData, setStaticData]);
|
|
98
|
-
|
|
99
|
-
// return (
|
|
100
|
-
// <div style={{ textTransform: 'capitalize', overflow: 'auto' }}>
|
|
101
|
-
// <MyTable
|
|
102
|
-
// columns={columns}
|
|
103
|
-
// data={data}
|
|
104
|
-
// loading={false}
|
|
105
|
-
// // loadingskeleton={loadingskeleton}
|
|
106
|
-
// />
|
|
107
|
-
// </div>
|
|
108
|
-
// );
|
|
109
|
-
// };
|
|
110
|
-
|
|
111
|
-
// export default ReturnOrderTable;
|
|
112
|
-
import { Checkbox } from '@bjsdistribution/dms-component-library';
|
|
1
|
+
import { Checkbox, useApiHook } from '@bjsdistribution/dms-component-library';
|
|
113
2
|
import { Empty } from 'antd';
|
|
114
3
|
import { useAtom } from 'jotai';
|
|
115
|
-
import React, { useState } from 'react';
|
|
116
|
-
// import EmailIcon from '../../assets/EmailIcon';
|
|
117
|
-
// import ExcelIcon from '../../assets/ExcelIcon';
|
|
118
|
-
// import PdfIcon from '../../assets/PdfIcon';
|
|
119
|
-
// import { countReducerAtom } from '../invoice-actions/store';
|
|
120
|
-
// import { FormattedDate, getStringValue } from '../utils';
|
|
121
|
-
// import { IconContainers, TdWrapper } from './emailStyles';
|
|
122
|
-
// import { useEmailInvoice, useSelectedEmail } from './store';
|
|
123
|
-
// import Popup from './Popup';
|
|
4
|
+
import React, { useEffect, useState } from 'react';
|
|
124
5
|
import { Skeleton } from 'antd';
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
// import ShareIcon from '../../assets/ShareIcon';
|
|
128
|
-
import { data } from '../../table/table-data/Fakedata';
|
|
129
|
-
// import { StyledTable, StyledTableWrapper } from '../../table-view/TableStyle';
|
|
130
|
-
import { useEmailInvoice, useSelectedEmail } from '../../../store';
|
|
131
|
-
import { countReducerAtom } from '../../../order-view/store';
|
|
6
|
+
import { useSelectedOrders } from '../../../store';
|
|
7
|
+
import { useReturnData } from '../../../order-view/store';
|
|
132
8
|
import { EmptyDataContainer } from '../../table/table-data/styles';
|
|
133
|
-
import { FormattedDate, getStringValue } from '../../../utils';
|
|
134
9
|
import { StyledTable, StyledTableWrapper } from './returnstyles';
|
|
135
|
-
// import ExportIcon from '../../../../assets/icons/ExportIcon';
|
|
136
|
-
// import ArrivalIcon from '../../../../assets/icons/ArrivalIcon';
|
|
137
10
|
import PrinterIcon from '../../../../assets/icons/PrinterIcon';
|
|
138
11
|
import DownIcon from '../../../../assets/icons/DownIcon';
|
|
12
|
+
import { useLoading } from '../../store/store';
|
|
13
|
+
import { ApiResponse } from '../../../types';
|
|
14
|
+
import { filtersReducerAtom } from '../../header-filters/filterStore';
|
|
139
15
|
|
|
140
16
|
const ReturnOrderTable = ({ loadingskeleton }: any) => {
|
|
141
|
-
const [
|
|
142
|
-
|
|
143
|
-
const [
|
|
17
|
+
const [state] = useAtom(filtersReducerAtom);
|
|
18
|
+
|
|
19
|
+
const [selectedReturnOrder, setSelectedReturnOrder] = useSelectedOrders();
|
|
144
20
|
const [selectAll, setSelectAll] = useState(false);
|
|
21
|
+
const { 'x-filters': filters, 'x-pagination': pagination } = state;
|
|
22
|
+
const [returnData, setReturnData] = useReturnData();
|
|
23
|
+
const [, setLoading] = useLoading();
|
|
24
|
+
const { data: fetchedOrderData, loading: staticDataLoading } = useApiHook<
|
|
25
|
+
ApiResponse
|
|
26
|
+
>({
|
|
27
|
+
endpoint: '/return_order_products/',
|
|
28
|
+
method: 'GET',
|
|
29
|
+
filters: filters,
|
|
30
|
+
pagination: pagination,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
setLoading(staticDataLoading);
|
|
35
|
+
if (fetchedOrderData && fetchedOrderData?.data) {
|
|
36
|
+
setReturnData(fetchedOrderData?.data);
|
|
37
|
+
}
|
|
38
|
+
}, [fetchedOrderData, staticDataLoading]);
|
|
145
39
|
|
|
146
40
|
const handleSelectAll = (e: any) => {
|
|
147
41
|
setSelectAll(e.target.checked);
|
|
148
42
|
if (e.target.checked) {
|
|
149
|
-
|
|
150
|
-
|
|
43
|
+
setSelectedReturnOrder(
|
|
44
|
+
returnData.map((invoice: any) => ({
|
|
151
45
|
id: invoice.id,
|
|
152
46
|
status_id: 3,
|
|
153
47
|
}))
|
|
154
48
|
);
|
|
155
49
|
} else {
|
|
156
|
-
|
|
50
|
+
setSelectedReturnOrder([]);
|
|
157
51
|
}
|
|
158
52
|
};
|
|
159
53
|
|
|
160
54
|
const handleSelectInvoice = (id: any) => {
|
|
161
|
-
|
|
55
|
+
setSelectedReturnOrder((prevSelectedInvoices: any) => {
|
|
162
56
|
const isSelected = prevSelectedInvoices?.some(
|
|
163
57
|
(invoice: any) => invoice.id === id
|
|
164
58
|
);
|
|
@@ -170,7 +64,6 @@ const ReturnOrderTable = ({ loadingskeleton }: any) => {
|
|
|
170
64
|
}
|
|
171
65
|
});
|
|
172
66
|
};
|
|
173
|
-
|
|
174
67
|
return (
|
|
175
68
|
<>
|
|
176
69
|
<StyledTableWrapper id="tableScrolling">
|
|
@@ -203,30 +96,30 @@ const ReturnOrderTable = ({ loadingskeleton }: any) => {
|
|
|
203
96
|
</td>
|
|
204
97
|
<td colSpan={6}></td>
|
|
205
98
|
</tr>
|
|
206
|
-
) :
|
|
99
|
+
) : returnData?.length === 0 ? (
|
|
207
100
|
<tr>
|
|
208
|
-
<td colSpan={
|
|
101
|
+
<td colSpan={14}>
|
|
209
102
|
<EmptyDataContainer>
|
|
210
103
|
<Empty />
|
|
211
104
|
</EmptyDataContainer>
|
|
212
105
|
</td>
|
|
213
106
|
</tr>
|
|
214
107
|
) : (
|
|
215
|
-
|
|
216
|
-
<tr key={
|
|
108
|
+
returnData?.map((item: any) => (
|
|
109
|
+
<tr key={item.id}>
|
|
217
110
|
<td>
|
|
218
111
|
<Checkbox
|
|
219
|
-
checked={
|
|
112
|
+
checked={selectedReturnOrder?.some(
|
|
220
113
|
(selectedInvoice: any) =>
|
|
221
|
-
selectedInvoice?.id ===
|
|
114
|
+
selectedInvoice?.id === item.id
|
|
222
115
|
)}
|
|
223
|
-
onChange={() => handleSelectInvoice(
|
|
116
|
+
onChange={() => handleSelectInvoice(item.id)}
|
|
224
117
|
/>
|
|
225
118
|
</td>
|
|
226
119
|
|
|
227
|
-
<td>
|
|
120
|
+
<td>N/A</td>
|
|
228
121
|
|
|
229
|
-
<td>{
|
|
122
|
+
<td>{item?.return_location}</td>
|
|
230
123
|
|
|
231
124
|
<td>
|
|
232
125
|
<ul style={{ listStyleType: 'none', padding: 0 }}>
|
|
@@ -237,48 +130,21 @@ const ReturnOrderTable = ({ loadingskeleton }: any) => {
|
|
|
237
130
|
paddingLeft: 0,
|
|
238
131
|
}}
|
|
239
132
|
>
|
|
240
|
-
{
|
|
241
|
-
{getStringValue(invoice?.account_number)}
|
|
133
|
+
{item?.order_data?.order_recipient?.recipient_name}
|
|
242
134
|
</li>
|
|
243
135
|
<li style={{ color: '#888075' }}>
|
|
244
|
-
{
|
|
136
|
+
{item?.order_data?.order_recipient?.postcode}
|
|
245
137
|
</li>
|
|
246
138
|
</ul>
|
|
247
139
|
</td>
|
|
248
|
-
<td>{
|
|
249
|
-
<td>
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
</td>
|
|
253
|
-
<td>{
|
|
254
|
-
<td>
|
|
255
|
-
|
|
256
|
-
<td>{invoice?.customer_name}</td>
|
|
257
|
-
<td>{invoice?.customer_name}</td>
|
|
258
|
-
<td>{invoice?.customer_name}</td>
|
|
259
|
-
{/* <td>{invoice?.customer_name}</td> */}
|
|
260
|
-
<td>{invoice?.customer_name}</td>
|
|
261
|
-
|
|
262
|
-
{/* <td onClick={() => dispatch({ type: 'email-sent' })}>
|
|
263
|
-
<IconContainers>
|
|
264
|
-
<i>
|
|
265
|
-
<ExportIcon />
|
|
266
|
-
</i>
|
|
267
|
-
</IconContainers>
|
|
268
|
-
</td>
|
|
269
|
-
<td>
|
|
270
|
-
<IconContainers>
|
|
271
|
-
<i>
|
|
272
|
-
<PdfIcon />
|
|
273
|
-
</i>
|
|
274
|
-
<i>
|
|
275
|
-
<ArrivalIcon />
|
|
276
|
-
</i>
|
|
277
|
-
<i>
|
|
278
|
-
<PdfIcon />
|
|
279
|
-
</i>
|
|
280
|
-
</IconContainers>
|
|
281
|
-
</td> */}
|
|
140
|
+
<td>{item?.code}</td>
|
|
141
|
+
<td>{item?.description}</td>
|
|
142
|
+
<td>N/A</td>
|
|
143
|
+
<td>{item?.weight}</td>
|
|
144
|
+
<td>{item?.cube}</td>
|
|
145
|
+
<td>{item?.return_reasons?.reason}</td>
|
|
146
|
+
<td>N/A</td>
|
|
147
|
+
<td>{item?.collection_reasons?.reason}</td>
|
|
282
148
|
<td>
|
|
283
149
|
<div className="shareIconContainer">
|
|
284
150
|
<PrinterIcon />
|
package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts
CHANGED
|
@@ -306,6 +306,54 @@ export const StyledTable = styled.table`
|
|
|
306
306
|
paddingLeft: 0, */
|
|
307
307
|
cursor: pointer;
|
|
308
308
|
}
|
|
309
|
+
.statusCancelled {
|
|
310
|
+
color: #e95252;
|
|
311
|
+
/* background: rgba(233, 82, 82, 0.15); */
|
|
312
|
+
padding: 4px 8px;
|
|
313
|
+
border-radius: 4px;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.statusOnHold {
|
|
317
|
+
color: #f4a503;
|
|
318
|
+
/* background: #fff1d6; */
|
|
319
|
+
padding: 4px 8px;
|
|
320
|
+
border-radius: 4px;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.statusSubContracted {
|
|
324
|
+
color: #845adf;
|
|
325
|
+
/* background: rgba(132, 90, 223, 0.15); */
|
|
326
|
+
padding: 4px 8px;
|
|
327
|
+
border-radius: 4px;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.statusAwaiting {
|
|
331
|
+
color: #845adf;
|
|
332
|
+
/* background: rgba(132, 90, 223, 0.15); */
|
|
333
|
+
padding: 4px 8px;
|
|
334
|
+
border-radius: 4px;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.statusCompleted {
|
|
338
|
+
color: #1f9254;
|
|
339
|
+
/* background: rgba(41, 204, 106, 0.15); */
|
|
340
|
+
padding: 4px 8px;
|
|
341
|
+
border-radius: 4px;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.statusOutstanding {
|
|
345
|
+
color: #f4a503;
|
|
346
|
+
/* background: #fff1d6; */
|
|
347
|
+
padding: 4px 8px;
|
|
348
|
+
border-radius: 4px;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.statusUnknown {
|
|
352
|
+
color: #000;
|
|
353
|
+
/* background: #fff; */
|
|
354
|
+
padding: 4px 8px;
|
|
355
|
+
border-radius: 4px;
|
|
356
|
+
}
|
|
309
357
|
.statustext {
|
|
310
358
|
color: #1f9254;
|
|
311
359
|
font-family: 'Open Sans';
|
|
@@ -466,3 +514,17 @@ export const StyledTableWrapper = styled.div`
|
|
|
466
514
|
background: #7b61ff;
|
|
467
515
|
}
|
|
468
516
|
`;
|
|
517
|
+
|
|
518
|
+
export const CustomDrop = styled.div`
|
|
519
|
+
/* border-radius: 20px;
|
|
520
|
+
border: 1px solid #e2e0db;
|
|
521
|
+
background: #fff;
|
|
522
|
+
display: flex;
|
|
523
|
+
padding: 4px 8px;
|
|
524
|
+
gap: 8px;
|
|
525
|
+
align-items: center; */
|
|
526
|
+
cursor: pointer;
|
|
527
|
+
&.active .drop {
|
|
528
|
+
transform: rotate(180deg);
|
|
529
|
+
}
|
|
530
|
+
`;
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
// Base
|
|
2
1
|
import { atom, useAtom } from 'jotai';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
// import { routeInfoInitialValue } from './initialValues';
|
|
6
|
-
import {
|
|
7
|
-
// RouteInfoType,
|
|
8
|
-
PaginationData,
|
|
9
|
-
TableColumn,
|
|
10
|
-
TableRowType,
|
|
11
|
-
// OrderRecipientData,
|
|
12
|
-
} from '../shared/interface';
|
|
3
|
+
import { PaginationData, TableColumn, TableRowType } from '../shared/interface';
|
|
13
4
|
|
|
14
5
|
import { ModalType } from '../shared/types';
|
|
15
|
-
// import { routeInfoInitialValue } from './initialValues';
|
|
16
|
-
// Table column filter
|
|
17
6
|
export const visibleColumnsAtom = atom<string[]>([]);
|
|
18
7
|
const toggleColumnMenuAtom = atom<boolean>(false);
|
|
19
8
|
export const useToggleColumn = () => {
|
|
@@ -52,6 +41,26 @@ export const useLoading = () => {
|
|
|
52
41
|
return useAtom(loading);
|
|
53
42
|
};
|
|
54
43
|
|
|
44
|
+
const selectedAction = atom<number | null>(null);
|
|
45
|
+
export function useSelectedAction() {
|
|
46
|
+
return useAtom(selectedAction);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const selectedLocation = atom<string | null>(null);
|
|
50
|
+
export function useSelectedLocation() {
|
|
51
|
+
return useAtom(selectedLocation);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const selectedClient = atom<number | null>(null);
|
|
55
|
+
export function useSelectedClient() {
|
|
56
|
+
return useAtom(selectedClient);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const clientTableName = atom<string | null>(null);
|
|
60
|
+
export function useTableName() {
|
|
61
|
+
return useAtom(clientTableName);
|
|
62
|
+
}
|
|
63
|
+
|
|
55
64
|
// Paginations
|
|
56
65
|
|
|
57
66
|
const atomPaginationData = atom<PaginationData>({
|
|
@@ -77,6 +86,8 @@ const countStatus = atom<any>([]);
|
|
|
77
86
|
export const useCountData = () => {
|
|
78
87
|
return useAtom(countStatus);
|
|
79
88
|
};
|
|
89
|
+
|
|
90
|
+
//
|
|
80
91
|
// ROUTE DETAILS PAGE STATES ->
|
|
81
92
|
|
|
82
93
|
// const orderId = atom<number | undefined>(undefined);
|