@bjsdistribution/dms-client-return 0.1.19-dev → 0.1.21-dev

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.
Files changed (162) hide show
  1. package/dist/components/client-portal/DateFilterStore.d.ts +15 -0
  2. package/dist/components/client-portal/OutstandingTable.d.ts +3 -0
  3. package/dist/components/client-portal/ReturnStatus.d.ts +5 -0
  4. package/dist/components/client-portal/return-confirm/ConfirmedMain.d.ts +3 -0
  5. package/dist/components/client-portal/return-confirm/ReturnConfirmedTable.d.ts +3 -0
  6. package/dist/components/order-view/DynamicTable.d.ts +2 -1
  7. package/dist/components/order-view/general-information/Status.d.ts +1 -1
  8. package/dist/components/order-view/general-information/index.d.ts +1 -1
  9. package/dist/components/order-view/index.d.ts +1 -1
  10. package/dist/components/order-view/notes/AddNote.d.ts +1 -0
  11. package/dist/components/order-view/notes/order-dropdown/NewReturnDropdown.d.ts +3 -0
  12. package/dist/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.d.ts +4 -1
  13. package/dist/components/order-view/order-actions/actions/confirm-order/index.d.ts +4 -1
  14. package/dist/components/order-view/order-actions/actions/force-debrief/BaseChargeConfirmationModal.d.ts +7 -0
  15. package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.d.ts +11 -0
  16. package/dist/components/order-view/order-actions/actions/force-debrief/Selector.d.ts +11 -0
  17. package/dist/components/order-view/order-actions/actions/force-debrief/charges/adhoc/index.d.ts +3 -0
  18. package/dist/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.d.ts +8 -0
  19. package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.d.ts +7 -0
  20. package/dist/components/order-view/order-actions/actions/force-debrief/charges/delivery-add-ons/index.d.ts +7 -0
  21. package/dist/components/order-view/order-actions/actions/force-debrief/charges/disposal-charges/index.d.ts +7 -0
  22. package/dist/components/order-view/order-actions/actions/force-debrief/charges/order-charges/index.d.ts +7 -0
  23. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationCategory.d.ts +3 -0
  24. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationLevel.d.ts +3 -0
  25. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.d.ts +3 -0
  26. package/dist/components/order-view/order-actions/actions/force-debrief/escalation/index.d.ts +3 -0
  27. package/dist/components/order-view/order-actions/actions/force-debrief/notifications/FlagsTemplate.d.ts +3 -0
  28. package/dist/components/order-view/order-actions/actions/force-debrief/notifications/OrderTemplate.d.ts +3 -0
  29. package/dist/components/order-view/order-actions/actions/force-debrief/notifications/Tabs.d.ts +3 -0
  30. package/dist/components/order-view/order-actions/actions/force-debrief/notifications/index.d.ts +3 -0
  31. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.d.ts +7 -0
  32. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.d.ts +3 -0
  33. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.d.ts +3 -0
  34. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/OrderHoldReasonDropdown.d.ts +3 -0
  35. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/StatusDropdown.d.ts +3 -0
  36. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/ZoneDropdown.d.ts +3 -0
  37. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/failure-content/index.d.ts +3 -0
  38. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/index.d.ts +4 -0
  39. package/dist/components/order-view/order-actions/actions/force-debrief/order-info/success-content/index.d.ts +3 -0
  40. package/dist/components/order-view/order-actions/actions/force-debrief/styles.d.ts +8 -0
  41. package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.d.ts +1 -0
  42. package/dist/components/order-view/order-actions/actions/remove-from-route/RemoveFromRoute.d.ts +1 -1
  43. package/dist/components/order-view/order-actions/actions/unhold-order/UnholdOrder.d.ts +1 -0
  44. package/dist/components/order-view/order-actions/types.d.ts +3 -3
  45. package/dist/components/order-view/order-details/expanded-content/index.d.ts +1 -1
  46. package/dist/components/order-view/order-details/index.d.ts +1 -1
  47. package/dist/components/order-view/order-resources/expanded-content/index.d.ts +1 -1
  48. package/dist/components/order-view/products-info/expanded-content/index.d.ts +6 -1
  49. package/dist/components/order-view/products-info/index.d.ts +1 -1
  50. package/dist/components/order-view/return-client-products/ProductTable.d.ts +6 -1
  51. package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.d.ts +6 -1
  52. package/dist/components/order-view/store.d.ts +15 -3
  53. package/dist/components/order-view/system-event-logs/expanded-content/index.d.ts +1 -1
  54. package/dist/components/order-view/types.d.ts +49 -1
  55. package/dist/components/order-view/utils.d.ts +3 -0
  56. package/dist/components/order-view/view-reminder/ViewReminder.d.ts +2 -0
  57. package/dist/components/store.d.ts +5 -1
  58. package/dist/dms-client-return.cjs.development.js +7035 -3476
  59. package/dist/dms-client-return.cjs.development.js.map +1 -1
  60. package/dist/dms-client-return.cjs.production.min.js +1 -1
  61. package/dist/dms-client-return.cjs.production.min.js.map +1 -1
  62. package/dist/dms-client-return.esm.js +7099 -3540
  63. package/dist/dms-client-return.esm.js.map +1 -1
  64. package/package.json +6 -4
  65. package/src/assets/icons/ActionIcon.tsx +1 -1
  66. package/src/assets/icons/ArrowDownIcon.tsx +2 -2
  67. package/src/components/client-portal/DateFilterStore.ts +94 -0
  68. package/src/components/client-portal/OutstandingTable.tsx +355 -0
  69. package/src/components/client-portal/ReturnAfterSearchBar.tsx +76 -17
  70. package/src/components/client-portal/ReturnOverview.tsx +4 -4
  71. package/src/components/client-portal/ReturnRTFilters.tsx +57 -40
  72. package/src/components/client-portal/ReturnSearchBar.tsx +64 -94
  73. package/src/components/client-portal/ReturnStatus.tsx +50 -68
  74. package/src/components/client-portal/return-confirm/ConfirmedMain.tsx +224 -0
  75. package/src/components/client-portal/return-confirm/ReturnConfirmedTable.tsx +327 -0
  76. package/src/components/order-daily-overview/header/route-header/RouterHeader.tsx +11 -18
  77. package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +43 -15
  78. package/src/components/order-daily-overview/index.tsx +23 -4
  79. package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +23 -38
  80. package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +21 -24
  81. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +36 -36
  82. package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +12 -2
  83. package/src/components/order-daily-overview/return-order-table/ReturnTable.tsx +16 -0
  84. package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +58 -155
  85. package/src/components/order-daily-overview/table/ReturnTable.tsx +8 -4
  86. package/src/components/order-view/DynamicTable.tsx +21 -8
  87. package/src/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.tsx +1 -1
  88. package/src/components/order-view/details-filters/left-side-filters/dropdowns/OptionsDropDown.tsx +9 -0
  89. package/src/components/order-view/details-filters/right-side-filters/Details.tsx +28 -3
  90. package/src/components/order-view/flags-action-modal/Dropdowns.tsx +2 -0
  91. package/src/components/order-view/general-information/Status.tsx +92 -18
  92. package/src/components/order-view/general-information/index.tsx +2 -2
  93. package/src/components/order-view/generic-table/AuditLogs.tsx +39 -12
  94. package/src/components/order-view/index.tsx +50 -8
  95. package/src/components/order-view/modalsPopup/ModalManager.tsx +1 -1
  96. package/src/components/order-view/notes/AddNote.tsx +95 -65
  97. package/src/components/order-view/notes/order-dropdown/NewReturnDropdown.tsx +8 -10
  98. package/src/components/order-view/notification/FlagTemplate.tsx +21 -10
  99. package/src/components/order-view/notification/OrderTemplate.tsx +192 -41
  100. package/src/components/order-view/notification/ReminderTemplate.tsx +28 -13
  101. package/src/components/order-view/notification/index.tsx +100 -55
  102. package/src/components/order-view/order-actions/actions/add-resources/DocFileUpload.tsx +92 -72
  103. package/src/components/order-view/order-actions/actions/add-resources/index.tsx +27 -10
  104. package/src/components/order-view/order-actions/actions/cancel-order/ReturnAction.tsx +25 -4
  105. package/src/components/order-view/order-actions/actions/cancel-order/ReturnReason.tsx +24 -4
  106. package/src/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.tsx +9 -2
  107. package/src/components/order-view/order-actions/actions/confirm-order/index.tsx +12 -6
  108. package/src/components/order-view/order-actions/actions/confirm-order/tables/NotesTable.tsx +1 -0
  109. package/src/components/order-view/order-actions/actions/create-task-reminder/CreateReminderModal.tsx +88 -30
  110. package/src/components/order-view/order-actions/actions/create-task-reminder/CreateTaskModal.tsx +5 -3
  111. package/src/components/order-view/order-actions/actions/create-task-reminder/TaskModal.tsx +2 -2
  112. package/src/components/order-view/order-actions/actions/force-debrief/BaseChargeConfirmationModal.tsx +94 -0
  113. package/src/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.tsx +620 -0
  114. package/src/components/order-view/order-actions/actions/force-debrief/Selector.tsx +65 -0
  115. package/src/components/order-view/order-actions/actions/force-debrief/charges/adhoc/index.tsx +94 -0
  116. package/src/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.tsx +106 -0
  117. package/src/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.tsx +77 -0
  118. package/src/components/order-view/order-actions/actions/force-debrief/charges/delivery-add-ons/index.tsx +78 -0
  119. package/src/components/order-view/order-actions/actions/force-debrief/charges/disposal-charges/index.tsx +77 -0
  120. package/src/components/order-view/order-actions/actions/force-debrief/charges/order-charges/index.tsx +124 -0
  121. package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationCategory.tsx +92 -0
  122. package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationLevel.tsx +90 -0
  123. package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.tsx +122 -0
  124. package/src/components/order-view/order-actions/actions/force-debrief/escalation/index.tsx +16 -0
  125. package/src/components/order-view/order-actions/actions/force-debrief/notifications/FlagsTemplate.tsx +46 -0
  126. package/src/components/order-view/order-actions/actions/force-debrief/notifications/OrderTemplate.tsx +117 -0
  127. package/src/components/order-view/order-actions/actions/force-debrief/notifications/Tabs.tsx +32 -0
  128. package/src/components/order-view/order-actions/actions/force-debrief/notifications/index.tsx +180 -0
  129. package/src/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.tsx +201 -0
  130. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.tsx +40 -0
  131. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.tsx +108 -0
  132. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/OrderHoldReasonDropdown.tsx +37 -0
  133. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/StatusDropdown.tsx +48 -0
  134. package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/ZoneDropdown.tsx +27 -0
  135. package/src/components/order-view/order-actions/actions/force-debrief/order-info/failure-content/index.tsx +187 -0
  136. package/src/components/order-view/order-actions/actions/force-debrief/order-info/index.tsx +55 -0
  137. package/src/components/order-view/order-actions/actions/force-debrief/order-info/success-content/index.tsx +221 -0
  138. package/src/components/order-view/order-actions/actions/force-debrief/styles.tsx +51 -0
  139. package/src/components/order-view/order-actions/actions/hold-order/HoldOrderModal.tsx +2 -0
  140. package/src/components/order-view/order-actions/actions/remove-from-route/RemoveFromRoute.tsx +7 -2
  141. package/src/components/order-view/order-actions/actions/unhold-order/UnholdOrder.tsx +2 -0
  142. package/src/components/order-view/order-actions/index.tsx +18 -5
  143. package/src/components/order-view/order-actions/store.ts +1 -1
  144. package/src/components/order-view/order-actions/types.ts +3 -3
  145. package/src/components/order-view/order-details/expanded-content/footer/index.tsx +7 -1
  146. package/src/components/order-view/order-details/expanded-content/index.tsx +37 -16
  147. package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +1 -1
  148. package/src/components/order-view/order-details/expanded-content/services-section/ServiceLevel.tsx +3 -4
  149. package/src/components/order-view/order-details/index.tsx +5 -2
  150. package/src/components/order-view/order-resources/expanded-content/index.tsx +2 -2
  151. package/src/components/order-view/products-info/expanded-content/index.tsx +33 -11
  152. package/src/components/order-view/products-info/index.tsx +10 -6
  153. package/src/components/order-view/return-client-products/ProductTable.tsx +12 -2
  154. package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +73 -23
  155. package/src/components/order-view/store.ts +107 -1
  156. package/src/components/order-view/system-event-logs/expanded-content/index.tsx +6 -2
  157. package/src/components/order-view/types.ts +54 -1
  158. package/src/components/order-view/utils.ts +37 -0
  159. package/src/components/order-view/view-reminder/AssigneeDropdown.tsx +85 -26
  160. package/src/components/order-view/view-reminder/ViewReminder.tsx +33 -14
  161. package/src/components/store.ts +24 -1
  162. package/src/index.tsx +6 -3
