@bjsdistribution/dms-client-return 0.0.2 → 0.0.4
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/README.md +1 -1
- 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-daily-overview/table/table-data/styles.d.ts +2 -0
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.d.ts +3 -1
- package/dist/components/order-view/generic-table/AuditLogs.d.ts +4 -0
- package/dist/components/order-view/hooks/useGetEventNotes.d.ts +2 -0
- package/dist/components/order-view/hooks/useGetSystemLogs.d.ts +2 -0
- package/dist/components/order-view/modalsPopup/CreateReturnModal.d.ts +4 -0
- package/dist/components/order-view/notes/logs/fakeData.d.ts +7 -7
- package/dist/components/order-view/store.d.ts +23 -1
- package/dist/components/order-view/system-event-logs/columns/Code.d.ts +3 -0
- package/dist/components/order-view/system-event-logs/columns/Date.d.ts +3 -0
- package/dist/components/order-view/system-event-logs/columns/Event.d.ts +3 -0
- package/dist/components/order-view/system-event-logs/columns/Note.d.ts +3 -0
- package/dist/components/order-view/system-event-logs/columns/index.d.ts +4 -0
- package/dist/components/order-view/system-event-logs/helper.d.ts +7 -0
- package/dist/components/store.d.ts +5 -2
- package/dist/components/types.d.ts +1 -1
- package/dist/dms-client-return.cjs.development.js +3553 -2396
- 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 +3557 -2400
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/common/expand-collapse/index.tsx +3 -3
- package/src/components/fakeData.ts +14 -23
- 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 +6 -13
- package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +56 -67
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +170 -224
- package/src/components/order-daily-overview/header-filters/Styledfilters.tsx +20 -7
- package/src/components/order-daily-overview/header-filters/filterStore.ts +145 -0
- package/src/components/order-daily-overview/index.tsx +77 -20
- package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +32 -4
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +184 -235
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +69 -10
- package/src/components/order-daily-overview/return-order-table/ReturnTable.tsx +10 -3
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +9 -47
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +106 -190
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/RightFilters.tsx +35 -38
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +69 -1
- package/src/components/order-daily-overview/store/store.ts +23 -12
- package/src/components/order-daily-overview/table/ReturnTable.tsx +133 -207
- package/src/components/order-daily-overview/table/table-data/styles.ts +15 -0
- package/src/components/order-view/details-filters/DetailsFilters.tsx +5 -4
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.tsx +0 -2
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.tsx +54 -46
- package/src/components/order-view/general-information/Status.tsx +1 -1
- package/src/components/order-view/generic-table/AuditLogs.tsx +96 -0
- package/src/components/order-view/hooks/useGetEventNotes.tsx +47 -0
- package/src/components/order-view/hooks/useGetSystemLogs.tsx +60 -0
- package/src/components/order-view/index.tsx +25 -4
- package/src/components/order-view/modalsPopup/CreateReturnModal.tsx +83 -0
- package/src/components/order-view/modalsPopup/ModalManager.tsx +49 -49
- package/src/components/order-view/modalsPopup/UnReceiveProduct.tsx +1 -1
- package/src/components/order-view/notes/AddNote.tsx +127 -13
- package/src/components/order-view/notes/index.tsx +100 -3
- package/src/components/order-view/notes/logs/fakeData.ts +8 -48
- package/src/components/order-view/notes/logs/index.tsx +6 -45
- 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/order-resources/collapsed-content/index.tsx +1 -1
- package/src/components/order-view/products-info/expanded-content/index.tsx +2 -2
- package/src/components/order-view/products-info/index.tsx +3 -2
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +30 -34
- package/src/components/order-view/store.ts +80 -14
- package/src/components/order-view/system-event-logs/collapsed-content/index.tsx +1 -1
- package/src/components/order-view/system-event-logs/columns/Code.tsx +17 -0
- package/src/components/order-view/system-event-logs/columns/Date.tsx +18 -0
- package/src/components/order-view/system-event-logs/columns/Event.tsx +26 -0
- package/src/components/order-view/system-event-logs/columns/Note.tsx +24 -0
- package/src/components/order-view/system-event-logs/columns/index.tsx +6 -0
- package/src/components/order-view/system-event-logs/expanded-content/index.tsx +34 -6
- package/src/components/order-view/system-event-logs/helper.ts +29 -0
- package/src/components/store.ts +26 -4
- package/src/components/types.ts +2 -6
- package/src/index.tsx +32 -5
- 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/dist/components/order-view/system-event-logs/system-logs-table/SystemLogsTables.d.ts +0 -3
- package/dist/components/order-view/system-event-logs/system-logs-table/SytemLogsStyles.d.ts +0 -3
- 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-view/system-event-logs/system-logs-table/SystemLogsTables.tsx +0 -59
- package/src/components/order-view/system-event-logs/system-logs-table/SytemLogsStyles.tsx +0 -239
|
@@ -1,64 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
StyledFIlterELements,
|
|
4
|
+
StyledFiter,
|
|
5
|
+
StyledTableFilter,
|
|
6
|
+
Text,
|
|
7
|
+
} from '../../filters/FilterStyle';
|
|
3
8
|
import RightFilters from './RightFilters';
|
|
4
|
-
|
|
9
|
+
import { useParams } from 'react-router-dom';
|
|
5
10
|
|
|
6
11
|
const ReturnFilter = () => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
const { selectedClient } = useParams();
|
|
10
13
|
return (
|
|
11
14
|
<>
|
|
12
15
|
<StyledFiter>
|
|
16
|
+
<Text> {selectedClient}</Text>
|
|
13
17
|
<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
18
|
<StyledTableFilter />
|
|
32
19
|
</StyledFIlterELements>
|
|
33
20
|
<RightFilters />
|
|
34
21
|
</StyledFiter>
|
|
35
|
-
|
|
36
|
-
{/* {DataView ? (
|
|
37
|
-
<MyTable TableData={TableData} data={data} apiLoading={apiLoading}/>
|
|
38
|
-
) : (
|
|
39
|
-
<CardTable />
|
|
40
|
-
)} */}
|
|
41
22
|
</>
|
|
42
23
|
);
|
|
43
24
|
};
|
|
44
25
|
|
|
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
26
|
export default ReturnFilter;
|
|
@@ -1,164 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 {
|
|
2
|
+
Checkbox,
|
|
3
|
+
displayValueOrNA,
|
|
4
|
+
useApiHook,
|
|
5
|
+
} from '@bjsdistribution/dms-component-library';
|
|
113
6
|
import { Empty } from 'antd';
|
|
114
7
|
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';
|
|
8
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
124
9
|
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';
|
|
10
|
+
import { useSelectedOrders } from '../../../store';
|
|
11
|
+
import { useReturnData } from '../../../order-view/store';
|
|
132
12
|
import { EmptyDataContainer } from '../../table/table-data/styles';
|
|
133
|
-
import {
|
|
134
|
-
import { StyledTable, StyledTableWrapper } from './returnstyles';
|
|
135
|
-
// import ExportIcon from '../../../../assets/icons/ExportIcon';
|
|
136
|
-
// import ArrivalIcon from '../../../../assets/icons/ArrivalIcon';
|
|
13
|
+
import { CustomDrop, StyledTable, StyledTableWrapper } from './returnstyles';
|
|
137
14
|
import PrinterIcon from '../../../../assets/icons/PrinterIcon';
|
|
138
15
|
import DownIcon from '../../../../assets/icons/DownIcon';
|
|
16
|
+
import { useLoading, usePrintOptionTOggle } from '../../store/store';
|
|
17
|
+
import { ApiResponse } from '../../../types';
|
|
18
|
+
import { filtersReducerAtom } from '../../header-filters/filterStore';
|
|
19
|
+
import PrintDropDown from '../../../order-view/details-filters/left-side-filters/dropdowns/PrintDropDown';
|
|
139
20
|
|
|
140
21
|
const ReturnOrderTable = ({ loadingskeleton }: any) => {
|
|
141
|
-
const [
|
|
142
|
-
|
|
143
|
-
const [
|
|
22
|
+
const [state] = useAtom(filtersReducerAtom);
|
|
23
|
+
|
|
24
|
+
const [selectedReturnOrder, setSelectedReturnOrder] = useSelectedOrders();
|
|
144
25
|
const [selectAll, setSelectAll] = useState(false);
|
|
26
|
+
const { 'x-filters': filters, 'x-pagination': pagination } = state;
|
|
27
|
+
const [returnData, setReturnData] = useReturnData();
|
|
28
|
+
const [, setLoading] = useLoading();
|
|
29
|
+
const dropdownRefParent = useRef<HTMLDivElement>(null);
|
|
30
|
+
const dropdownRef = useRef<HTMLDivElement>(null);
|
|
31
|
+
const [printToogle, setPrintToggle] = usePrintOptionTOggle();
|
|
32
|
+
|
|
33
|
+
const OpenDropDown = (index: number) => {
|
|
34
|
+
setPrintToggle(prevIndex => (prevIndex === index ? null : index));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Close dropdown outside click
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
40
|
+
return () => {
|
|
41
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
44
|
+
const handleClickOutside = (event: MouseEvent) => {
|
|
45
|
+
if (
|
|
46
|
+
dropdownRef.current &&
|
|
47
|
+
!dropdownRef.current.contains(event.target as Node)
|
|
48
|
+
) {
|
|
49
|
+
setPrintToggle(null);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const { data: fetchedOrderData, loading: staticDataLoading } = useApiHook<
|
|
54
|
+
ApiResponse
|
|
55
|
+
>({
|
|
56
|
+
endpoint: '/return_order_products/',
|
|
57
|
+
method: 'GET',
|
|
58
|
+
filters: filters,
|
|
59
|
+
pagination: pagination,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
setLoading(staticDataLoading);
|
|
64
|
+
if (fetchedOrderData && fetchedOrderData?.data) {
|
|
65
|
+
setReturnData(fetchedOrderData?.data);
|
|
66
|
+
}
|
|
67
|
+
}, [fetchedOrderData, staticDataLoading]);
|
|
145
68
|
|
|
146
69
|
const handleSelectAll = (e: any) => {
|
|
147
70
|
setSelectAll(e.target.checked);
|
|
148
71
|
if (e.target.checked) {
|
|
149
|
-
|
|
150
|
-
|
|
72
|
+
setSelectedReturnOrder(
|
|
73
|
+
returnData.map((invoice: any) => ({
|
|
151
74
|
id: invoice.id,
|
|
152
75
|
status_id: 3,
|
|
153
76
|
}))
|
|
154
77
|
);
|
|
155
78
|
} else {
|
|
156
|
-
|
|
79
|
+
setSelectedReturnOrder([]);
|
|
157
80
|
}
|
|
158
81
|
};
|
|
159
82
|
|
|
160
83
|
const handleSelectInvoice = (id: any) => {
|
|
161
|
-
|
|
84
|
+
setSelectedReturnOrder((prevSelectedInvoices: any) => {
|
|
162
85
|
const isSelected = prevSelectedInvoices?.some(
|
|
163
86
|
(invoice: any) => invoice.id === id
|
|
164
87
|
);
|
|
@@ -170,7 +93,6 @@ const ReturnOrderTable = ({ loadingskeleton }: any) => {
|
|
|
170
93
|
}
|
|
171
94
|
});
|
|
172
95
|
};
|
|
173
|
-
|
|
174
96
|
return (
|
|
175
97
|
<>
|
|
176
98
|
<StyledTableWrapper id="tableScrolling">
|
|
@@ -203,30 +125,32 @@ const ReturnOrderTable = ({ loadingskeleton }: any) => {
|
|
|
203
125
|
</td>
|
|
204
126
|
<td colSpan={6}></td>
|
|
205
127
|
</tr>
|
|
206
|
-
) :
|
|
128
|
+
) : returnData?.length === 0 ? (
|
|
207
129
|
<tr>
|
|
208
|
-
<td colSpan={
|
|
130
|
+
<td colSpan={14}>
|
|
209
131
|
<EmptyDataContainer>
|
|
210
132
|
<Empty />
|
|
211
133
|
</EmptyDataContainer>
|
|
212
134
|
</td>
|
|
213
135
|
</tr>
|
|
214
136
|
) : (
|
|
215
|
-
|
|
216
|
-
<tr key={
|
|
137
|
+
returnData?.map((item: any, index: any) => (
|
|
138
|
+
<tr key={item.id}>
|
|
217
139
|
<td>
|
|
218
140
|
<Checkbox
|
|
219
|
-
checked={
|
|
141
|
+
checked={selectedReturnOrder?.some(
|
|
220
142
|
(selectedInvoice: any) =>
|
|
221
|
-
selectedInvoice?.id ===
|
|
143
|
+
selectedInvoice?.id === item.id
|
|
222
144
|
)}
|
|
223
|
-
onChange={() => handleSelectInvoice(
|
|
145
|
+
onChange={() => handleSelectInvoice(item.id)}
|
|
224
146
|
/>
|
|
225
147
|
</td>
|
|
226
148
|
|
|
227
|
-
<td>
|
|
149
|
+
<td>
|
|
150
|
+
{displayValueOrNA(item?.orders_products_stock?.location)}
|
|
151
|
+
</td>
|
|
228
152
|
|
|
229
|
-
<td>{
|
|
153
|
+
<td> {displayValueOrNA(item?.return_location)}</td>
|
|
230
154
|
|
|
231
155
|
<td>
|
|
232
156
|
<ul style={{ listStyleType: 'none', padding: 0 }}>
|
|
@@ -237,53 +161,45 @@ const ReturnOrderTable = ({ loadingskeleton }: any) => {
|
|
|
237
161
|
paddingLeft: 0,
|
|
238
162
|
}}
|
|
239
163
|
>
|
|
240
|
-
{
|
|
241
|
-
|
|
164
|
+
{displayValueOrNA(
|
|
165
|
+
item?.order_data?.order_recipient?.recipient_name
|
|
166
|
+
)}
|
|
242
167
|
</li>
|
|
243
168
|
<li style={{ color: '#888075' }}>
|
|
244
|
-
{
|
|
169
|
+
{displayValueOrNA(
|
|
170
|
+
item?.order_data?.order_recipient?.postcode
|
|
171
|
+
)}
|
|
245
172
|
</li>
|
|
246
173
|
</ul>
|
|
247
174
|
</td>
|
|
248
|
-
<td>{
|
|
175
|
+
<td>{displayValueOrNA(item?.code)}</td>
|
|
176
|
+
<td>{displayValueOrNA(item?.description)}</td>
|
|
177
|
+
<td>N/A</td>
|
|
178
|
+
<td>{displayValueOrNA(item?.weight)}KG</td>
|
|
179
|
+
<td>{displayValueOrNA(item?.cube)}</td>
|
|
180
|
+
<td>{displayValueOrNA(item?.return_reasons?.reason)}</td>
|
|
181
|
+
<td>N/A</td>
|
|
182
|
+
<td>{displayValueOrNA(item?.collection_reasons?.reason)}</td>
|
|
249
183
|
<td>
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
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> */}
|
|
282
|
-
<td>
|
|
283
|
-
<div className="shareIconContainer">
|
|
284
|
-
<PrinterIcon />
|
|
285
|
-
<DownIcon />
|
|
286
|
-
</div>
|
|
184
|
+
<ul className="actionbox">
|
|
185
|
+
<CustomDrop
|
|
186
|
+
ref={dropdownRefParent}
|
|
187
|
+
className={printToogle === index ? 'active' : ''}
|
|
188
|
+
>
|
|
189
|
+
<li
|
|
190
|
+
className="shareIconContainer"
|
|
191
|
+
onClick={() => OpenDropDown(index)}
|
|
192
|
+
>
|
|
193
|
+
<PrinterIcon />
|
|
194
|
+
<DownIcon />
|
|
195
|
+
{printToogle == index && (
|
|
196
|
+
<div ref={dropdownRef}>
|
|
197
|
+
<PrintDropDown />
|
|
198
|
+
</div>
|
|
199
|
+
)}
|
|
200
|
+
</li>
|
|
201
|
+
</CustomDrop>
|
|
202
|
+
</ul>
|
|
287
203
|
</td>
|
|
288
204
|
</tr>
|
|
289
205
|
))
|
|
@@ -4,49 +4,39 @@ import { StyledBulkItem } from '../../filters/BulkFilterStyle';
|
|
|
4
4
|
import SearchType from '../../header/route-header/search/SearchType';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
6
|
import DownloadIcon from '../../../../assets/icons/DownloadIcon';
|
|
7
|
+
import { countReducerAtom, useAtom } from '../../../order-view/store';
|
|
8
|
+
import { useSelectedOrders } from '../../../store';
|
|
7
9
|
|
|
8
10
|
const RightFilters = () => {
|
|
11
|
+
const [, dispatch] = useAtom(countReducerAtom);
|
|
12
|
+
const [selectedReturnOrder] = useSelectedOrders();
|
|
13
|
+
|
|
9
14
|
return (
|
|
10
15
|
<Container>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
16
|
+
<ButtonText
|
|
17
|
+
onClick={() => dispatch({ type: 'create-return' })}
|
|
18
|
+
disabled={selectedReturnOrder?.length === 0}
|
|
19
|
+
>
|
|
20
|
+
Create Return
|
|
21
|
+
</ButtonText>
|
|
15
22
|
<StyledBulkItem>
|
|
16
23
|
<SearchType />
|
|
17
24
|
</StyledBulkItem>
|
|
18
25
|
<IconConatiner>
|
|
19
26
|
<Mid>
|
|
20
27
|
<IconText>Export</IconText>
|
|
21
|
-
<DownloadIcon/>
|
|
28
|
+
<DownloadIcon />
|
|
22
29
|
</Mid>
|
|
23
30
|
</IconConatiner>
|
|
24
|
-
|
|
25
31
|
</Container>
|
|
26
32
|
);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// return (
|
|
30
|
-
// // <StyledBulkFilterCover>
|
|
31
|
-
|
|
32
|
-
// <StyledBulkItem>
|
|
33
|
-
// <SearchType />
|
|
34
|
-
// </StyledBulkItem>
|
|
35
|
-
// /* {showTableFilter && (
|
|
36
|
-
// <StyledBulkItem>
|
|
37
|
-
// <TableFilter tableData={TableData[0].tableHead} />
|
|
38
|
-
// </StyledBulkItem>
|
|
39
|
-
// )} */
|
|
40
|
-
// // </StyledBulkFilterCover>
|
|
41
|
-
// );
|
|
42
33
|
};
|
|
43
34
|
const Container = styled.div`
|
|
44
35
|
display: flex;
|
|
45
|
-
/* align-items: flex-start; */
|
|
46
|
-
gap: 16px;
|
|
47
|
-
align-items: center;
|
|
48
|
-
|
|
49
|
-
`
|
|
36
|
+
/* align-items: flex-start; */
|
|
37
|
+
gap: 16px;
|
|
38
|
+
align-items: center;
|
|
39
|
+
`;
|
|
50
40
|
const Mid = styled.div`
|
|
51
41
|
display: flex;
|
|
52
42
|
padding: 4px 10px;
|
|
@@ -55,24 +45,31 @@ const Mid = styled.div`
|
|
|
55
45
|
align-self: stretch;
|
|
56
46
|
border-radius: 15px 0px 0px 15px;
|
|
57
47
|
`;
|
|
58
|
-
|
|
48
|
+
|
|
49
|
+
const ButtonText = styled.button`
|
|
50
|
+
color: white;
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
font-style: normal;
|
|
53
|
+
font-weight: 600;
|
|
54
|
+
|
|
59
55
|
display: flex;
|
|
60
56
|
padding: 7px 12px;
|
|
61
57
|
justify-content: center;
|
|
62
58
|
align-items: center;
|
|
63
59
|
gap: 2px;
|
|
64
60
|
border-radius: 15px;
|
|
65
|
-
background:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
font-family: "'Lato";
|
|
70
|
-
font-size: 14px;
|
|
71
|
-
font-style: normal;
|
|
72
|
-
font-weight: 600;
|
|
73
|
-
line-height: 20px;
|
|
74
|
-
`;
|
|
61
|
+
background: #3a3630;
|
|
62
|
+
font-family: 'Lato';
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
border: none;
|
|
75
65
|
|
|
66
|
+
&:disabled {
|
|
67
|
+
border-radius: 15px;
|
|
68
|
+
background: rgba(136, 128, 117, 0.35);
|
|
69
|
+
color: #888075;
|
|
70
|
+
cursor: not-allowed;
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
76
73
|
|
|
77
74
|
const IconConatiner = styled.div`
|
|
78
75
|
/* display: flex;
|
|
@@ -82,7 +79,7 @@ const IconConatiner = styled.div`
|
|
|
82
79
|
border-radius: 8px 8px 8px 8px; */
|
|
83
80
|
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
84
81
|
background: #f0f2f2;
|
|
85
|
-
border: 1px solid
|
|
82
|
+
border: 1px solid #e2e0db;
|
|
86
83
|
display: flex;
|
|
87
84
|
padding: 7px 12px;
|
|
88
85
|
justify-content: center;
|
package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts
CHANGED
|
@@ -232,7 +232,7 @@ export const EmptyDataContainer = styled.div`
|
|
|
232
232
|
export const StyledTable = styled.table`
|
|
233
233
|
border-spacing: 0 10px;
|
|
234
234
|
width: 100%;
|
|
235
|
-
min-width: 1600px;
|
|
235
|
+
/* min-width: 1600px; */
|
|
236
236
|
thead {
|
|
237
237
|
white-space: nowrap;
|
|
238
238
|
tr {
|
|
@@ -305,6 +305,55 @@ export const StyledTable = styled.table`
|
|
|
305
305
|
/* fontWeight: 600,
|
|
306
306
|
paddingLeft: 0, */
|
|
307
307
|
cursor: pointer;
|
|
308
|
+
position: relative;
|
|
309
|
+
}
|
|
310
|
+
.statusCancelled {
|
|
311
|
+
color: #e95252;
|
|
312
|
+
/* background: rgba(233, 82, 82, 0.15); */
|
|
313
|
+
padding: 4px 8px;
|
|
314
|
+
border-radius: 4px;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.statusOnHold {
|
|
318
|
+
color: #f4a503;
|
|
319
|
+
/* background: #fff1d6; */
|
|
320
|
+
padding: 4px 8px;
|
|
321
|
+
border-radius: 4px;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.statusSubContracted {
|
|
325
|
+
color: #845adf;
|
|
326
|
+
/* background: rgba(132, 90, 223, 0.15); */
|
|
327
|
+
padding: 4px 8px;
|
|
328
|
+
border-radius: 4px;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.statusAwaiting {
|
|
332
|
+
color: #845adf;
|
|
333
|
+
/* background: rgba(132, 90, 223, 0.15); */
|
|
334
|
+
padding: 4px 8px;
|
|
335
|
+
border-radius: 4px;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.statusCompleted {
|
|
339
|
+
color: #1f9254;
|
|
340
|
+
/* background: rgba(41, 204, 106, 0.15); */
|
|
341
|
+
padding: 4px 8px;
|
|
342
|
+
border-radius: 4px;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.statusOutstanding {
|
|
346
|
+
color: #f4a503;
|
|
347
|
+
/* background: #fff1d6; */
|
|
348
|
+
padding: 4px 8px;
|
|
349
|
+
border-radius: 4px;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.statusUnknown {
|
|
353
|
+
color: #000;
|
|
354
|
+
/* background: #fff; */
|
|
355
|
+
padding: 4px 8px;
|
|
356
|
+
border-radius: 4px;
|
|
308
357
|
}
|
|
309
358
|
.statustext {
|
|
310
359
|
color: #1f9254;
|
|
@@ -337,6 +386,10 @@ export const StyledTable = styled.table`
|
|
|
337
386
|
border-radius: 22px;
|
|
338
387
|
background: rgba(41, 204, 106, 0.15);
|
|
339
388
|
}
|
|
389
|
+
ul > li > a {
|
|
390
|
+
text-decoration: none !important;
|
|
391
|
+
color: #0099ff;
|
|
392
|
+
}
|
|
340
393
|
}
|
|
341
394
|
&:nth-child(even) td {
|
|
342
395
|
background: #f6fbff;
|
|
@@ -445,6 +498,7 @@ export const StyledTableWrapper = styled.div`
|
|
|
445
498
|
overflow-x: auto;
|
|
446
499
|
max-height: calc(100vh - 396px);
|
|
447
500
|
scrollbar-width: none;
|
|
501
|
+
height: 400px;
|
|
448
502
|
/* box-shadow: 0px 0px 30px 6px rgba(46, 45, 116, 0.05); */
|
|
449
503
|
&::-webkit-scrollbar {
|
|
450
504
|
width: 5px;
|
|
@@ -466,3 +520,17 @@ export const StyledTableWrapper = styled.div`
|
|
|
466
520
|
background: #7b61ff;
|
|
467
521
|
}
|
|
468
522
|
`;
|
|
523
|
+
|
|
524
|
+
export const CustomDrop = styled.div`
|
|
525
|
+
/* border-radius: 20px;
|
|
526
|
+
border: 1px solid #e2e0db;
|
|
527
|
+
background: #fff;
|
|
528
|
+
display: flex;
|
|
529
|
+
padding: 4px 8px;
|
|
530
|
+
gap: 8px;
|
|
531
|
+
align-items: center; */
|
|
532
|
+
cursor: pointer;
|
|
533
|
+
&.active .drop {
|
|
534
|
+
transform: rotate(180deg);
|
|
535
|
+
}
|
|
536
|
+
`;
|