@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,184 +1,116 @@
|
|
|
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 { AntSelect, Checkbox } from '@bjsdistribution/dms-component-library';
|
|
1
|
+
import {
|
|
2
|
+
AntSelect,
|
|
3
|
+
Checkbox,
|
|
4
|
+
displayValueOrNA,
|
|
5
|
+
} from '@bjsdistribution/dms-component-library';
|
|
113
6
|
import { Empty } from 'antd';
|
|
114
|
-
import {
|
|
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';
|
|
7
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
124
8
|
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';
|
|
9
|
+
import { useSelectedOrders } from '../../../store';
|
|
10
|
+
import { useOrderId, useReturnAfterOrderData } from '../../../order-view/store';
|
|
132
11
|
import { EmptyDataContainer } from '../../table/table-data/styles';
|
|
133
|
-
import { FormattedDate, getStringValue } from '../../../utils';
|
|
134
|
-
// import ExportIcon from '../../../../assets/icons/ExportIcon';
|
|
135
|
-
// import ArrivalIcon from '../../../../assets/icons/ArrivalIcon';
|
|
136
12
|
import PrinterIcon from '../../../../assets/icons/PrinterIcon';
|
|
137
13
|
import DownIcon from '../../../../assets/icons/DownIcon';
|
|
138
14
|
import {
|
|
139
15
|
StyledTable,
|
|
140
16
|
StyledTableWrapper,
|
|
17
|
+
CustomDrop,
|
|
141
18
|
} from '../../return-order-table/return-orders-filters/returnstyles';
|
|
142
19
|
import LoadIcon from '../../../../assets/icons/LoadIcon';
|
|
143
|
-
|
|
20
|
+
import { usePrintOptionTOggle } from '../../store/store';
|
|
21
|
+
import PrintDropDown from '../../../order-view/details-filters/left-side-filters/dropdowns/PrintDropDown';
|
|
22
|
+
import { NavLink } from 'react-router-dom';
|
|
23
|
+
import { formatDate } from '../../shared/utlis';
|
|
144
24
|
|
|
145
25
|
const OrderTable = ({ loadingskeleton }: any) => {
|
|
146
|
-
const [
|
|
147
|
-
const [,] = useAtom(countReducerAtom);
|
|
148
|
-
const [selectedInvoices, setSelectedInvoices] = useSelectedEmail();
|
|
26
|
+
const [selectedOrders, setSelectedReturnOrder] = useSelectedOrders();
|
|
149
27
|
const [selectAll, setSelectAll] = useState(false);
|
|
150
28
|
const defaultSelectStyle = { width: '100%' };
|
|
151
29
|
const defaultPopupClassName = 'dropDownStyle';
|
|
152
30
|
const defaultSelectWrapperClass = 'rounded';
|
|
31
|
+
const dropdownRefParent = useRef<HTMLDivElement>(null);
|
|
32
|
+
const dropdownRef = useRef<HTMLDivElement>(null);
|
|
33
|
+
const [printToogle, setPrintToggle] = usePrintOptionTOggle();
|
|
34
|
+
|
|
35
|
+
const [returnAfterOrder] = useReturnAfterOrderData();
|
|
36
|
+
|
|
37
|
+
const OpenDropDown = (index: number) => {
|
|
38
|
+
setPrintToggle(prevIndex => (prevIndex === index ? null : index));
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// Close dropdown outside click
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
44
|
+
return () => {
|
|
45
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
46
|
+
};
|
|
47
|
+
}, []);
|
|
48
|
+
const handleClickOutside = (event: MouseEvent) => {
|
|
49
|
+
if (
|
|
50
|
+
dropdownRef.current &&
|
|
51
|
+
!dropdownRef.current.contains(event.target as Node)
|
|
52
|
+
) {
|
|
53
|
+
setPrintToggle(null);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
153
56
|
|
|
154
57
|
const handleSelectAll = (e: any) => {
|
|
155
58
|
setSelectAll(e.target.checked);
|
|
156
59
|
if (e.target.checked) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
id:
|
|
60
|
+
setSelectedReturnOrder(
|
|
61
|
+
returnAfterOrder.map((e: any) => ({
|
|
62
|
+
id: e.id,
|
|
160
63
|
status_id: 3,
|
|
161
64
|
}))
|
|
162
65
|
);
|
|
163
66
|
} else {
|
|
164
|
-
|
|
67
|
+
setSelectedReturnOrder([]);
|
|
165
68
|
}
|
|
166
69
|
};
|
|
167
70
|
|
|
168
71
|
const handleSelectInvoice = (id: any) => {
|
|
169
|
-
|
|
72
|
+
setSelectedReturnOrder((prevSelectedInvoices: any) => {
|
|
170
73
|
const isSelected = prevSelectedInvoices?.some(
|
|
171
|
-
(
|
|
74
|
+
(item: any) => item.id === id
|
|
172
75
|
);
|
|
173
76
|
|
|
174
77
|
if (isSelected) {
|
|
175
|
-
return prevSelectedInvoices.filter((
|
|
78
|
+
return prevSelectedInvoices.filter((items: any) => items.id !== id);
|
|
176
79
|
} else {
|
|
177
80
|
return [...prevSelectedInvoices, { id, status_id: 3 }];
|
|
178
81
|
}
|
|
179
82
|
});
|
|
180
83
|
};
|
|
84
|
+
console.log('', returnAfterOrder);
|
|
85
|
+
|
|
86
|
+
const assigneOptions = [
|
|
87
|
+
{
|
|
88
|
+
label: 'BJS Distribution',
|
|
89
|
+
value: 'bjs-dist',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
label: 'Haulage',
|
|
93
|
+
value: 'haulage',
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
const getStatusClass = (status: any) => {
|
|
98
|
+
switch (status) {
|
|
99
|
+
case 'Cancelled':
|
|
100
|
+
return { color: '#E95252', background: 'rgba(233, 82, 82, 0.15)' };
|
|
101
|
+
case 'Pending':
|
|
102
|
+
return { color: '#F4A503', background: '#FFF1D6' };
|
|
103
|
+
case 'Awaiting':
|
|
104
|
+
return { color: '#845ADF', background: 'rgba(132, 90, 223, 0.15)' };
|
|
105
|
+
case 'Completed':
|
|
106
|
+
return { color: '#1F9254', background: 'rgba(41, 204, 106, 0.15)' };
|
|
107
|
+
default:
|
|
108
|
+
return { color: '#000', background: '#fff' };
|
|
109
|
+
}
|
|
110
|
+
};
|
|
181
111
|
|
|
112
|
+
const [id, setOrderId] = useOrderId();
|
|
113
|
+
console.log(id, 'idid');
|
|
182
114
|
return (
|
|
183
115
|
<>
|
|
184
116
|
<StyledTableWrapper id="tableScrolling">
|
|
@@ -189,7 +121,6 @@ const OrderTable = ({ loadingskeleton }: any) => {
|
|
|
189
121
|
<Checkbox checked={selectAll} onChange={handleSelectAll} />
|
|
190
122
|
</th>
|
|
191
123
|
<th className="emailInvoiceNo">Created</th>
|
|
192
|
-
{/* <th>Created</th> */}
|
|
193
124
|
<th>Return Location</th>
|
|
194
125
|
<th>Pick Up Location</th>
|
|
195
126
|
<th>Recipient</th>
|
|
@@ -207,118 +138,136 @@ const OrderTable = ({ loadingskeleton }: any) => {
|
|
|
207
138
|
<tbody>
|
|
208
139
|
{loadingskeleton ? (
|
|
209
140
|
<tr>
|
|
210
|
-
<td colSpan={
|
|
141
|
+
<td colSpan={16}>
|
|
211
142
|
<Skeleton active />
|
|
212
143
|
</td>
|
|
213
|
-
<td colSpan={
|
|
144
|
+
<td colSpan={16}></td>
|
|
214
145
|
</tr>
|
|
215
|
-
) :
|
|
146
|
+
) : returnAfterOrder?.length === 0 ? (
|
|
216
147
|
<tr>
|
|
217
|
-
<td colSpan={
|
|
148
|
+
<td colSpan={16}>
|
|
218
149
|
<EmptyDataContainer>
|
|
219
150
|
<Empty />
|
|
220
151
|
</EmptyDataContainer>
|
|
221
152
|
</td>
|
|
222
153
|
</tr>
|
|
223
154
|
) : (
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
155
|
+
returnAfterOrder?.map((item: any, index: any) => {
|
|
156
|
+
const statusMapping: any = {
|
|
157
|
+
CO: 'Cancelled',
|
|
158
|
+
OO: 'On Hold',
|
|
159
|
+
SC: 'Sub-Contracted',
|
|
160
|
+
AR: 'Awaiting Route',
|
|
161
|
+
SD: 'Completed',
|
|
162
|
+
AD: 'Outstanding',
|
|
163
|
+
};
|
|
164
|
+
const status = statusMapping[item?.status] || 'Unknown';
|
|
165
|
+
const statusClass = getStatusClass(status);
|
|
166
|
+
return (
|
|
167
|
+
<tr key={item.id}>
|
|
168
|
+
<td>
|
|
169
|
+
<Checkbox
|
|
170
|
+
checked={selectedOrders?.some(
|
|
171
|
+
(selectedInvoice: any) =>
|
|
172
|
+
selectedInvoice?.id === item.id
|
|
173
|
+
)}
|
|
174
|
+
onChange={() => handleSelectInvoice(item.id)}
|
|
175
|
+
/>
|
|
176
|
+
</td>
|
|
177
|
+
<td>{formatDate(new Date(item?.created_at))}</td>
|
|
178
|
+
<td>{displayValueOrNA(item?.return_locations)}</td>
|
|
179
|
+
<td>{displayValueOrNA(item?.pick_up_location)}</td>
|
|
235
180
|
|
|
236
|
-
|
|
181
|
+
<td onClick={() => setOrderId(item.id)}>
|
|
182
|
+
<ul style={{ listStyleType: 'none', padding: 0 }}>
|
|
183
|
+
<li
|
|
184
|
+
style={{
|
|
185
|
+
color: '#0099ff',
|
|
186
|
+
fontWeight: 600,
|
|
187
|
+
paddingLeft: 0,
|
|
188
|
+
}}
|
|
189
|
+
>
|
|
190
|
+
<NavLink to={`${item.id}`}>
|
|
191
|
+
{displayValueOrNA(
|
|
192
|
+
item?.order_recipient?.recipient_name
|
|
193
|
+
)}
|
|
194
|
+
</NavLink>
|
|
195
|
+
</li>
|
|
196
|
+
<li style={{ color: '#888075' }}>
|
|
197
|
+
{displayValueOrNA(item?.order_recipient?.postcode)}
|
|
198
|
+
</li>
|
|
199
|
+
</ul>
|
|
200
|
+
</td>
|
|
237
201
|
|
|
238
|
-
|
|
239
|
-
|
|
202
|
+
<td>
|
|
203
|
+
{displayValueOrNA(item?.customer_data?.customer_name)}
|
|
204
|
+
</td>
|
|
240
205
|
|
|
241
|
-
|
|
242
|
-
<
|
|
243
|
-
<li
|
|
244
|
-
style={{
|
|
245
|
-
color: '#0099ff',
|
|
246
|
-
fontWeight: 600,
|
|
247
|
-
paddingLeft: 0,
|
|
248
|
-
}}
|
|
249
|
-
>
|
|
250
|
-
{' '}
|
|
251
|
-
{getStringValue(invoice?.account_number)}
|
|
252
|
-
</li>
|
|
253
|
-
<li style={{ color: '#888075' }}>
|
|
254
|
-
{invoice?.customer_name}
|
|
255
|
-
</li>
|
|
256
|
-
</ul>
|
|
257
|
-
</td>
|
|
258
|
-
<td>{FormattedDate({ date: invoice?.date })}</td>
|
|
259
|
-
<td>
|
|
260
|
-
{/* <TdWrapper>{invoice?.account_number}</TdWrapper> */}
|
|
261
|
-
{invoice?.vat_rate_amount}
|
|
262
|
-
</td>
|
|
263
|
-
<td>{invoice?.customer_name}</td>
|
|
206
|
+
<td>{displayValueOrNA(item?.consignment)}</td>
|
|
207
|
+
<td>{displayValueOrNA(item?.order_number)}</td>
|
|
264
208
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
209
|
+
<td>{displayValueOrNA(item?.box_count)}</td>
|
|
210
|
+
<td>{displayValueOrNA(item?.weight)}KG</td>
|
|
211
|
+
<td>{displayValueOrNA(item?.cube)}</td>
|
|
212
|
+
<td>
|
|
213
|
+
<AntSelect
|
|
214
|
+
options={assigneOptions}
|
|
215
|
+
placeholder="Select"
|
|
216
|
+
onChange={() => {}}
|
|
217
|
+
// defaultValue={item?.assign || ''}
|
|
218
|
+
style={defaultSelectStyle}
|
|
219
|
+
disabled={false}
|
|
220
|
+
// onSearch={handleSearch}
|
|
221
|
+
showSearch
|
|
222
|
+
popupClassName={defaultPopupClassName}
|
|
223
|
+
selectWrapperClass={defaultSelectWrapperClass}
|
|
224
|
+
/>
|
|
225
|
+
</td>
|
|
226
|
+
<td>
|
|
227
|
+
<ul
|
|
228
|
+
className="statuscontainer"
|
|
229
|
+
style={{ listStyleType: 'none' }}
|
|
230
|
+
>
|
|
231
|
+
<li className={`statustext ${statusClass}`}>
|
|
232
|
+
{status}
|
|
233
|
+
</li>
|
|
234
|
+
</ul>
|
|
235
|
+
</td>
|
|
236
|
+
<td>
|
|
237
|
+
<ul className="actionbox">
|
|
238
|
+
<CustomDrop
|
|
239
|
+
ref={dropdownRefParent}
|
|
240
|
+
className={printToogle === index ? 'active' : ''}
|
|
241
|
+
>
|
|
242
|
+
<li
|
|
243
|
+
className="shareIconContainer"
|
|
244
|
+
onClick={() => OpenDropDown(index)}
|
|
245
|
+
>
|
|
246
|
+
<PrinterIcon />
|
|
247
|
+
<DownIcon />
|
|
301
248
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
<
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
249
|
+
{printToogle == index && (
|
|
250
|
+
<div ref={dropdownRef}>
|
|
251
|
+
<PrintDropDown />
|
|
252
|
+
</div>
|
|
253
|
+
)}
|
|
254
|
+
</li>
|
|
255
|
+
</CustomDrop>
|
|
256
|
+
<li className="downloadcontainer">
|
|
257
|
+
<LoadIcon />
|
|
258
|
+
</li>
|
|
259
|
+
</ul>
|
|
260
|
+
{/* <div className="shareIconContainer">
|
|
313
261
|
<PrinterIcon />
|
|
314
262
|
<DownIcon />
|
|
315
263
|
</div>
|
|
316
264
|
<div className="downloadcontainer">
|
|
317
265
|
<LoadIcon />
|
|
318
266
|
</div> */}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
267
|
+
</td>
|
|
268
|
+
</tr>
|
|
269
|
+
);
|
|
270
|
+
})
|
|
322
271
|
)}
|
|
323
272
|
</tbody>
|
|
324
273
|
</StyledTable>
|
package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {
|
|
3
|
-
// FilterConatiner,
|
|
4
|
-
// FilterIconConatiner,
|
|
5
3
|
LeftSideConatiner,
|
|
6
4
|
StyledFIlterELements,
|
|
7
5
|
StyledFiter,
|
|
@@ -13,8 +11,58 @@ 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';
|
|
20
|
+
import styled from 'styled-components';
|
|
16
21
|
|
|
17
22
|
const ReturnOrderFilter = () => {
|
|
23
|
+
const [orderDetails, setOrderDetails] = useOrderDetails();
|
|
24
|
+
const [prevOrderDetails] = usePrevOrderDetails();
|
|
25
|
+
|
|
26
|
+
const actionDate = orderDetails?.action_date
|
|
27
|
+
? new Date(orderDetails?.action_date)
|
|
28
|
+
: null;
|
|
29
|
+
|
|
30
|
+
const onChange: DatePickerProps['onChange'] = (
|
|
31
|
+
date: any,
|
|
32
|
+
_dateString: any
|
|
33
|
+
) => {
|
|
34
|
+
const selectedDate = date?.format('YYYY-MM-DDTHH:mm:ss');
|
|
35
|
+
if (
|
|
36
|
+
selectedDate !== undefined &&
|
|
37
|
+
prevOrderDetails.action_date !== undefined
|
|
38
|
+
) {
|
|
39
|
+
if (
|
|
40
|
+
new Date(selectedDate).toLocaleDateString() ===
|
|
41
|
+
new Date(prevOrderDetails.action_date!).toLocaleDateString()
|
|
42
|
+
) {
|
|
43
|
+
setOrderDetails(prev => {
|
|
44
|
+
return {
|
|
45
|
+
...prev,
|
|
46
|
+
action_date: prevOrderDetails.action_date,
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
} else {
|
|
50
|
+
setOrderDetails(prev => {
|
|
51
|
+
return {
|
|
52
|
+
...prev,
|
|
53
|
+
action_date: selectedDate,
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
setOrderDetails(prev => {
|
|
59
|
+
return {
|
|
60
|
+
...prev,
|
|
61
|
+
action_date: null,
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
};
|
|
18
66
|
return (
|
|
19
67
|
<>
|
|
20
68
|
<StyledFiter>
|
|
@@ -30,20 +78,25 @@ const ReturnOrderFilter = () => {
|
|
|
30
78
|
<div className="dateiconcontainer">
|
|
31
79
|
<DateIcon />
|
|
32
80
|
</div>
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
81
|
+
<StyledDatePicker>
|
|
82
|
+
<DatePicker
|
|
83
|
+
className="custom-datepicker"
|
|
84
|
+
onChange={onChange}
|
|
85
|
+
value={actionDate === null ? actionDate : dayjs(actionDate)}
|
|
86
|
+
format="DD/MM/YY"
|
|
87
|
+
placeholder="Date"
|
|
88
|
+
/>
|
|
89
|
+
</StyledDatePicker>
|
|
37
90
|
</div>
|
|
38
91
|
|
|
39
92
|
<div className="datefilter">
|
|
40
93
|
<div className="dateiconcontainer">
|
|
41
|
-
|
|
94
|
+
{' '}
|
|
95
|
+
<StatusIcon />{' '}
|
|
42
96
|
</div>
|
|
43
97
|
<div className="datetext">Status of Order</div>
|
|
44
|
-
|
|
45
98
|
<div className="roundbox">
|
|
46
|
-
<DownArrowIcon />
|
|
99
|
+
<DownArrowIcon />{' '}
|
|
47
100
|
</div>
|
|
48
101
|
</div>
|
|
49
102
|
<div className="datefilter">
|
|
@@ -60,7 +113,6 @@ const ReturnOrderFilter = () => {
|
|
|
60
113
|
<AssigneIcon />
|
|
61
114
|
</div>
|
|
62
115
|
<div className="datetext">Assignee</div>
|
|
63
|
-
|
|
64
116
|
<div className="roundbox">
|
|
65
117
|
<DownArrowIcon />
|
|
66
118
|
</div>
|
|
@@ -73,4 +125,11 @@ const ReturnOrderFilter = () => {
|
|
|
73
125
|
);
|
|
74
126
|
};
|
|
75
127
|
|
|
128
|
+
const StyledDatePicker = styled.div`
|
|
129
|
+
.custom-datepicker {
|
|
130
|
+
border: none;
|
|
131
|
+
width: 80px;
|
|
132
|
+
}
|
|
133
|
+
`;
|
|
134
|
+
|
|
76
135
|
export default ReturnOrderFilter;
|
|
@@ -5,6 +5,7 @@ import HeaderFilter from '../header-filters/HeaderFilter';
|
|
|
5
5
|
|
|
6
6
|
import ReturnFilter from './return-orders-filters/ReturnFilter';
|
|
7
7
|
import ReturnOrderTable from './return-orders-filters/ReturnOrderTable';
|
|
8
|
+
import ModalManager from '../../order-view/modalsPopup/ModalManager';
|
|
8
9
|
|
|
9
10
|
const ReturnTable = () => {
|
|
10
11
|
return (
|
|
@@ -13,14 +14,20 @@ const ReturnTable = () => {
|
|
|
13
14
|
<RouterHeader />
|
|
14
15
|
<div className="Tableconatiner">
|
|
15
16
|
<HeaderFilter />
|
|
16
|
-
<
|
|
17
|
-
|
|
17
|
+
<Container>
|
|
18
|
+
<ReturnFilter />
|
|
19
|
+
<ReturnOrderTable />
|
|
20
|
+
</Container>
|
|
18
21
|
</div>
|
|
19
22
|
</DashBoardWrapper>
|
|
23
|
+
<ModalManager />
|
|
20
24
|
</div>
|
|
21
25
|
);
|
|
22
26
|
};
|
|
23
|
-
|
|
27
|
+
const Container = styled.div`
|
|
28
|
+
position: relative;
|
|
29
|
+
top: -46px;
|
|
30
|
+
`;
|
|
24
31
|
const DashBoardWrapper = styled.section`
|
|
25
32
|
.Tableconatiner {
|
|
26
33
|
border-radius: 12px;
|