@@ -0,0 +1,221 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+ import {
4
+ CalendarIcon,
5
+ Label,
6
+ TextArea,
7
+ } from '@bjsdistribution/dms-component-library';
8
+ import { Input } from '../../styles';
9
+ import {
10
+ useChargesState,
11
+ useOrderDetails,
12
+ useProductDetails,
13
+ } from '../../../../../store';
14
+ import { getBaseUrlSymbol } from '../../../../../utils';
15
+
16
+ const formatDate = (date: any) => {
17
+ const padZero = (num: any) => num.toString().padStart(2, '0');
18
+ const year = new Date(date).getFullYear();
19
+ const month = padZero(new Date(date).getMonth() + 1);
20
+ const day = padZero(new Date(date).getDate());
21
+ return `${day}/${month}/${year}`;
22
+ };
23
+
24
+ function SuccessContent() {
25
+ const [orderDetails] = useOrderDetails();
26
+ const [chargesState] = useChargesState();
27
+ const baseUrlSymbol = getBaseUrlSymbol();
28
+
29
+ const [productdata] = useProductDetails();
30
+ const sortedProductData = productdata?.sort((a: any, b: any) => {
31
+ return a?.status === b?.status ? 0 : a?.status ? -1 : 1;
32
+ });
33
+
34
+ const products = Array.isArray(sortedProductData)
35
+ ? sortedProductData?.filter(item => item?.status === true)
36
+ : [];
37
+
38
+ const excludedFields = [
39
+ 'debrief_notes',
40
+ 'new_order_status',
41
+ 'base_charge_type',
42
+ 'adhoc_charges',
43
+ 'debrief_status',
44
+ ]; // Fields to exclude
45
+ let totalChargesAmount = 0;
46
+
47
+ for (const [key, value] of Object.entries(chargesState)) {
48
+ if (!excludedFields.includes(key) && typeof value === 'number') {
49
+ totalChargesAmount += value;
50
+ }
51
+ }
52
+
53
+ const formattedDate =
54
+ orderDetails?.action_date === null
55
+ ? ' '
56
+ : formatDate(orderDetails?.action_date);
57
+
58
+ const adhocTotalCharges =
59
+ chargesState?.adhoc_charges?.length > 0
60
+ ? chargesState?.adhoc_charges?.reduce(
61
+ (acc, item) => acc + item.adhoc_charges,
62
+ 0
63
+ )
64
+ : 0;
65
+
66
+ return (
67
+ <Wrapper>
68
+ <FieldGroup>
69
+ <Label label="Signed By" htmlFor="signedby" />
70
+ <StyledInput
71
+ id="signedby"
72
+ placeholder=""
73
+ value={orderDetails?.order_recipient?.recipient_name || ''}
74
+ onChange={() => {}}
75
+ disabled
76
+ />
77
+
78
+ <Label label="Date" htmlFor="datefield" />
79
+ <DateInput>
80
+ <Text>{formattedDate}</Text>
81
+ <CalendarIcon />
82
+ </DateInput>
83
+
84
+ <GroupedFields>
85
+ <PairGroup>
86
+ <SmallGroup>
87
+ <Label label="Items" htmlFor="items" />
88
+ <Text>{products?.length}</Text>
89
+ </SmallGroup>
90
+ <SmallGroup>
91
+ <Label label="Zone" htmlFor="zone" />
92
+ <Text>{orderDetails?.zone_code}</Text>
93
+ </SmallGroup>
94
+ </PairGroup>
95
+
96
+ <PairGroup>
97
+ <SmallGroup>
98
+ <Label label="Weight" htmlFor="weight" />
99
+ <Text>{orderDetails?.weight}Kg</Text>
100
+ </SmallGroup>
101
+
102
+ <SmallGroup>
103
+ <Label label="Total Charge" htmlFor="totalCharge" />
104
+ <div
105
+ style={{ display: 'flex', gap: '4px', alignItems: 'center' }}
106
+ >
107
+ <CurrencyWrapper>{baseUrlSymbol}</CurrencyWrapper>
108
+ <Text>{totalChargesAmount + adhocTotalCharges}</Text>
109
+ </div>
110
+ </SmallGroup>
111
+ </PairGroup>
112
+ </GroupedFields>
113
+ </FieldGroup>
114
+
115
+ <DropdownGrid>
116
+ <FieldGroup wide>
117
+ <Label label="Order Status Notes" htmlFor="notes" />
118
+ <TextInput
119
+ id="notes"
120
+ placeholder="Type notes here..."
121
+ value={orderDetails?.order_status_note || ''}
122
+ readOnly
123
+ />
124
+ </FieldGroup>
125
+
126
+ <FieldGroup wide>
127
+ <Label label="Charge Description" htmlFor="chargedescription" />
128
+ <TextInput
129
+ id="chargedescription"
130
+ placeholder="Type charge description here..."
131
+ onChange={() => {}}
132
+ />
133
+ </FieldGroup>
134
+ </DropdownGrid>
135
+ </Wrapper>
136
+ );
137
+ }
138
+
139
+ const CurrencyWrapper = styled.span`
140
+ display: flex;
141
+ align-items: center;
142
+ color: #999;
143
+ `;
144
+
145
+ const DropdownGrid = styled.div`
146
+ display: flex;
147
+ flex-wrap: wrap;
148
+ gap: 20px;
149
+ width: 48%;
150
+ `;
151
+
152
+ const GroupedFields = styled.div`
153
+ display: flex;
154
+ flex-direction: column;
155
+ gap: 7px;
156
+ `;
157
+
158
+ const PairGroup = styled.div`
159
+ display: flex;
160
+ flex-direction: row;
161
+ gap: 20px;
162
+
163
+ @media (max-width: 768px) {
164
+ flex-direction: column;
165
+ }
166
+ `;
167
+
168
+ const SmallGroup = styled.div`
169
+ display: flex;
170
+ flex-direction: column;
171
+ gap: 6px;
172
+ flex: 1;
173
+ width: 48%;
174
+ `;
175
+
176
+ const Wrapper = styled.div`
177
+ display: flex;
178
+ flex-wrap: wrap;
179
+ gap: 20px;
180
+ width: 100%;
181
+ padding: 10px 0;
182
+ `;
183
+
184
+ const FieldGroup = styled.div<{ wide?: boolean }>`
185
+ display: flex;
186
+ flex-direction: column;
187
+ gap: 6px;
188
+ flex: ${props => (props.wide ? 2 : 1)};
189
+ `;
190
+
191
+ const TextInput = styled(TextArea)`
192
+ resize: none;
193
+ width: 100%;
194
+ min-height: 180px;
195
+ `;
196
+
197
+ const StyledInput = styled(Input)`
198
+ width: 100%;
199
+ height: 38px;
200
+ `;
201
+
202
+ const DateInput = styled.div`
203
+ display: flex;
204
+ align-items: center;
205
+ justify-content: space-between;
206
+ padding: 0 12px;
207
+ border-radius: 6px;
208
+ border: 1px solid #e0e2e7;
209
+ background-color: #fff;
210
+ color: #363a30;
211
+ height: 38px;
212
+ font-size: 14px;
213
+ box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);
214
+ `;
215
+
216
+ const Text = styled.div`
217
+ color: #363a30;
218
+ font-size: 14px;
219
+ `;
220
+
221
+ export default SuccessContent;
@@ -0,0 +1,51 @@
1
+ import styled from 'styled-components';
2
+
3
+ export const Title = styled.span`
4
+ font-family: 'Lato', sans-serif;
5
+ font-size: 16px;
6
+ font-weight: 600;
7
+ color: #6a7378;
8
+ `;
9
+
10
+ export const Container = styled.div`
11
+ display: flex;
12
+ flex-direction: column;
13
+ gap: 4px;
14
+ `;
15
+
16
+ export const FieldRow = styled.div`
17
+ display: flex;
18
+ align-items: center;
19
+ gap: 8px;
20
+ width: 300px;
21
+ justify-content: space-between;
22
+ `;
23
+
24
+ export const Label = styled.label`
25
+ font-size: 14px;
26
+ color: #7b7874;
27
+ `;
28
+
29
+ export const Input = styled.input`
30
+ width: 70px;
31
+ padding: 6px;
32
+ font-size: 14px;
33
+ border: 1px solid #ccc;
34
+ border-radius: 4px;
35
+ &::-webkit-inner-spin-button,
36
+ &::-webkit-outer-spin-button {
37
+ -webkit-appearance: none;
38
+ -moz-appearance: none;
39
+ appearance: none;
40
+ margin: 0;
41
+ }
42
+ `;
43
+
44
+ export const MainContainer = styled.div`
45
+ display: flex;
46
+ flex-direction: column;
47
+ gap: 4px;
48
+ `;
49
+ export const CurrencySymbol = styled.span`
50
+ color: #858d9d;
51
+ `;
@@ -25,6 +25,7 @@ import { useClientPortal } from '../../../../store';
25
25
  interface IProps {
26
26
  callOrderAlertsApi: any;
27
27
  callOrdersApi?: any;
28
+ callOrderStatusApi: any;
28
29
  callUnresolvedTaskApi?: any;
29
30
  }
