@bjsdistribution/dms-client-return 0.1.9-prod → 0.1.10-prod
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/client-portal/OutstandingTable.d.ts +3 -0
- package/dist/components/client-portal/ReturnAfterSearchBar.d.ts +4 -0
- package/dist/components/client-portal/ReturnOverview.d.ts +3 -0
- package/dist/components/client-portal/ReturnRTFilters.d.ts +5 -0
- package/dist/components/client-portal/ReturnSearchBar.d.ts +4 -0
- package/dist/components/client-portal/ReturnStatus.d.ts +8 -0
- package/dist/components/client-portal/return-confirm/ConfirmedMain.d.ts +3 -0
- package/dist/components/client-portal/return-confirm/ReturnConfirmedTable.d.ts +3 -0
- package/dist/components/order-daily-overview/common/fakedata.d.ts +1 -0
- package/dist/components/order-daily-overview/header/route-header/RouterHeader.d.ts +1 -0
- package/dist/components/order-view/notes/AddNote.d.ts +1 -0
- package/dist/components/order-view/notes/order-dropdown/NewReturnDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.d.ts +4 -1
- package/dist/components/order-view/order-actions/actions/confirm-order/index.d.ts +4 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/BaseChargeConfirmationModal.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.d.ts +11 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/Selector.d.ts +11 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/adhoc/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.d.ts +8 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/delivery-add-ons/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/disposal-charges/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/order-charges/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationCategory.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationLevel.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/FlagsTemplate.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/OrderTemplate.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/Tabs.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/OrderHoldReasonDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/StatusDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/ZoneDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/failure-content/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/index.d.ts +4 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/success-content/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/styles.d.ts +8 -0
- package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.d.ts +1 -0
- package/dist/components/order-view/order-actions/actions/remove-from-route/RemoveFromRoute.d.ts +1 -1
- package/dist/components/order-view/order-actions/actions/unhold-order/UnholdOrder.d.ts +1 -0
- package/dist/components/order-view/products-info/expanded-content/index.d.ts +4 -1
- package/dist/components/order-view/return-client-products/ProductTable.d.ts +4 -1
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.d.ts +4 -1
- package/dist/components/order-view/store.d.ts +14 -2
- package/dist/components/order-view/types.d.ts +49 -1
- package/dist/components/order-view/utils.d.ts +3 -0
- package/dist/components/store.d.ts +12 -1
- package/dist/components/utils.d.ts +1 -0
- package/dist/dms-client-return.cjs.development.js +7053 -2711
- 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 +7111 -2769
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +6 -4
- package/src/assets/icons/ActionIcon.tsx +1 -1
- package/src/assets/icons/ArrowDownIcon.tsx +2 -2
- package/src/components/client-portal/OutstandingTable.tsx +412 -0
- package/src/components/client-portal/ReturnAfterSearchBar.tsx +242 -0
- package/src/components/client-portal/ReturnOverview.tsx +185 -0
- package/src/components/client-portal/ReturnRTFilters.tsx +228 -0
- package/src/components/client-portal/ReturnSearchBar.tsx +294 -0
- package/src/components/client-portal/ReturnStatus.tsx +252 -0
- package/src/components/client-portal/return-confirm/ConfirmedMain.tsx +235 -0
- package/src/components/client-portal/return-confirm/ReturnConfirmedTable.tsx +404 -0
- package/src/components/order-daily-overview/common/fakedata.tsx +18 -0
- package/src/components/order-daily-overview/header/route-header/RouterHeader.tsx +130 -1
- package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +15 -3
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +100 -70
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +4 -0
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +86 -0
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +12 -2
- package/src/components/order-daily-overview/return-after-table/table-filters/TableFilters.tsx +22 -1
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +34 -6
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +24 -11
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/RightFilters.tsx +26 -6
- package/src/components/order-daily-overview/shared/elements/PrintDropDown.tsx +5 -3
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/OptionsDropDown.tsx +5 -0
- package/src/components/order-view/details-filters/right-side-filters/Details.tsx +28 -3
- package/src/components/order-view/generic-table/AuditLogs.tsx +39 -12
- package/src/components/order-view/index.tsx +45 -0
- package/src/components/order-view/notes/AddNote.tsx +94 -65
- package/src/components/order-view/notes/order-dropdown/NewReturnDropdown.tsx +8 -10
- package/src/components/order-view/notification/OrderTemplate.tsx +192 -41
- package/src/components/order-view/order-actions/actions/cancel-order/ReturnAction.tsx +25 -4
- package/src/components/order-view/order-actions/actions/cancel-order/ReturnReason.tsx +24 -4
- package/src/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.tsx +9 -2
- package/src/components/order-view/order-actions/actions/confirm-order/index.tsx +12 -6
- package/src/components/order-view/order-actions/actions/create-task-reminder/CreateReminderModal.tsx +2 -2
- package/src/components/order-view/order-actions/actions/force-debrief/BaseChargeConfirmationModal.tsx +94 -0
- package/src/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.tsx +620 -0
- package/src/components/order-view/order-actions/actions/force-debrief/Selector.tsx +65 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/adhoc/index.tsx +94 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.tsx +106 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.tsx +77 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/delivery-add-ons/index.tsx +78 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/disposal-charges/index.tsx +77 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/order-charges/index.tsx +124 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationCategory.tsx +92 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationLevel.tsx +90 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.tsx +122 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/index.tsx +16 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/FlagsTemplate.tsx +46 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/OrderTemplate.tsx +117 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/Tabs.tsx +32 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/index.tsx +180 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.tsx +201 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.tsx +40 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.tsx +108 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/OrderHoldReasonDropdown.tsx +37 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/StatusDropdown.tsx +48 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/ZoneDropdown.tsx +27 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/failure-content/index.tsx +187 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/index.tsx +55 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/success-content/index.tsx +221 -0
- package/src/components/order-view/order-actions/actions/force-debrief/styles.tsx +51 -0
- package/src/components/order-view/order-actions/actions/hold-order/HoldOrderModal.tsx +2 -0
- package/src/components/order-view/order-actions/actions/remove-from-route/RemoveFromRoute.tsx +7 -2
- package/src/components/order-view/order-actions/actions/unhold-order/UnholdOrder.tsx +2 -0
- package/src/components/order-view/order-actions/index.tsx +15 -3
- package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +1 -1
- package/src/components/order-view/products-info/expanded-content/index.tsx +27 -11
- package/src/components/order-view/products-info/index.tsx +4 -4
- package/src/components/order-view/return-client-products/ProductTable.tsx +6 -2
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +54 -15
- package/src/components/order-view/store.ts +106 -0
- package/src/components/order-view/types.ts +54 -1
- package/src/components/order-view/utils.ts +37 -0
- package/src/components/store.ts +62 -1
- package/src/components/utils.ts +13 -3
- package/src/index.tsx +26 -16
|
@@ -2,6 +2,7 @@ import { atom, useAtom } from 'jotai';
|
|
|
2
2
|
import { atomWithReducer } from 'jotai/utils';
|
|
3
3
|
import {
|
|
4
4
|
CancelOrderProductsType,
|
|
5
|
+
ChargesType,
|
|
5
6
|
CreateProduct,
|
|
6
7
|
OrderActionsType,
|
|
7
8
|
OrdersType,
|
|
@@ -109,6 +110,9 @@ export const ordersInitialValue: OrdersType = {
|
|
|
109
110
|
id: null,
|
|
110
111
|
name: '',
|
|
111
112
|
carrier_id: null,
|
|
113
|
+
order_type: {
|
|
114
|
+
type: null,
|
|
115
|
+
},
|
|
112
116
|
};
|
|
113
117
|
|
|
114
118
|
export const orderProductInitialvalue: CreateProduct = {
|
|
@@ -140,6 +144,42 @@ export const updateOrderProducts: UpdateOrderProduct = {
|
|
|
140
144
|
return_reason_id: 0,
|
|
141
145
|
};
|
|
142
146
|
|
|
147
|
+
//force debrief
|
|
148
|
+
const chargesIntialValue: ChargesType = {
|
|
149
|
+
base_charge_type: 1,
|
|
150
|
+
base_charge: 0,
|
|
151
|
+
weight: 0,
|
|
152
|
+
drop_time: 0,
|
|
153
|
+
timed_service: 0,
|
|
154
|
+
wait_time: 0,
|
|
155
|
+
extra_floor: 0,
|
|
156
|
+
bulky_items: 0,
|
|
157
|
+
re_label: 0,
|
|
158
|
+
extra_cube: 0,
|
|
159
|
+
additional_box: 0,
|
|
160
|
+
additional_item: 0,
|
|
161
|
+
weekend: 0,
|
|
162
|
+
re_allocation: 0,
|
|
163
|
+
pre_dated: 0,
|
|
164
|
+
re_package: 0,
|
|
165
|
+
disassemble: 0,
|
|
166
|
+
qc: 0,
|
|
167
|
+
collection_qc: 0,
|
|
168
|
+
return_to_client: 0,
|
|
169
|
+
roc: 0,
|
|
170
|
+
unpack: 0,
|
|
171
|
+
packaging_disposal: 0,
|
|
172
|
+
assembly: 0,
|
|
173
|
+
debrief_notes: '',
|
|
174
|
+
recycle: 0,
|
|
175
|
+
admin: 0,
|
|
176
|
+
disposal: 0,
|
|
177
|
+
disposal_recycling: 0,
|
|
178
|
+
debrief_status: '',
|
|
179
|
+
new_order_status: '',
|
|
180
|
+
adhoc_charges: [],
|
|
181
|
+
};
|
|
182
|
+
|
|
143
183
|
export const usedate = () => {
|
|
144
184
|
return useAtom(date);
|
|
145
185
|
};
|
|
@@ -243,6 +283,11 @@ export function useOrderAlertsData() {
|
|
|
243
283
|
return useAtom(orderAlertsData);
|
|
244
284
|
}
|
|
245
285
|
|
|
286
|
+
const customerList = atom<any>([]);
|
|
287
|
+
export function useOrderCustomersList() {
|
|
288
|
+
return useAtom(customerList);
|
|
289
|
+
}
|
|
290
|
+
|
|
246
291
|
export {
|
|
247
292
|
useTabType,
|
|
248
293
|
useInfoType,
|
|
@@ -558,6 +603,67 @@ export function useGlobalStateHitOrder() {
|
|
|
558
603
|
return useAtom(globalOrderGetApi);
|
|
559
604
|
}
|
|
560
605
|
|
|
606
|
+
//force debrief states
|
|
607
|
+
const globalEscData = atom<any>([]);
|
|
608
|
+
export function useGlobalEscData() {
|
|
609
|
+
return useAtom(globalEscData);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
const activeTab = atom<any>('success');
|
|
613
|
+
|
|
614
|
+
export function useActiveTab() {
|
|
615
|
+
return useAtom(activeTab);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
const chargesStateAtom = atom<ChargesType>(chargesIntialValue);
|
|
619
|
+
|
|
620
|
+
export function useChargesState() {
|
|
621
|
+
return useAtom(chargesStateAtom);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
const failureReasonAtom = atom<any>('');
|
|
625
|
+
export function useFailureReason() {
|
|
626
|
+
return useAtom(failureReasonAtom);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
const escalationCategoryAtom = atom<any>('');
|
|
630
|
+
|
|
631
|
+
export function useEscalationCategory() {
|
|
632
|
+
return useAtom(escalationCategoryAtom);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
const escalationLevelAtom = atom<any>('');
|
|
636
|
+
|
|
637
|
+
export function useEscalationLevel() {
|
|
638
|
+
return useAtom(escalationLevelAtom);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
const escalationReasonAtom = atom<any>('');
|
|
642
|
+
|
|
643
|
+
export function useEscalationReason() {
|
|
644
|
+
return useAtom(escalationReasonAtom);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
const newStatusAtom = atom<any>('');
|
|
648
|
+
export function useNewStatus() {
|
|
649
|
+
return useAtom(newStatusAtom);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
const orderCancelReasonAtom = atom<any>('');
|
|
653
|
+
export function useOrderCancelReason() {
|
|
654
|
+
return useAtom(orderCancelReasonAtom);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
const orderHoldReasonAtom = atom<any>('');
|
|
658
|
+
export function useOrderHoldReason() {
|
|
659
|
+
return useAtom(orderHoldReasonAtom);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
const isFailureReasonChangedAtom = atom<boolean>(false);
|
|
663
|
+
export function useIsFailureReasonChanged() {
|
|
664
|
+
return useAtom(isFailureReasonChangedAtom);
|
|
665
|
+
}
|
|
666
|
+
|
|
561
667
|
// Popup state Manage
|
|
562
668
|
const initialState = null;
|
|
563
669
|
|
|
@@ -50,7 +50,8 @@ export type OrderActionsType =
|
|
|
50
50
|
| 'unrelease-order'
|
|
51
51
|
| 'clear-date'
|
|
52
52
|
| 'uncancel-order'
|
|
53
|
-
| 'remove-from-route'
|
|
53
|
+
| 'remove-from-route'
|
|
54
|
+
| 'force-debrief';
|
|
54
55
|
|
|
55
56
|
export interface ChargeLogData {
|
|
56
57
|
id: number;
|
|
@@ -127,6 +128,10 @@ export interface OrderRouteType {
|
|
|
127
128
|
feedback_received?: boolean;
|
|
128
129
|
is_active?: boolean;
|
|
129
130
|
}
|
|
131
|
+
|
|
132
|
+
export interface orderType {
|
|
133
|
+
type: string | null;
|
|
134
|
+
}
|
|
130
135
|
export interface OrdersType {
|
|
131
136
|
depot_id: number | null;
|
|
132
137
|
gsit_order_id: number | null;
|
|
@@ -168,6 +173,7 @@ export interface OrdersType {
|
|
|
168
173
|
recipient_name: any;
|
|
169
174
|
postcode: any;
|
|
170
175
|
carrier_id: number | null;
|
|
176
|
+
order_type: orderType;
|
|
171
177
|
}
|
|
172
178
|
|
|
173
179
|
export type DeleteProds = {
|
|
@@ -269,3 +275,50 @@ export interface CancelOrderProductsType {
|
|
|
269
275
|
product_type?: string;
|
|
270
276
|
previous_product_type?: string;
|
|
271
277
|
}
|
|
278
|
+
|
|
279
|
+
//force debrief
|
|
280
|
+
export interface AdhocCharge {
|
|
281
|
+
adhoc_charges_description: string;
|
|
282
|
+
adhoc_charges: number;
|
|
283
|
+
id: string; // required for state updations only
|
|
284
|
+
}
|
|
285
|
+
export interface ChargesType {
|
|
286
|
+
base_charge_type: number;
|
|
287
|
+
base_charge: number;
|
|
288
|
+
weight: number;
|
|
289
|
+
drop_time: number;
|
|
290
|
+
timed_service: number;
|
|
291
|
+
wait_time: number;
|
|
292
|
+
extra_floor: number;
|
|
293
|
+
bulky_items: number;
|
|
294
|
+
re_label: number;
|
|
295
|
+
extra_cube: number;
|
|
296
|
+
additional_box: number;
|
|
297
|
+
additional_item: number;
|
|
298
|
+
weekend: number;
|
|
299
|
+
re_allocation: number;
|
|
300
|
+
pre_dated: number;
|
|
301
|
+
re_package: number;
|
|
302
|
+
disassemble: number;
|
|
303
|
+
qc: number;
|
|
304
|
+
collection_qc: number;
|
|
305
|
+
return_to_client: number;
|
|
306
|
+
roc: number;
|
|
307
|
+
unpack: number;
|
|
308
|
+
packaging_disposal: number;
|
|
309
|
+
assembly: number;
|
|
310
|
+
debrief_notes: string;
|
|
311
|
+
recycle: number;
|
|
312
|
+
admin: number;
|
|
313
|
+
disposal: number;
|
|
314
|
+
disposal_recycling: number;
|
|
315
|
+
debrief_status: string;
|
|
316
|
+
new_order_status: string;
|
|
317
|
+
adhoc_charges: AdhocCharge[];
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export interface AdhocCharge {
|
|
321
|
+
adhoc_charges_description: string;
|
|
322
|
+
adhoc_charges: number;
|
|
323
|
+
id: string; // required for state updations only
|
|
324
|
+
}
|
|
@@ -14,7 +14,44 @@ export const capitalize = (input: string) => {
|
|
|
14
14
|
return char.toUpperCase();
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
|
+
export const getBaseUrlSymbol = (): string => {
|
|
18
|
+
const storedSymbol = localStorage.getItem('baseUrlSymbol');
|
|
19
|
+
if (!storedSymbol) {
|
|
20
|
+
localStorage.setItem('baseUrlSymbol', '£');
|
|
21
|
+
return '£';
|
|
22
|
+
}
|
|
23
|
+
return storedSymbol;
|
|
24
|
+
};
|
|
25
|
+
export const handleKeyDownDebrief = (
|
|
26
|
+
e: React.KeyboardEvent<HTMLInputElement>
|
|
27
|
+
) => {
|
|
28
|
+
// Allowed keys: numbers (0-9), '.'
|
|
29
|
+
const allowedKeys = [
|
|
30
|
+
'0',
|
|
31
|
+
'1',
|
|
32
|
+
'2',
|
|
33
|
+
'3',
|
|
34
|
+
'4',
|
|
35
|
+
'5',
|
|
36
|
+
'6',
|
|
37
|
+
'7',
|
|
38
|
+
'8',
|
|
39
|
+
'9',
|
|
40
|
+
'.',
|
|
41
|
+
'ArrowLeft',
|
|
42
|
+
'ArrowRight',
|
|
43
|
+
];
|
|
17
44
|
|
|
45
|
+
// Allow backspace, delete and Tab keys
|
|
46
|
+
if (e.key === 'Backspace' || e.key === 'Delete' || e.key === 'Tab') {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Prevent input if key is not in allowedKeys
|
|
51
|
+
if (!allowedKeys.includes(e.key)) {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
18
55
|
export const RepackData = [
|
|
19
56
|
{
|
|
20
57
|
packaging_type: 'Recycled Cardboard',
|
package/src/components/store.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
CreateReturnPayload,
|
|
5
5
|
SelectDateType,
|
|
6
6
|
} from './types';
|
|
7
|
+
import dayjs from 'dayjs';
|
|
7
8
|
|
|
8
9
|
export const filtersInitialValue = {
|
|
9
10
|
date: {
|
|
@@ -118,12 +119,65 @@ function useSelectedOrders() {
|
|
|
118
119
|
return useAtom(selectedOrderlList);
|
|
119
120
|
}
|
|
120
121
|
|
|
122
|
+
const selectedCPOrderlList = atom<any[]>([]);
|
|
123
|
+
|
|
124
|
+
function useSelectedClientPortOrders() {
|
|
125
|
+
return useAtom(selectedCPOrderlList);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const selectedCPOrderAfterlList = atom<any[]>([]);
|
|
129
|
+
|
|
130
|
+
function useSelectedClientAfterOrders() {
|
|
131
|
+
return useAtom(selectedCPOrderAfterlList);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
//start date and end date
|
|
135
|
+
const startCPDate = atom<dayjs.Dayjs | null>(dayjs());
|
|
136
|
+
|
|
137
|
+
function useStartDate() {
|
|
138
|
+
return useAtom(startCPDate);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const endCPDate = atom<dayjs.Dayjs | null>(null);
|
|
142
|
+
|
|
143
|
+
function useEndDate() {
|
|
144
|
+
return useAtom(endCPDate);
|
|
145
|
+
}
|
|
146
|
+
|
|
121
147
|
// Sticky menu state
|
|
122
148
|
const stickyStatus = atom<boolean>(false);
|
|
123
149
|
export const useStickyStatus = () => {
|
|
124
150
|
return useAtom(stickyStatus);
|
|
125
151
|
};
|
|
126
152
|
|
|
153
|
+
//search for pending
|
|
154
|
+
// Sticky menu state
|
|
155
|
+
const search = atom<any>('');
|
|
156
|
+
export const useSearchText = () => {
|
|
157
|
+
return useAtom(search);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const searchAfter = atom<any>('');
|
|
161
|
+
export const useSearchAfterText = () => {
|
|
162
|
+
return useAtom(searchAfter);
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const rclientReturnDataAtom = atom<any[]>([]);
|
|
166
|
+
export function useClientOutstandingReturnData() {
|
|
167
|
+
return useAtom(rclientReturnDataAtom);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const returnConfirmedOrderAtom = atom<any[]>([]);
|
|
171
|
+
|
|
172
|
+
export function useReturnConfirmedOrderData() {
|
|
173
|
+
return useAtom(returnConfirmedOrderAtom);
|
|
174
|
+
}
|
|
175
|
+
const statsCPCount = atom<any>(null);
|
|
176
|
+
|
|
177
|
+
export function useStatsCPCount() {
|
|
178
|
+
return useAtom(statsCPCount);
|
|
179
|
+
}
|
|
180
|
+
|
|
127
181
|
function useCustomerData() {
|
|
128
182
|
return useAtom(customerData);
|
|
129
183
|
}
|
|
@@ -213,7 +267,10 @@ const isClientPortalAtom = atom<boolean>(false);
|
|
|
213
267
|
function useClientPortal() {
|
|
214
268
|
return useAtom(isClientPortalAtom);
|
|
215
269
|
}
|
|
216
|
-
|
|
270
|
+
const activeCardIdAtom = atom<number>(1);
|
|
271
|
+
export const useActiveCardId = () => {
|
|
272
|
+
return useAtom(activeCardIdAtom);
|
|
273
|
+
};
|
|
217
274
|
export {
|
|
218
275
|
useAtom,
|
|
219
276
|
useFilter,
|
|
@@ -245,4 +302,8 @@ export {
|
|
|
245
302
|
useSelectedProducts,
|
|
246
303
|
useVisibilityData,
|
|
247
304
|
useClientPortal,
|
|
305
|
+
useSelectedClientPortOrders,
|
|
306
|
+
useStartDate,
|
|
307
|
+
useEndDate,
|
|
308
|
+
useSelectedClientAfterOrders,
|
|
248
309
|
};
|
package/src/components/utils.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { format } from
|
|
1
|
+
import { format } from 'date-fns';
|
|
2
2
|
|
|
3
3
|
export const EscalationCategory = [
|
|
4
4
|
{
|
|
@@ -98,7 +98,6 @@ export const EscalationStatus = [
|
|
|
98
98
|
},
|
|
99
99
|
];
|
|
100
100
|
|
|
101
|
-
|
|
102
101
|
export const getIntegerValue = (value: number) => {
|
|
103
102
|
return value ?? 0;
|
|
104
103
|
};
|
|
@@ -110,4 +109,15 @@ export const getStringValue = (value: string) => {
|
|
|
110
109
|
export const FormattedDate = ({ date }: any) => {
|
|
111
110
|
const formattedDate = format(new Date(date), 'dd/MM/yyyy');
|
|
112
111
|
return formattedDate;
|
|
113
|
-
}
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const javascriptStringDumpToJSON = function(data: string) {
|
|
115
|
+
let d = data.replace(new RegExp(`(?<=[a-zA-Z])'(?=[a-zA-Z ])`, 'g'), '__');
|
|
116
|
+
d = d.replace(new RegExp("'", 'g'), '"');
|
|
117
|
+
d = d.replace(new RegExp('__', 'g'), "'");
|
|
118
|
+
d = d.replace(new RegExp('None', 'g'), 'null');
|
|
119
|
+
d = d.replace(new RegExp('False', 'g'), 'false');
|
|
120
|
+
d = d.replace(new RegExp('True', 'g'), 'true');
|
|
121
|
+
d = d.replace(new RegExp(/(\d+)\s*[a-zA-Z]/gm), '$1');
|
|
122
|
+
return JSON.parse(d);
|
|
123
|
+
};
|
package/src/index.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Suspense, useEffect } from 'react';
|
|
2
|
-
import { Route, Routes, useSearchParams } from 'react-router-dom';
|
|
2
|
+
import { Navigate, Route, Routes, useSearchParams } from 'react-router-dom';
|
|
3
3
|
import ReturnTable from './components/order-daily-overview/return-order-table/ReturnTable';
|
|
4
4
|
import ReturnAfterTable from './components/order-daily-overview/return-after-table/ReturnAfterTable';
|
|
5
5
|
import {
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
useSelectedLocation,
|
|
9
9
|
} from './components/order-daily-overview/store/store';
|
|
10
10
|
import { notification } from 'antd';
|
|
11
|
-
import RouterHeader from './components/order-daily-overview/header/route-header/RouterHeader';
|
|
11
|
+
// import RouterHeader from './components/order-daily-overview/header/route-header/RouterHeader';
|
|
12
12
|
import {
|
|
13
13
|
useActionType,
|
|
14
14
|
useActionTypeOptions,
|
|
@@ -26,6 +26,8 @@ import {
|
|
|
26
26
|
} from './components/order-view/store';
|
|
27
27
|
import OrderViewQueryHandler from './OrderViewQueryHandler';
|
|
28
28
|
import OrderView from './components/order-view';
|
|
29
|
+
import ReturnOverview from './components/client-portal/ReturnOverview';
|
|
30
|
+
import RouterHeader from './components/order-daily-overview/header/route-header/RouterHeader';
|
|
29
31
|
function ReturnClient() {
|
|
30
32
|
notification.config({
|
|
31
33
|
top: 80,
|
|
@@ -43,7 +45,7 @@ function ReturnClient() {
|
|
|
43
45
|
const [, setSelectedLocationValue] = useSelectedLocation();
|
|
44
46
|
const [, setVisibilityData] = useVisibilityData();
|
|
45
47
|
const [, setOrderStaticData] = useOrderStaticData();
|
|
46
|
-
const [, setClientPortal] = useClientPortal();
|
|
48
|
+
const [clientPortal, setClientPortal] = useClientPortal();
|
|
47
49
|
|
|
48
50
|
const userType = JSON.parse(localStorage.getItem('user_type')!);
|
|
49
51
|
|
|
@@ -114,25 +116,33 @@ function ReturnClient() {
|
|
|
114
116
|
setLocationData(fetchedLocationData?.data);
|
|
115
117
|
}
|
|
116
118
|
}, [locationloading]);
|
|
119
|
+
|
|
117
120
|
return (
|
|
118
121
|
<>
|
|
119
|
-
<RouterHeader />
|
|
122
|
+
{!clientPortal && <RouterHeader />}
|
|
120
123
|
<Suspense fallback={<LoadingMessage />}>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
{clientPortal ? (
|
|
125
|
+
<Routes>
|
|
126
|
+
<Route path="" element={<Navigate to={'outstanding_return'} />} />
|
|
127
|
+
<Route path=":status" element={<ReturnOverview />} />
|
|
128
|
+
</Routes>
|
|
129
|
+
) : (
|
|
130
|
+
<Routes>
|
|
131
|
+
{/* for local */}
|
|
132
|
+
{/* <Route
|
|
124
133
|
path="/orders/view/return/*"
|
|
125
134
|
element={<OrderViewQueryHandler />}
|
|
126
135
|
/> */}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
+
{/* for dev */}
|
|
137
|
+
<Route path="" element={<OrderViewQueryHandler />} />
|
|
138
|
+
<Route path="overview" element={<ReturnAfterTable />} />
|
|
139
|
+
<Route path="/:id" element={<OrderView />} />
|
|
140
|
+
{/* for local */}
|
|
141
|
+
{/* <Route path="/orders/view/return/filter" element={<ReturnTable />} /> */}
|
|
142
|
+
{/* for dev */}
|
|
143
|
+
<Route path="filter" element={<ReturnTable />} />
|
|
144
|
+
</Routes>
|
|
145
|
+
)}
|
|
136
146
|
</Suspense>
|
|
137
147
|
</>
|
|
138
148
|
);
|