30
31
 
@@ -93,6 +94,7 @@ function HoldOrderModal(props: IProps) {
93
94
  await props?.callUnresolvedTaskApi();
94
95
  }
95
96
  await props?.callOrderAlertsApi();
97
+ await props?.callOrderStatusApi();
96
98
  await props?.callOrdersApi();
97
99
  }
98
100
  if (response?.code !== 200) {
@@ -15,12 +15,16 @@ import {
15
15
  } from '../../../store';
16
16
  import { notification } from 'antd';
17
17
 
18
- function RemoveFromRoute() {
18
+ function RemoveFromRoute(props: any) {
19
19
  const [orderId] = useOrderId();
20
20
  const [, setCurrentAction] = useCurrentAction();
21
21
  const [, setRecalling] = useLiveRecalling();
22
22
  const [, setRecallAuditLog] = useGlobalStateHitAuditLog();
23
23
 
24
+ const callOrdersApi = async () => {
25
+ await props?.callOrderAlertsApi();
26
+ };
27
+
24
28
  const { data: response, setShouldPerformAction: setAction } = useApiHook<{
25
29
  data: ApiResponse[];
26
30
  }>({
@@ -37,9 +41,10 @@ function RemoveFromRoute() {
37
41
  //@ts-ignore
38
42
  response?.message || 'Order has been removed successfully',
39
43
  });
40
- setCurrentAction(undefined);
44
+ callOrdersApi();
41
45
  setRecalling(true);
42
46
  setRecallAuditLog(true);
47
+ setCurrentAction(undefined);
43
48
  }
44
49
  if (response?.data === null) {
45
50
  notification.error({
@@ -13,6 +13,7 @@ interface IProps {
13
13
  callOrderAlertsApi: any;
14
14
  callOrdersApi?: any;
15
15
  callUnresolvedTaskApi?: any;
16
+ callOrderStatusApi: any;
16
17
  }
17
18
 
18
19
  const UnholdOrder = (props: IProps) => {
@@ -46,6 +47,7 @@ const UnholdOrder = (props: IProps) => {
46
47
  }
47
48
  await props?.callOrderAlertsApi();
48
49
  await props?.callOrdersApi();
50
+ await props?.callOrderStatusApi();
49
51
  }
50
52
  if (response?.code !== 200) {
51
53
  notification.error({
@@ -34,6 +34,7 @@ import { useReminderNotiData, useTasksData } from './store';
34
34
  import ChargeLog from './actions/charge-log';
35
35
  import ReminderModal from './actions/create-task-reminder';
36
36
  import TaskModal from './actions/create-task-reminder/TaskModal';
37
+ import ForceDebriefModal from './actions/force-debrief/ForceDebriefModal';
37
38
 
38
39
  function OrderActions() {
39
40
  const [currentAction, setCurrentAction] = useCurrentAction();
@@ -93,8 +94,8 @@ function OrderActions() {
93
94
  setProductDetails(productsData?.data);
94
95
  setProductDetailsCopy(productsData?.data);
95
96
  } else {
96
- setProductDetails(null);
97
- setProductDetailsCopy(null);
97
+ setProductDetails([]);
98
+ setProductDetailsCopy([]);
98
99
  }
99
100
  }, [orderProductsLoading]);
100
101
 
@@ -176,6 +177,7 @@ function OrderActions() {
176
177
  method: 'GET',
177
178
  pagination: { is_pagination: false },
178
179
  filters: [{ field: 'order_id', op: '=', value: orderId }],
180
+ showLoader: false,
179
181
  });
180
182
 
181
183
  useEffect(() => {
@@ -234,9 +236,18 @@ function OrderActions() {
234
236
  />
235
237
  );
236
238
  case 'confirm-order':
237
- return <ConfirmOrder />;
239
+ return <ConfirmOrder callOrderAlertsApi={callOrderAlertsApi} />;
238
240
  case 'send-sms':
239
241
  return <SendSmsModal />;
242
+
243
+ case 'force-debrief':
244
+ return (
245
+ <ForceDebriefModal
246
+ callOrdersApi={callOrdersApi}
247
+ callOrderStatusApi={fetchStatusData}
248
+ callOrderAlertsApi={callOrderAlertsApi}
249
+ />
250
+ );
240
251
  case 'send-email':
241
252
  return <SendEmailModal />;
242
253
  case 'change-customer-account':
@@ -247,6 +258,7 @@ function OrderActions() {
247
258
  <HoldOrderModal
248
259
  callOrdersApi={callOrdersApi}
249
260
  callOrderAlertsApi={callOrderAlertsApi}
261
+ callOrderStatusApi={fetchStatusData}
250
262
  callUnresolvedTaskApi={callUnresolvedTaskApi}
251
263
  />
252
264
  );
@@ -272,6 +284,7 @@ function OrderActions() {
272
284
  callOrdersApi={callOrdersApi}
273
285
  callOrderAlertsApi={callOrderAlertsApi}
274
286
  callUnresolvedTaskApi={callUnresolvedTaskApi}
287
+ callOrderStatusApi={fetchStatusData}
275
288
  />
276
289
  );
277
290
  case 'view-reminder':
@@ -281,9 +294,9 @@ function OrderActions() {
281
294
  case 'view-flag':
282
295
  return <ViewFlag />;
283
296
  case 'clear-date':
284
- return <ClearBookingStatus />;
297
+ return <ClearBookingStatus callOrderAlertsApi={callOrderAlertsApi} />;
285
298
  case 'remove-from-route':
286
- return <RemoveFromRoute />;
299
+ return <RemoveFromRoute callOrderAlertsApi={callOrderAlertsApi} />;
287
300
  default:
288
301
  return null;
289
302
  }
@@ -18,7 +18,7 @@ export const initialPayload: CreateTaskPayload = {
18
18
  flag_type: '',
19
19
  priority: 3,
20
20
  status: 'AD',
21
- due_datetime: '',
21
+ // due_datetime: '',
22
22
  };
23
23
 
24
24
  export const initialValue: CreateReminderPayload = {
@@ -22,7 +22,7 @@ export interface CreateTaskPayload {
22
22
  flag_type: string | null;
23
23
  priority: number | null;
24
24
  status: string | null;
25
- due_datetime: string | null;
25
+ due_datetime?: string | null;
26
26
  }
27
27
  export interface resolveTaskPayload {
28
28
  task_ids: number[] | null;
@@ -31,7 +31,7 @@ export interface resolveTaskPayload {
31
31
  export interface CreateReminderPayload {
32
32
  due_datetime: Date | null;
33
33
  description: string | null;
34
- assigned_to: string | null;
34
+ assigned_to: any | null;
35
35
  order_id: number | null;
36
36
  priority: number | null;
37
37
  department: string | null;
@@ -49,7 +49,7 @@ export interface SingleResolvedPayload {
49
49
  export interface UpdateReminderPayload {
50
50
  due_datetime: any | null;
51
51
  description: any | null;
52
- assigned_to: string | null;
52
+ assigned_to: any | null;
53
53
  order_id: number | null;
54
54
  priority: number | null;
55
55
  department: any | null;
@@ -11,6 +11,7 @@ import {
11
11
  useGlobalStateHitAuditLog,
12
12
  useOrderStaticData,
13
13
  useGlobalStateHitOrder,
14
+ useLiveRecalling,
14
15
  } from '../../../store';
15
16
  // import useUpdateOrder from '../../../hooks/useUpdateOrder';
16
17
  import { compareOrderDetailsStates, filterObject } from '../../../utils';
@@ -28,7 +29,7 @@ function OrderDetailsFooter() {
28
29
  const [orderStaticData] = useOrderStaticData();
29
30
  const [, setRecallOrders] = useGlobalStateHitOrder();
30
31
  const [isClientPortal] = useClientPortal();
31
-
32
+ const [, setRecalling] = useLiveRecalling();
32
33
  //update order
33
34
  const { fetchData: callUpdateOrderAPI } = useAxios<{
34
35
  data: ApiResponse[];
@@ -91,6 +92,7 @@ function OrderDetailsFooter() {
91
92
  const onSave = async () => {
92
93
  setRecallAuditLog(false);
93
94
  setRecallOrders(false);
95
+ setRecalling(false);
94
96
  const payload = compareOrderDetailsStates(prevOrderDetails, orderDetails);
95
97
  const clone = [...orderDetails?.order_services];
96
98
 
@@ -141,6 +143,10 @@ function OrderDetailsFooter() {
141
143
  [key: string]: any;
142
144
  };
143
145
  // const response = await updateOrder([payload]);
146
+ setRecalling(true);
147
+ setTimeout(() => {
148
+ setRecalling(false);
149
+ }, 2000);
144
150
  setRecallOrders(true);
145
151
  if (response.code == 200 && response?.data?.length > 0) {
146
152
  notification.success({
@@ -5,24 +5,38 @@ import OrdersSection from './orders-section';
5
5
  import InstructionSection from './instruction-section';
6
6
  import ServicesSection from './services-section';
7
7
  import OrderDetailsFooter from './footer';
8
+ import { Skeleton } from 'antd';
9
+ import { FormSection } from '@bjsdistribution/dms-component-library';
8
10
 
9
- function ExpandedContent() {
11
+ function ExpandedContent({ orderLoading, depotDataLoading }: any) {
10
12
  return (
11
- <MainContainer>
12
- <Container>
13
- <HalfWidth>
14
- <CustomerSection />
15
- </HalfWidth>
16
- <HalfWidth>
17
- <OrdersSection />
18
- </HalfWidth>
19
- <InstructionSection />
20
- </Container>
21
- {/* <InstructionContainer>
22
- </InstructionContainer> */}
23
- <ServicesSection />
24
- <OrderDetailsFooter />
25
- </MainContainer>
13
+ <>
14
+ <MainContainer>
15
+ {orderLoading || depotDataLoading ? (
16
+ <>
17
+ <CustomFormSection>
18
+ <Skeleton paragraph={{ rows: 4 }} />
19
+ <Skeleton paragraph={{ rows: 4 }} />
20
+ </CustomFormSection>
21
+ </>
22
+ ) : (
23
+ <>
24
+ <Container>
25
+ <HalfWidth>
26
+ <CustomerSection />
27
+ </HalfWidth>
28
+ <HalfWidth>
29
+ <OrdersSection />
30
+ </HalfWidth>
31
+ <InstructionSection />
32
+ </Container>
33
+
34
+ <ServicesSection />
35
+ <OrderDetailsFooter />
36
+ </>
37
+ )}
38
+ </MainContainer>
39
+ </>
26
40
  );
27
41
  }
28
42
 
@@ -86,4 +100,11 @@ const MainContainer = styled.div`
86
100
  }
87
101
  `;
88
102
 
103
+ const CustomFormSection = styled(FormSection)`
104
+ flex: 1;
105
+ border-radius: 8px;
106
+ background: #f8fafc;
107
+ box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1);
108
+ `;
109
+
89
110
  export default ExpandedContent;
@@ -30,7 +30,7 @@ const CustomFormSection = styled(FormSection)`
30
30
  border-radius: 8px;
31
31
  background: #f8fafc;
32
32
  box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1);
33
- padding: 10px !important;
33
+ padding: 24px !important;
34
34
  `;
35
35
 
36
36
  export default InstructionSection;
@@ -8,13 +8,12 @@ function ServiceLevel() {
8
8
  const [orderStaticData] = useOrderStaticData();
9
9
  const [orderData, setOrderData] = useOrderDetails();
10
10
 
11
- const serviceLevelId =
12
- orderData?.order_services_detail?.order_service_level_id;
11
+ const serviceLevelId = orderData?.order_services_detail?.order_service_level_id?.toString();
13
12
 
14
13
  const serviceLevelOptions = orderStaticData?.order_service_levels?.map(
15
14
  (option: any) => ({
16
15
  label: capitalize(option.type.replaceAll('_', ' ')),
17
- value: option.id.toString(),
16
+ value: option?.id?.toString(),
18
17
  })
19
18
  );
20
19
 
@@ -32,7 +31,7 @@ function ServiceLevel() {
32
31
  return (
33
32
  <Container disabled={isDisabled}>
34
33
  <RadioButtonGroup
35
- selectedValue={serviceLevelId?.toString() || ''}
34
+ selectedValue={serviceLevelId || ''}
36
35
  heading="Service Level"
37
36
  options={serviceLevelOptions || []}
38
37
  onChange={radioGroupHandler}
@@ -14,7 +14,7 @@ interface ApiResponse {
14
14
  setShouldPerformAction: boolean;
15
15
  }
16
16
 
17
- function OrderDetails() {
17
+ function OrderDetails({ orderLoading, depotDataLoading }: any) {
18
18
  const [orderData] = useOrderDetails();
19
19
  const customerData = orderData;
20
20
  const id = customerData?.customer_id;
@@ -44,7 +44,10 @@ function OrderDetails() {
44
44
 
45
45
  return (
46
46
  <>
47
- <ExpandedContent />
47
+ <ExpandedContent
48
+ orderLoading={orderLoading}
49
+ depotDataLoading={depotDataLoading}
50
+ />
48
51
  </>
49
52
  );
50
53
  }
@@ -6,7 +6,7 @@ import DynamicTable from '../../DynamicTable';
6
6
  import { useOrderProductsResources } from '../../store';
7
7
  import { tableColumns } from '../helper';
8
8
 
9
- function Order() {
9
+ function Order({ loading }: any) {
10
10
  const [orderResources] = useOrderProductsResources();
11
11
 
12
12
  const data =
@@ -17,7 +17,7 @@ function Order() {
17
17
  return (
18
18
  <Table>
19
19
  <CollapsableForm collapsedContent={<CollapsedContent />}>
20
- <DynamicTable columns={tableColumns} data={data} />
20
+ <DynamicTable columns={tableColumns} data={data} loading={loading} />
21
21
  </CollapsableForm>
22
22
  </Table>
23
23
  );