thm-p3-configurator 0.0.411 → 0.0.413
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/src/shared/__api__/mutations.js +18 -1
- package/dist/src/shared/__components__/internal/InternalCustomerDetailsForm.js +57 -0
- package/dist/src/shared/__containers__/AppointmentForm.js +3 -1
- package/dist/src/shared/__containers__/ExitIntentModal.js +3 -1
- package/dist/src/shared/__containers__/ProductCartSide.js +6 -5
- package/dist/src/shared/__containers__/ProductsCartOverview.js +14 -5
- package/dist/src/shared/__containers__/ProductsOverview.js +53 -16
- package/dist/src/shared/__containers__/QuotationForm.js +3 -1
- package/dist/src/shared/__containers__/StyleWrapper.js +1 -0
- package/dist/src/shared/__containers__/internal/InternalAppointmentForm.js +3 -1
- package/dist/src/shared/__containers__/internal/InternalQuotationForm.js +3 -1
- package/dist/src/shared/__context__/OrderSessionContext.js +13 -0
- package/dist/src/shared/__helpers__/dossier.js +16 -2
- package/dist/src/shared/__pages__/internal/InternalSessionEditPage.js +4 -1
- package/dist/src/shared/__style__/components/_datepicker.scss +4 -1
- package/package.json +1 -1
|
@@ -106,6 +106,7 @@ const useCreateQuotationMutation = () => {
|
|
|
106
106
|
formula,
|
|
107
107
|
discount,
|
|
108
108
|
vehicle,
|
|
109
|
+
skipFilters,
|
|
109
110
|
isExitIntent = false
|
|
110
111
|
} = _ref;
|
|
111
112
|
return _publicProxyApi.publicProxyApi.postQuotation({
|
|
@@ -118,6 +119,7 @@ const useCreateQuotationMutation = () => {
|
|
|
118
119
|
discount,
|
|
119
120
|
answers: answers,
|
|
120
121
|
cart: cart,
|
|
122
|
+
skipFilters,
|
|
121
123
|
selectBoardComputerUpdate: selectBoardComputerUpdate,
|
|
122
124
|
customer: customer,
|
|
123
125
|
branchId
|
|
@@ -149,7 +151,8 @@ const useCreateAppointmentRequestMutation = () => {
|
|
|
149
151
|
vehicle,
|
|
150
152
|
discount,
|
|
151
153
|
formula,
|
|
152
|
-
branchId
|
|
154
|
+
branchId,
|
|
155
|
+
skipFilters
|
|
153
156
|
} = _ref2;
|
|
154
157
|
return _publicProxyApi.publicProxyApi.postAppointmentRequest({
|
|
155
158
|
model,
|
|
@@ -158,6 +161,7 @@ const useCreateAppointmentRequestMutation = () => {
|
|
|
158
161
|
formula,
|
|
159
162
|
answers: answers,
|
|
160
163
|
cart: cart,
|
|
164
|
+
skipFilters,
|
|
161
165
|
selectBoardComputerUpdate: selectBoardComputerUpdate,
|
|
162
166
|
customer,
|
|
163
167
|
branchId,
|
|
@@ -297,6 +301,7 @@ const useCreatePrivateQuotationMutation = () => {
|
|
|
297
301
|
extraPrice,
|
|
298
302
|
isExitIntent = false,
|
|
299
303
|
montageRate,
|
|
304
|
+
skipFilters,
|
|
300
305
|
leasemaatschappijEntityId,
|
|
301
306
|
leasemaatschappijBedrijfsnaam,
|
|
302
307
|
leasemaatschappijContactpersoonNaam,
|
|
@@ -326,6 +331,7 @@ const useCreatePrivateQuotationMutation = () => {
|
|
|
326
331
|
extraPrice,
|
|
327
332
|
answers,
|
|
328
333
|
cart,
|
|
334
|
+
skipFilters,
|
|
329
335
|
selectBoardComputerUpdate,
|
|
330
336
|
customer: restCustomer,
|
|
331
337
|
branchId,
|
|
@@ -354,6 +360,7 @@ const useCreatePrivateQuotationMutation = () => {
|
|
|
354
360
|
extraPrice,
|
|
355
361
|
answers,
|
|
356
362
|
cart,
|
|
363
|
+
skipFilters,
|
|
357
364
|
selectBoardComputerUpdate,
|
|
358
365
|
customer: restCustomer,
|
|
359
366
|
branchId,
|
|
@@ -419,6 +426,7 @@ const useCreatePrivateAppointmentMutation = () => {
|
|
|
419
426
|
extraPrice,
|
|
420
427
|
customerAgreed,
|
|
421
428
|
montageRate,
|
|
429
|
+
skipFilters,
|
|
422
430
|
leasemaatschappijEntityId,
|
|
423
431
|
leasemaatschappijBedrijfsnaam,
|
|
424
432
|
leasemaatschappijContactpersoonNaam,
|
|
@@ -449,6 +457,7 @@ const useCreatePrivateAppointmentMutation = () => {
|
|
|
449
457
|
extraPrice,
|
|
450
458
|
answers,
|
|
451
459
|
cart,
|
|
460
|
+
skipFilters,
|
|
452
461
|
selectBoardComputerUpdate,
|
|
453
462
|
customer: restCustomer,
|
|
454
463
|
branchId,
|
|
@@ -513,6 +522,7 @@ const useCreatePrivateAppointmentRequestMutation = () => {
|
|
|
513
522
|
discount,
|
|
514
523
|
customerAgreed,
|
|
515
524
|
montageRate,
|
|
525
|
+
skipFilters,
|
|
516
526
|
leasemaatschappijEntityId,
|
|
517
527
|
leasemaatschappijBedrijfsnaam,
|
|
518
528
|
leasemaatschappijContactpersoonNaam,
|
|
@@ -541,6 +551,7 @@ const useCreatePrivateAppointmentRequestMutation = () => {
|
|
|
541
551
|
discount,
|
|
542
552
|
answers,
|
|
543
553
|
cart,
|
|
554
|
+
skipFilters,
|
|
544
555
|
selectBoardComputerUpdate,
|
|
545
556
|
customer: restCustomer,
|
|
546
557
|
branchId,
|
|
@@ -603,6 +614,7 @@ const useUpdatePrivateAppointmentRequestByIdMutation = id => {
|
|
|
603
614
|
priceCalculationDate,
|
|
604
615
|
customerAgreed,
|
|
605
616
|
montageRate,
|
|
617
|
+
skipFilters,
|
|
606
618
|
leasemaatschappijEntityId,
|
|
607
619
|
leasemaatschappijBedrijfsnaam,
|
|
608
620
|
leasemaatschappijContactpersoonNaam,
|
|
@@ -641,6 +653,7 @@ const useUpdatePrivateAppointmentRequestByIdMutation = id => {
|
|
|
641
653
|
discount,
|
|
642
654
|
answers,
|
|
643
655
|
cart,
|
|
656
|
+
skipFilters,
|
|
644
657
|
selectBoardComputerUpdate,
|
|
645
658
|
customer: restCustomer,
|
|
646
659
|
branchId,
|
|
@@ -694,6 +707,7 @@ const useUpdatePrivateQuotationByIdMutation = id => {
|
|
|
694
707
|
extraPrice,
|
|
695
708
|
priceCalculationDate,
|
|
696
709
|
montageRate,
|
|
710
|
+
skipFilters,
|
|
697
711
|
leasemaatschappijEntityId,
|
|
698
712
|
leasemaatschappijBedrijfsnaam,
|
|
699
713
|
leasemaatschappijContactpersoonNaam,
|
|
@@ -732,6 +746,7 @@ const useUpdatePrivateQuotationByIdMutation = id => {
|
|
|
732
746
|
extraPrice,
|
|
733
747
|
answers,
|
|
734
748
|
cart,
|
|
749
|
+
skipFilters,
|
|
735
750
|
selectBoardComputerUpdate,
|
|
736
751
|
customer: restCustomer,
|
|
737
752
|
branchId,
|
|
@@ -786,6 +801,7 @@ const useUpdatePrivateAppointmentByIdMutation = id => {
|
|
|
786
801
|
customerAgreed,
|
|
787
802
|
invoicePaymentByLeaseCompany,
|
|
788
803
|
montageRate,
|
|
804
|
+
skipFilters,
|
|
789
805
|
leasemaatschappijEntityId,
|
|
790
806
|
leasemaatschappijBedrijfsnaam,
|
|
791
807
|
leasemaatschappijContactpersoonNaam,
|
|
@@ -825,6 +841,7 @@ const useUpdatePrivateAppointmentByIdMutation = id => {
|
|
|
825
841
|
extraPrice,
|
|
826
842
|
answers,
|
|
827
843
|
cart,
|
|
844
|
+
skipFilters,
|
|
828
845
|
selectBoardComputerUpdate,
|
|
829
846
|
customer: _objectSpread(_objectSpread({}, restCustomer), {}, {
|
|
830
847
|
invoicePaymentByLeaseCompany
|
|
@@ -196,6 +196,55 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
196
196
|
}
|
|
197
197
|
return (0, _openingHours.copyTimeToDate)(new Date(appointment.time), new Date(appointment.date));
|
|
198
198
|
}, [(_appointment$time$get = appointment === null || appointment === void 0 || (_appointment$time = appointment.time) === null || _appointment$time === void 0 || (_appointment$time$get2 = _appointment$time.getTime) === null || _appointment$time$get2 === void 0 ? void 0 : _appointment$time$get2.call(_appointment$time)) !== null && _appointment$time$get !== void 0 ? _appointment$time$get : appointment === null || appointment === void 0 ? void 0 : appointment.time, (_appointment$date$get = appointment === null || appointment === void 0 || (_appointment$date = appointment.date) === null || _appointment$date === void 0 || (_appointment$date$get2 = _appointment$date.getTime) === null || _appointment$date$get2 === void 0 ? void 0 : _appointment$date$get2.call(_appointment$date)) !== null && _appointment$date$get !== void 0 ? _appointment$date$get : appointment === null || appointment === void 0 ? void 0 : appointment.date]);
|
|
199
|
+
const openingstijden = branchById === null || branchById === void 0 ? void 0 : branchById.openingstijden;
|
|
200
|
+
const filterAppointmentDate = (0, _react.useCallback)(date => (0, _openingHours.isAppointmentDateSelectable)(openingstijden, date), [openingstijden]);
|
|
201
|
+
const appointmentIncludeDates = (0, _react.useMemo)(() => (0, _openingHours.getAppointmentIncludeDates)(openingstijden), [openingstijden]);
|
|
202
|
+
const appointmentTimeBounds = (0, _react.useMemo)(() => appointment !== null && appointment !== void 0 && appointment.date ? (0, _openingHours.getAppointmentTimeBounds)(openingstijden, new Date(appointment.date)) : {
|
|
203
|
+
minTime: null,
|
|
204
|
+
maxTime: null
|
|
205
|
+
}, [openingstijden, appointment === null || appointment === void 0 ? void 0 : appointment.date]);
|
|
206
|
+
const isTimePickerDisabled = !(appointment !== null && appointment !== void 0 && appointment.date) || appointmentTimeBounds.minTime && appointmentTimeBounds.maxTime && appointmentTimeBounds.minTime > appointmentTimeBounds.maxTime;
|
|
207
|
+
(0, _react.useEffect)(() => {
|
|
208
|
+
if (!openingstijden) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (appointment !== null && appointment !== void 0 && appointment.date) {
|
|
212
|
+
const date = new Date(appointment.date);
|
|
213
|
+
if (!(0, _openingHours.isAppointmentDateSelectable)(openingstijden, date)) {
|
|
214
|
+
dispatch({
|
|
215
|
+
type: _OrderSessionContext.orderSessionActions.SET_APPOINTMENT_DATE,
|
|
216
|
+
payload: {
|
|
217
|
+
date: null
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
dispatch({
|
|
221
|
+
type: _OrderSessionContext.orderSessionActions.SET_APPOINTMENT_TIME,
|
|
222
|
+
payload: {
|
|
223
|
+
time: null
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
const bounds = (0, _openingHours.getAppointmentTimeBounds)(openingstijden, date);
|
|
229
|
+
if (bounds.minTime && bounds.maxTime && bounds.minTime > bounds.maxTime) {
|
|
230
|
+
dispatch({
|
|
231
|
+
type: _OrderSessionContext.orderSessionActions.SET_APPOINTMENT_TIME,
|
|
232
|
+
payload: {
|
|
233
|
+
time: null
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (appointment !== null && appointment !== void 0 && appointment.time && !(0, _openingHours.isTimeWithinBounds)(new Date(appointment.time), bounds)) {
|
|
239
|
+
dispatch({
|
|
240
|
+
type: _OrderSessionContext.orderSessionActions.SET_APPOINTMENT_TIME,
|
|
241
|
+
payload: {
|
|
242
|
+
time: null
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}, [openingstijden, appointment === null || appointment === void 0 ? void 0 : appointment.date, dispatch]);
|
|
199
248
|
const authSession = (0, _AuthSessionContext.useAuthSession)();
|
|
200
249
|
const isTmg = (0, _useIsTmg.useIsTmg)();
|
|
201
250
|
const [companySearchTerm, setCompanySearchTerm] = (0, _react.useState)('');
|
|
@@ -980,6 +1029,9 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
980
1029
|
className: (0, _helpers__.withStyle)('col-12 col-md-6')
|
|
981
1030
|
}, /*#__PURE__*/_react.default.createElement(_DatePickerInput.default, {
|
|
982
1031
|
onChange: value => {
|
|
1032
|
+
if (openingstijden && value && !(0, _openingHours.isAppointmentDateSelectable)(openingstijden, value)) {
|
|
1033
|
+
return;
|
|
1034
|
+
}
|
|
983
1035
|
dispatch({
|
|
984
1036
|
type: _OrderSessionContext.orderSessionActions.SET_APPOINTMENT_DATE,
|
|
985
1037
|
payload: {
|
|
@@ -997,6 +1049,8 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
997
1049
|
label: "Datum",
|
|
998
1050
|
initialValue: appointment !== null && appointment !== void 0 && appointment.date ? new Date(appointment === null || appointment === void 0 ? void 0 : appointment.date) : null,
|
|
999
1051
|
isStrict: false,
|
|
1052
|
+
filterDate: filterAppointmentDate,
|
|
1053
|
+
includeDates: appointmentIncludeDates,
|
|
1000
1054
|
errorMessage: errors === null || errors === void 0 ? void 0 : errors['date']
|
|
1001
1055
|
}), /*#__PURE__*/_react.default.createElement(_TimePickerInput.default, {
|
|
1002
1056
|
key: "appointment-time-".concat((_ref5 = (_appointment$date$get3 = appointment === null || appointment === void 0 || (_appointment$date2 = appointment.date) === null || _appointment$date2 === void 0 || (_appointment$date2$ge = _appointment$date2.getTime) === null || _appointment$date2$ge === void 0 ? void 0 : _appointment$date2$ge.call(_appointment$date2)) !== null && _appointment$date$get3 !== void 0 ? _appointment$date$get3 : appointment === null || appointment === void 0 ? void 0 : appointment.date) !== null && _ref5 !== void 0 ? _ref5 : 'none'),
|
|
@@ -1011,6 +1065,9 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
1011
1065
|
name: 'Tijd',
|
|
1012
1066
|
label: "Tijd",
|
|
1013
1067
|
isStrict: false,
|
|
1068
|
+
isDisabled: isTimePickerDisabled,
|
|
1069
|
+
minTime: appointmentTimeBounds.minTime,
|
|
1070
|
+
maxTime: appointmentTimeBounds.maxTime,
|
|
1014
1071
|
errorMessage: errors === null || errors === void 0 ? void 0 : errors['time']
|
|
1015
1072
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
1016
1073
|
className: (0, _helpers__.withStyle)('col-12 col-md-6')
|
|
@@ -159,7 +159,8 @@ const AppointmentForm = () => {
|
|
|
159
159
|
priceCalculationDate,
|
|
160
160
|
selectedDiscountedProducts = [],
|
|
161
161
|
selectedExtras,
|
|
162
|
-
vehicleCodingDiscountPercentage
|
|
162
|
+
vehicleCodingDiscountPercentage,
|
|
163
|
+
skipFilters
|
|
163
164
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
164
165
|
const [errors, setErrors] = (0, _react.useState)({});
|
|
165
166
|
const [isTermsAccepted, setIsTermsAccepted] = (0, _react.useState)(false);
|
|
@@ -212,6 +213,7 @@ const AppointmentForm = () => {
|
|
|
212
213
|
formula,
|
|
213
214
|
branchId: selectedBranch,
|
|
214
215
|
selectBoardComputerUpdate: selectedBoardComputer != null,
|
|
216
|
+
skipFilters,
|
|
215
217
|
discount: (() => {
|
|
216
218
|
if (!(discountCode !== null && discountCode !== void 0 && discountCode.length)) return null;
|
|
217
219
|
if (discountCode.toLocaleLowerCase().includes('anwb') && !anwbDiscountValidated) return null;
|
|
@@ -146,7 +146,8 @@ const ExitIntentModal = () => {
|
|
|
146
146
|
priceCalculationDate,
|
|
147
147
|
selectedDiscountedProducts = [],
|
|
148
148
|
selectedExtras,
|
|
149
|
-
vehicleCodingDiscountPercentage
|
|
149
|
+
vehicleCodingDiscountPercentage,
|
|
150
|
+
skipFilters
|
|
150
151
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
151
152
|
const formula = (0, _FormulaContext.useFormula)();
|
|
152
153
|
const isTowmotive = (0, _useIsTowmotive.useIsTowmotive)();
|
|
@@ -229,6 +230,7 @@ const ExitIntentModal = () => {
|
|
|
229
230
|
})),
|
|
230
231
|
branchId: selectedBranch,
|
|
231
232
|
selectBoardComputerUpdate: selectedBoardComputer != null,
|
|
233
|
+
skipFilters,
|
|
232
234
|
cart: (0, _product.buildCartInput)({
|
|
233
235
|
selectedCableset,
|
|
234
236
|
selectedCombiset,
|
|
@@ -94,6 +94,7 @@ const ProductCartSide = () => {
|
|
|
94
94
|
selectedCombiset,
|
|
95
95
|
selectedBoardComputer,
|
|
96
96
|
allArticleNumbers,
|
|
97
|
+
existingDossierId,
|
|
97
98
|
selectedExtras,
|
|
98
99
|
canAlterQuantity,
|
|
99
100
|
selectedBranch,
|
|
@@ -121,7 +122,7 @@ const ProductCartSide = () => {
|
|
|
121
122
|
consumerDiscounts,
|
|
122
123
|
touchedConsumerDiscounts
|
|
123
124
|
});
|
|
124
|
-
const shouldRequestUnfilteredProducts = (0, _product.shouldRequestUnfilteredProductsForCart)(cartInput);
|
|
125
|
+
const shouldRequestUnfilteredProducts = (0, _product.shouldRequestUnfilteredProductsForCart)(cartInput) || Boolean(existingDossierId && (allArticleNumbers === null || allArticleNumbers === void 0 ? void 0 : allArticleNumbers.length) > 0);
|
|
125
126
|
const {
|
|
126
127
|
cart,
|
|
127
128
|
totals,
|
|
@@ -158,10 +159,10 @@ const ProductCartSide = () => {
|
|
|
158
159
|
let mainProducts = [];
|
|
159
160
|
let accessoireProducts = [];
|
|
160
161
|
if (products) {
|
|
161
|
-
var _products$Trekhaak, _products$Combiset, _products$Kabelset, _products$Elektronica, _products$Extras;
|
|
162
|
-
const towbar = selectedTowbar && ((_products$Trekhaak = products.Trekhaak) === null || _products$Trekhaak === void 0 ? void 0 : _products$Trekhaak.find(product => product.articleNumber === selectedTowbar)) || null;
|
|
163
|
-
const combiset = selectedCombiset && ((_products$Combiset = products.Combiset) === null || _products$Combiset === void 0 ? void 0 : _products$Combiset.find(product => product.articleNumber === selectedCombiset)) || null;
|
|
164
|
-
const cableset = selectedCableset && ((_products$Kabelset = products.Kabelset) === null || _products$Kabelset === void 0 ? void 0 : _products$Kabelset.find(product => product.articleNumber === selectedCableset)) || null;
|
|
162
|
+
var _products$Trekhaak, _products$Trekhaak$fi, _products$Trekhaak2, _products$Combiset, _products$Combiset$fi, _products$Combiset2, _products$Kabelset, _products$Kabelset$fi, _products$Kabelset2, _products$Elektronica, _products$Extras;
|
|
163
|
+
const towbar = selectedTowbar && ((_products$Trekhaak = products.Trekhaak) === null || _products$Trekhaak === void 0 ? void 0 : _products$Trekhaak.find(product => product.articleNumber === selectedTowbar)) || (existingDossierId ? (_products$Trekhaak$fi = (_products$Trekhaak2 = products.Trekhaak) === null || _products$Trekhaak2 === void 0 ? void 0 : _products$Trekhaak2.find(product => allArticleNumbers === null || allArticleNumbers === void 0 ? void 0 : allArticleNumbers.includes(product.articleNumber))) !== null && _products$Trekhaak$fi !== void 0 ? _products$Trekhaak$fi : null : null);
|
|
164
|
+
const combiset = selectedCombiset && ((_products$Combiset = products.Combiset) === null || _products$Combiset === void 0 ? void 0 : _products$Combiset.find(product => product.articleNumber === selectedCombiset)) || (existingDossierId ? (_products$Combiset$fi = (_products$Combiset2 = products.Combiset) === null || _products$Combiset2 === void 0 ? void 0 : _products$Combiset2.find(product => allArticleNumbers === null || allArticleNumbers === void 0 ? void 0 : allArticleNumbers.includes(product.articleNumber))) !== null && _products$Combiset$fi !== void 0 ? _products$Combiset$fi : null : null);
|
|
165
|
+
const cableset = selectedCableset && ((_products$Kabelset = products.Kabelset) === null || _products$Kabelset === void 0 ? void 0 : _products$Kabelset.find(product => product.articleNumber === selectedCableset)) || (existingDossierId ? (_products$Kabelset$fi = (_products$Kabelset2 = products.Kabelset) === null || _products$Kabelset2 === void 0 ? void 0 : _products$Kabelset2.find(product => allArticleNumbers === null || allArticleNumbers === void 0 ? void 0 : allArticleNumbers.includes(product.articleNumber))) !== null && _products$Kabelset$fi !== void 0 ? _products$Kabelset$fi : null : null);
|
|
165
166
|
const boardComputer = selectedBoardComputer && ((_products$Elektronica = products['Elektronica boordcomputer updaten']) === null || _products$Elektronica === void 0 ? void 0 : _products$Elektronica.find(product => product.articleNumber === selectedBoardComputer)) || null;
|
|
166
167
|
const extras = Object.keys(selectedExtras);
|
|
167
168
|
mainProducts = [towbar, combiset, cableset, boardComputer].filter(Boolean);
|
|
@@ -266,6 +266,7 @@ const ProductCartTable = () => {
|
|
|
266
266
|
selectedExtras,
|
|
267
267
|
executionAnswer1,
|
|
268
268
|
allArticleNumbers,
|
|
269
|
+
existingDossierId,
|
|
269
270
|
canAlterQuantity,
|
|
270
271
|
executionAnswer2,
|
|
271
272
|
discountAmount,
|
|
@@ -347,7 +348,10 @@ const ProductCartTable = () => {
|
|
|
347
348
|
consumerDiscounts,
|
|
348
349
|
touchedConsumerDiscounts
|
|
349
350
|
});
|
|
350
|
-
|
|
351
|
+
// Also request unfiltered products when editing an existing dossier with
|
|
352
|
+
// article numbers that could not be classified into selectedTowbar etc. during
|
|
353
|
+
// hydration (e.g. formula-specific articles not in the TM catalogue).
|
|
354
|
+
const shouldRequestUnfilteredProducts = (0, _product.shouldRequestUnfilteredProductsForCart)(cartInput) || Boolean(existingDossierId && (allArticleNumbers === null || allArticleNumbers === void 0 ? void 0 : allArticleNumbers.length) > 0);
|
|
351
355
|
const durationAnswerForQuery = durationAnswerIsPrefilled ? undefined : durationAnswer;
|
|
352
356
|
const {
|
|
353
357
|
cart,
|
|
@@ -472,14 +476,19 @@ const ProductCartTable = () => {
|
|
|
472
476
|
mainProducts,
|
|
473
477
|
accessoireProducts
|
|
474
478
|
} = (0, _react.useMemo)(() => {
|
|
475
|
-
var _products$Trekhaak, _products$Combiset, _products$Kabelset, _products$Elektronica, _products$Extras;
|
|
479
|
+
var _products$Trekhaak, _products$Trekhaak$fi, _products$Trekhaak2, _products$Combiset, _products$Combiset$fi, _products$Combiset2, _products$Kabelset, _products$Kabelset$fi, _products$Kabelset2, _products$Elektronica, _products$Extras;
|
|
476
480
|
if (!products) return {
|
|
477
481
|
mainProducts: [],
|
|
478
482
|
accessoireProducts: []
|
|
479
483
|
};
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
484
|
+
|
|
485
|
+
// When selectedTowbar/Cableset/Combiset is null (hydration failed to classify
|
|
486
|
+
// the article, e.g. a non-standard towbar not in the formula catalogue),
|
|
487
|
+
// fall back to finding the article by matching allArticleNumbers against the
|
|
488
|
+
// product category returned by Hyper (possible because skipFilters=true above).
|
|
489
|
+
const towbar = selectedTowbar ? (_products$Trekhaak = products.Trekhaak) === null || _products$Trekhaak === void 0 ? void 0 : _products$Trekhaak.find(p => p.articleNumber === selectedTowbar) : existingDossierId ? (_products$Trekhaak$fi = (_products$Trekhaak2 = products.Trekhaak) === null || _products$Trekhaak2 === void 0 ? void 0 : _products$Trekhaak2.find(p => allArticleNumbers === null || allArticleNumbers === void 0 ? void 0 : allArticleNumbers.includes(p.articleNumber))) !== null && _products$Trekhaak$fi !== void 0 ? _products$Trekhaak$fi : null : null;
|
|
490
|
+
const combiset = selectedCombiset ? (_products$Combiset = products.Combiset) === null || _products$Combiset === void 0 ? void 0 : _products$Combiset.find(p => p.articleNumber === selectedCombiset) : existingDossierId ? (_products$Combiset$fi = (_products$Combiset2 = products.Combiset) === null || _products$Combiset2 === void 0 ? void 0 : _products$Combiset2.find(p => allArticleNumbers === null || allArticleNumbers === void 0 ? void 0 : allArticleNumbers.includes(p.articleNumber))) !== null && _products$Combiset$fi !== void 0 ? _products$Combiset$fi : null : null;
|
|
491
|
+
const cableset = selectedCableset ? (_products$Kabelset = products.Kabelset) === null || _products$Kabelset === void 0 ? void 0 : _products$Kabelset.find(p => p.articleNumber === selectedCableset) : existingDossierId ? (_products$Kabelset$fi = (_products$Kabelset2 = products.Kabelset) === null || _products$Kabelset2 === void 0 ? void 0 : _products$Kabelset2.find(p => allArticleNumbers === null || allArticleNumbers === void 0 ? void 0 : allArticleNumbers.includes(p.articleNumber))) !== null && _products$Kabelset$fi !== void 0 ? _products$Kabelset$fi : null : null;
|
|
483
492
|
const boardComputer = selectedBoardComputer ? (_products$Elektronica = products['Elektronica boordcomputer updaten']) === null || _products$Elektronica === void 0 ? void 0 : _products$Elektronica.find(p => p.articleNumber === selectedBoardComputer) : null;
|
|
484
493
|
const rawMainProducts = [towbar, combiset, cableset, boardComputer].filter(Boolean);
|
|
485
494
|
const extras = Object.keys(selectedExtras);
|
|
@@ -7,6 +7,7 @@ require("core-js/modules/es.weak-map.js");
|
|
|
7
7
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
8
8
|
require("core-js/modules/esnext.iterator.find.js");
|
|
9
9
|
require("core-js/modules/esnext.iterator.map.js");
|
|
10
|
+
require("core-js/modules/esnext.iterator.some.js");
|
|
10
11
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
12
|
require("core-js/modules/es.weak-map.js");
|
|
12
13
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -19,6 +20,7 @@ require("core-js/modules/es.json.stringify.js");
|
|
|
19
20
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
20
21
|
require("core-js/modules/esnext.iterator.find.js");
|
|
21
22
|
require("core-js/modules/esnext.iterator.map.js");
|
|
23
|
+
require("core-js/modules/esnext.iterator.some.js");
|
|
22
24
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
23
25
|
var _react = _interopRequireWildcard(require("react"));
|
|
24
26
|
var _reactRouter = require("react-router");
|
|
@@ -69,11 +71,10 @@ function _interopRequireWildcard(e, r) {
|
|
|
69
71
|
return n.default = e, t && t.set(e, n), n;
|
|
70
72
|
}
|
|
71
73
|
const ProductsOverview = () => {
|
|
72
|
-
var _products$
|
|
74
|
+
var _products$Trekhaak4, _products$Kabelset, _products$Combiset;
|
|
73
75
|
const isProductsInitialLoad = (0, _react.useRef)(true);
|
|
74
76
|
const formula = (0, _FormulaContext.useFormula)();
|
|
75
77
|
const isTmg = (0, _useIsTmg.useIsTmg)();
|
|
76
|
-
const [skipFilters, setSkipFilters] = (0, _react.useState)(false);
|
|
77
78
|
const [{
|
|
78
79
|
licensePlate,
|
|
79
80
|
model,
|
|
@@ -96,7 +97,9 @@ const ProductsOverview = () => {
|
|
|
96
97
|
discountAmount,
|
|
97
98
|
discountPercentage,
|
|
98
99
|
montageRate,
|
|
99
|
-
extraPriceAmount
|
|
100
|
+
extraPriceAmount,
|
|
101
|
+
existingDossierId,
|
|
102
|
+
skipFilters
|
|
100
103
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
101
104
|
const isTowmotive = (0, _useIsTowmotive.useIsTowmotive)();
|
|
102
105
|
const durationAnswerForQuery = durationAnswerIsPrefilled ? undefined : durationAnswer;
|
|
@@ -134,11 +137,40 @@ const ProductsOverview = () => {
|
|
|
134
137
|
montageRate: (0, _montageRate.toApiMontageRate)(montageRate),
|
|
135
138
|
extraPriceAmount
|
|
136
139
|
});
|
|
140
|
+
|
|
141
|
+
// When a saved or newly selected article was only available via "Toon alle
|
|
142
|
+
// artikelen", the standard filtered product list won't contain it. Detect this
|
|
143
|
+
// mismatch and auto-enable skipFilters so the article is rendered and submitted
|
|
144
|
+
// with the cart.
|
|
137
145
|
(0, _react.useEffect)(() => {
|
|
138
|
-
var _products$Trekhaak, _products$
|
|
146
|
+
var _products$Trekhaak, _products$PRODUCT_CAT, _products$PRODUCT_CAT2;
|
|
147
|
+
if (isLoadingProducts || skipFilters) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
const towbarMissing = selectedTowbar && (products === null || products === void 0 || (_products$Trekhaak = products.Trekhaak) === null || _products$Trekhaak === void 0 ? void 0 : _products$Trekhaak.length) > 0 && !products.Trekhaak.some(p => p.articleNumber === selectedTowbar);
|
|
151
|
+
const cablesetMissing = selectedCableset && (products === null || products === void 0 || (_products$PRODUCT_CAT = products[_constants__.PRODUCT_CATEGORIES.CABLESET]) === null || _products$PRODUCT_CAT === void 0 ? void 0 : _products$PRODUCT_CAT.length) > 0 && !products[_constants__.PRODUCT_CATEGORIES.CABLESET].some(p => p.articleNumber === selectedCableset);
|
|
152
|
+
const combisetMissing = selectedCombiset && (products === null || products === void 0 || (_products$PRODUCT_CAT2 = products[_constants__.PRODUCT_CATEGORIES.COMBISET]) === null || _products$PRODUCT_CAT2 === void 0 ? void 0 : _products$PRODUCT_CAT2.length) > 0 && !products[_constants__.PRODUCT_CATEGORIES.COMBISET].some(p => p.articleNumber === selectedCombiset);
|
|
153
|
+
if (towbarMissing || cablesetMissing || combisetMissing) {
|
|
154
|
+
dispatch({
|
|
155
|
+
type: _OrderSessionContext.orderSessionActions.SET_SKIP_FILTERS,
|
|
156
|
+
payload: {
|
|
157
|
+
skipFilters: true
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}, [isLoadingProducts, skipFilters, products, selectedTowbar, selectedCableset, selectedCombiset, dispatch]);
|
|
162
|
+
(0, _react.useEffect)(() => {
|
|
163
|
+
var _products$Trekhaak2, _products$Trekhaak3, _products$PRODUCT_CAT5;
|
|
164
|
+
// When editing an existing dossier, the saved selection from the cart is the
|
|
165
|
+
// source of truth. Skip auto-selection entirely so we never overwrite it with
|
|
166
|
+
// the default recommended towbar.
|
|
167
|
+
if (existingDossierId) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
|
|
139
171
|
// Only run this if we have products loaded and no towbar is currently selected
|
|
140
|
-
if (!isLoadingProducts && (products === null || products === void 0 || (_products$
|
|
141
|
-
var _products$
|
|
172
|
+
if (!isLoadingProducts && (products === null || products === void 0 || (_products$Trekhaak2 = products.Trekhaak) === null || _products$Trekhaak2 === void 0 ? void 0 : _products$Trekhaak2.length) === 1 && !selectedTowbar && !selectedCombiset) {
|
|
173
|
+
var _products$PRODUCT_CAT3;
|
|
142
174
|
const towbarId = products.Trekhaak[0].articleNumber;
|
|
143
175
|
dispatch({
|
|
144
176
|
type: _OrderSessionContext.orderSessionActions.SET_SELECTED_TOWBAR,
|
|
@@ -148,7 +180,7 @@ const ProductsOverview = () => {
|
|
|
148
180
|
});
|
|
149
181
|
|
|
150
182
|
// Auto-select kabelset if there's exactly one kabelset available (reusing existing logic)
|
|
151
|
-
if (!selectedCableset && ((_products$
|
|
183
|
+
if (!selectedCableset && ((_products$PRODUCT_CAT3 = products[_constants__.PRODUCT_CATEGORIES.CABLESET]) === null || _products$PRODUCT_CAT3 === void 0 ? void 0 : _products$PRODUCT_CAT3.length) === 1) {
|
|
152
184
|
const kabelsetId = products[_constants__.PRODUCT_CATEGORIES.CABLESET][0].articleNumber;
|
|
153
185
|
dispatch({
|
|
154
186
|
type: _OrderSessionContext.orderSessionActions.SET_SELECTED_CABLESET,
|
|
@@ -159,7 +191,7 @@ const ProductsOverview = () => {
|
|
|
159
191
|
}
|
|
160
192
|
}
|
|
161
193
|
// If we have multiple towbars, pre-select the recommended one if no other is selected
|
|
162
|
-
else if (!isLoadingProducts && (products === null || products === void 0 || (_products$
|
|
194
|
+
else if (!isLoadingProducts && (products === null || products === void 0 || (_products$Trekhaak3 = products.Trekhaak) === null || _products$Trekhaak3 === void 0 ? void 0 : _products$Trekhaak3.length) > 1 && !selectedTowbar && !selectedCombiset) {
|
|
163
195
|
// Find the recommended towbar
|
|
164
196
|
const recommendedTowbar = products.Trekhaak.find(product => (0, _product.checkIfTowbarIsRecommended)({
|
|
165
197
|
product,
|
|
@@ -168,7 +200,7 @@ const ProductsOverview = () => {
|
|
|
168
200
|
|
|
169
201
|
// If there's a recommended towbar, select it
|
|
170
202
|
if (recommendedTowbar) {
|
|
171
|
-
var _products$
|
|
203
|
+
var _products$PRODUCT_CAT4;
|
|
172
204
|
dispatch({
|
|
173
205
|
type: _OrderSessionContext.orderSessionActions.SET_SELECTED_TOWBAR,
|
|
174
206
|
payload: {
|
|
@@ -177,7 +209,7 @@ const ProductsOverview = () => {
|
|
|
177
209
|
});
|
|
178
210
|
|
|
179
211
|
// Auto-select kabelset if no kabelset is currently selected
|
|
180
|
-
if (!selectedCableset && ((_products$
|
|
212
|
+
if (!selectedCableset && ((_products$PRODUCT_CAT4 = products[_constants__.PRODUCT_CATEGORIES.CABLESET]) === null || _products$PRODUCT_CAT4 === void 0 ? void 0 : _products$PRODUCT_CAT4.length) === 1) {
|
|
181
213
|
const kabelsetId = products[_constants__.PRODUCT_CATEGORIES.CABLESET][0].articleNumber;
|
|
182
214
|
dispatch({
|
|
183
215
|
type: _OrderSessionContext.orderSessionActions.SET_SELECTED_CABLESET,
|
|
@@ -190,7 +222,7 @@ const ProductsOverview = () => {
|
|
|
190
222
|
}
|
|
191
223
|
|
|
192
224
|
// Auto-select boardcomputer if one is available and none is currently selected
|
|
193
|
-
if (!isLoadingProducts && (products === null || products === void 0 || (_products$
|
|
225
|
+
if (!isLoadingProducts && (products === null || products === void 0 || (_products$PRODUCT_CAT5 = products[_constants__.PRODUCT_CATEGORIES.BOARD_COMPUTER]) === null || _products$PRODUCT_CAT5 === void 0 ? void 0 : _products$PRODUCT_CAT5.length) > 0 && !selectedBoardComputer && !isBoardComputerDeselected) {
|
|
194
226
|
const boardComputerId = products[_constants__.PRODUCT_CATEGORIES.BOARD_COMPUTER][0].articleNumber;
|
|
195
227
|
dispatch({
|
|
196
228
|
type: _OrderSessionContext.orderSessionActions.SET_SELECTED_BOARDCOMPUTER,
|
|
@@ -199,8 +231,8 @@ const ProductsOverview = () => {
|
|
|
199
231
|
}
|
|
200
232
|
});
|
|
201
233
|
}
|
|
202
|
-
}, [isLoadingProducts, products, selectedTowbar, selectedCableset, selectedBoardComputer, isBoardComputerDeselected, dispatch]);
|
|
203
|
-
if (isProductsError || !isLoadingProducts && (!(products !== null && products !== void 0 && (_products$
|
|
234
|
+
}, [isLoadingProducts, products, selectedTowbar, selectedCableset, selectedBoardComputer, isBoardComputerDeselected, existingDossierId, dispatch]);
|
|
235
|
+
if (isProductsError || !isLoadingProducts && (!(products !== null && products !== void 0 && (_products$Trekhaak4 = products.Trekhaak) !== null && _products$Trekhaak4 !== void 0 && _products$Trekhaak4.length) || !(products !== null && products !== void 0 && (_products$Kabelset = products.Kabelset) !== null && _products$Kabelset !== void 0 && _products$Kabelset.length)) && !(products !== null && products !== void 0 && (_products$Combiset = products.Combiset) !== null && _products$Combiset !== void 0 && _products$Combiset.length)) {
|
|
204
236
|
return /*#__PURE__*/_react.default.createElement(_reactRouter.Redirect, {
|
|
205
237
|
to: "/configurator/geen-producten"
|
|
206
238
|
});
|
|
@@ -243,9 +275,9 @@ const ProductsOverview = () => {
|
|
|
243
275
|
|
|
244
276
|
// Auto-select kabelset if towbar is selected and no kabelset is currently selected
|
|
245
277
|
if (isSelected && !selectedCableset) {
|
|
246
|
-
var _products$
|
|
278
|
+
var _products$PRODUCT_CAT6;
|
|
247
279
|
// Check if there's exactly one kabelset available
|
|
248
|
-
if (((_products$
|
|
280
|
+
if (((_products$PRODUCT_CAT6 = products[_constants__.PRODUCT_CATEGORIES.CABLESET]) === null || _products$PRODUCT_CAT6 === void 0 ? void 0 : _products$PRODUCT_CAT6.length) === 1) {
|
|
249
281
|
const kabelsetId = products[_constants__.PRODUCT_CATEGORIES.CABLESET][0].articleNumber;
|
|
250
282
|
dispatch({
|
|
251
283
|
type: _OrderSessionContext.orderSessionActions.SET_SELECTED_CABLESET,
|
|
@@ -328,7 +360,12 @@ const ProductsOverview = () => {
|
|
|
328
360
|
name: 'skipFilters',
|
|
329
361
|
initialValue: skipFilters,
|
|
330
362
|
onChange: value => {
|
|
331
|
-
|
|
363
|
+
dispatch({
|
|
364
|
+
type: _OrderSessionContext.orderSessionActions.SET_SKIP_FILTERS,
|
|
365
|
+
payload: {
|
|
366
|
+
skipFilters: value
|
|
367
|
+
}
|
|
368
|
+
});
|
|
332
369
|
},
|
|
333
370
|
label: "Toon alle artikelen"
|
|
334
371
|
}), isLoadingProducts && isProductsInitialLoad.current === true ? /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -150,7 +150,8 @@ const QuotationForm = () => {
|
|
|
150
150
|
discountCode,
|
|
151
151
|
selectedDiscountedProducts = [],
|
|
152
152
|
selectedExtras,
|
|
153
|
-
vehicleCodingDiscountPercentage
|
|
153
|
+
vehicleCodingDiscountPercentage,
|
|
154
|
+
skipFilters
|
|
154
155
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
155
156
|
const [errors, setErrors] = (0, _react.useState)({});
|
|
156
157
|
const [isTermsAccepted, setIsTermsAccepted] = (0, _react.useState)(false);
|
|
@@ -214,6 +215,7 @@ const QuotationForm = () => {
|
|
|
214
215
|
customer: (0, _helpers__.removeNullishProps)(customer),
|
|
215
216
|
branchId: selectedBranch,
|
|
216
217
|
selectBoardComputerUpdate: selectedBoardComputer != null,
|
|
218
|
+
skipFilters,
|
|
217
219
|
cart: (0, _product.buildCartInput)({
|
|
218
220
|
selectedCableset,
|
|
219
221
|
selectedCombiset,
|
|
@@ -10,6 +10,7 @@ exports.default = void 0;
|
|
|
10
10
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _reactRouter = require("react-router");
|
|
13
|
+
require("react-datepicker/src/stylesheets/datepicker-cssmodules.scss");
|
|
13
14
|
var _ThemeContext = require("../__context__/ThemeContext");
|
|
14
15
|
var _helpers__ = require("../__helpers__");
|
|
15
16
|
var _useBranchTheme = require("../__hooks__/useBranchTheme");
|
|
@@ -273,7 +273,8 @@ const InternalAppointmentForm = _ref => {
|
|
|
273
273
|
isTowCenterBranch,
|
|
274
274
|
extraPriceAmount,
|
|
275
275
|
extraPriceDescription,
|
|
276
|
-
orderProcessingNote
|
|
276
|
+
orderProcessingNote,
|
|
277
|
+
skipFilters
|
|
277
278
|
} = order;
|
|
278
279
|
|
|
279
280
|
// Track the original ownership type from context
|
|
@@ -671,6 +672,7 @@ const InternalAppointmentForm = _ref => {
|
|
|
671
672
|
}), {}, {
|
|
672
673
|
branchId: selectedBranch,
|
|
673
674
|
selectBoardComputerUpdate: selectedBoardComputer != null,
|
|
675
|
+
skipFilters,
|
|
674
676
|
cart: (0, _product.buildCartInput)({
|
|
675
677
|
selectedCableset,
|
|
676
678
|
selectedCombiset,
|
|
@@ -243,7 +243,8 @@ const InternalQuotationForm = _ref => {
|
|
|
243
243
|
montageRate,
|
|
244
244
|
isTowCenterBranch,
|
|
245
245
|
extraPriceAmount,
|
|
246
|
-
extraPriceDescription
|
|
246
|
+
extraPriceDescription,
|
|
247
|
+
skipFilters
|
|
247
248
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
248
249
|
const [errors, setErrors] = (0, _react.useState)({});
|
|
249
250
|
const [companySearchTerm, setCompanySearchTerm] = (0, _react.useState)('');
|
|
@@ -579,6 +580,7 @@ const InternalQuotationForm = _ref => {
|
|
|
579
580
|
}), {}, {
|
|
580
581
|
branchId: selectedBranch,
|
|
581
582
|
selectBoardComputerUpdate: selectedBoardComputer != null,
|
|
583
|
+
skipFilters,
|
|
582
584
|
cart: (0, _product.buildCartInput)({
|
|
583
585
|
selectedCableset,
|
|
584
586
|
selectedCombiset,
|
|
@@ -137,6 +137,7 @@ const INITIAL_ORDER_SESSION_STATE = {
|
|
|
137
137
|
selectedTowbar: null,
|
|
138
138
|
selectedCableset: null,
|
|
139
139
|
selectedCombiset: null,
|
|
140
|
+
skipFilters: false,
|
|
140
141
|
leaseNumberUnknown: true,
|
|
141
142
|
selectedDiscountedProducts: [],
|
|
142
143
|
discountsInitialized: false,
|
|
@@ -235,6 +236,7 @@ const orderSessionActions = exports.orderSessionActions = {
|
|
|
235
236
|
SET_SELECTED_TOWBAR: 'SET_SELECTED_TOWBAR',
|
|
236
237
|
SET_SELECTED_CABLESET: 'SET_SELECTED_CABLESET',
|
|
237
238
|
SET_SELECTED_COMBISET: 'SET_SELECTED_COMBISET',
|
|
239
|
+
SET_SKIP_FILTERS: 'SET_SKIP_FILTERS',
|
|
238
240
|
ADD_DISCOUNTED_PRODUCT: 'ADD_DISCOUNTED_PRODUCT',
|
|
239
241
|
DISCOUNTS_INITIALIZED: 'DISCOUNTS_INITIALIZED',
|
|
240
242
|
RESET_SINGLE_ORDER: 'RESET_SINGLE_ORDER',
|
|
@@ -334,6 +336,7 @@ const orderSessionReducer = (state, action) => {
|
|
|
334
336
|
selectedTowbar: null,
|
|
335
337
|
selectedCableset: null,
|
|
336
338
|
selectedCombiset: null,
|
|
339
|
+
skipFilters: false,
|
|
337
340
|
selectedDiscountedProducts: [],
|
|
338
341
|
selectedBoardComputer: null,
|
|
339
342
|
isBoardComputerDeselected: false,
|
|
@@ -554,6 +557,16 @@ const orderSessionReducer = (state, action) => {
|
|
|
554
557
|
selectedCableset: null
|
|
555
558
|
});
|
|
556
559
|
}
|
|
560
|
+
case orderSessionActions.SET_SKIP_FILTERS:
|
|
561
|
+
{
|
|
562
|
+
const {
|
|
563
|
+
skipFilters
|
|
564
|
+
} = action.payload;
|
|
565
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
566
|
+
skipFilters,
|
|
567
|
+
isTouched: true
|
|
568
|
+
});
|
|
569
|
+
}
|
|
557
570
|
case orderSessionActions.ADD_EXTRA:
|
|
558
571
|
{
|
|
559
572
|
const {
|
|
@@ -219,6 +219,12 @@ const parseDossierToOrderSession = exports.parseDossierToOrderSession = function
|
|
|
219
219
|
extraPriceDescription: (_meerprijsLine$extraN = meerprijsLine === null || meerprijsLine === void 0 ? void 0 : meerprijsLine.extraNote) !== null && _meerprijsLine$extraN !== void 0 ? _meerprijsLine$extraN : null
|
|
220
220
|
};
|
|
221
221
|
};
|
|
222
|
+
const PSEUDO_ORDER_LINE_ARTICLES = new Set(['MC', 'Montage', 'MEERPRIJS']);
|
|
223
|
+
const isVoertuigcoderingDossierLine = function isVoertuigcoderingDossierLine() {
|
|
224
|
+
var _line$name3, _line$groupName, _line$subgroupName;
|
|
225
|
+
let line = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
226
|
+
return (line === null || line === void 0 || (_line$name3 = line.name) === null || _line$name3 === void 0 ? void 0 : _line$name3.includes('Voertuigcodering')) || (line === null || line === void 0 || (_line$groupName = line.groupName) === null || _line$groupName === void 0 ? void 0 : _line$groupName.includes('Voertuigcodering')) || (line === null || line === void 0 || (_line$subgroupName = line.subgroupName) === null || _line$subgroupName === void 0 ? void 0 : _line$subgroupName.includes('Voertuigcodering'));
|
|
227
|
+
};
|
|
222
228
|
|
|
223
229
|
/**
|
|
224
230
|
* @description Categorizes the selected lines from a dossier `dossier.line`, using the order API `articles` field
|
|
@@ -249,9 +255,17 @@ const extractSessionProductsByOrder = _ref11 => {
|
|
|
249
255
|
const touchedConsumerDiscounts = hasLineDiscount ? _objectSpread(_objectSpread({}, acc.touchedConsumerDiscounts), {}, {
|
|
250
256
|
[lineItem.articleNumber]: true
|
|
251
257
|
}) : acc.touchedConsumerDiscounts;
|
|
252
|
-
if ((lineItem === null || lineItem === void 0 ? void 0 : lineItem.articleNumber)
|
|
258
|
+
if (PSEUDO_ORDER_LINE_ARTICLES.has(lineItem === null || lineItem === void 0 ? void 0 : lineItem.articleNumber)) {
|
|
259
|
+
return _objectSpread(_objectSpread({}, acc), {}, {
|
|
260
|
+
allArticleNumbers,
|
|
261
|
+
consumerDiscounts,
|
|
262
|
+
touchedConsumerDiscounts
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
if ((lineItem === null || lineItem === void 0 ? void 0 : lineItem.articleNumber) === (boardComputerUpdate === null || boardComputerUpdate === void 0 ? void 0 : boardComputerUpdate.articleNumber) || isVoertuigcoderingDossierLine(lineItem)) {
|
|
266
|
+
var _boardComputerUpdate$;
|
|
253
267
|
return _objectSpread(_objectSpread({}, acc), {}, {
|
|
254
|
-
selectedBoardComputer: lineItem === null || lineItem === void 0 ? void 0 : lineItem.articleNumber,
|
|
268
|
+
selectedBoardComputer: (_boardComputerUpdate$ = boardComputerUpdate === null || boardComputerUpdate === void 0 ? void 0 : boardComputerUpdate.articleNumber) !== null && _boardComputerUpdate$ !== void 0 ? _boardComputerUpdate$ : lineItem === null || lineItem === void 0 ? void 0 : lineItem.articleNumber,
|
|
255
269
|
allArticleNumbers,
|
|
256
270
|
consumerDiscounts,
|
|
257
271
|
touchedConsumerDiscounts
|
|
@@ -139,7 +139,10 @@ const InternalSessionEditPage = props => {
|
|
|
139
139
|
}
|
|
140
140
|
const orderRes = await _authenticatedProxyApi.authenticatedProxyApi.getOrder(new URLSearchParams((0, _helpers__.removeNullishProps)(_objectSpread(_objectSpread({}, session), {}, {
|
|
141
141
|
formula: dossierFormula,
|
|
142
|
-
existingDossierEntityId: dossierById === null || dossierById === void 0 ? void 0 : dossierById.entityId
|
|
142
|
+
existingDossierEntityId: dossierById === null || dossierById === void 0 ? void 0 : dossierById.entityId,
|
|
143
|
+
// Fetch all articles (including non-standard ones selected via "Toon alle
|
|
144
|
+
// artikelen") so extractSessionProductsByOrder can classify every dossier line
|
|
145
|
+
skipFilters: true
|
|
143
146
|
}))).toString());
|
|
144
147
|
|
|
145
148
|
// Note: we need to use this function to classify the products found in the dossier orderlines
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/* ==========================================================================
|
|
2
2
|
Datepicker
|
|
3
3
|
========================================================================== */
|
|
4
|
-
/* Above sibling inputs (e.g. date popper vs time field below); lib default is z-index: 1 */
|
|
5
4
|
.react-datepicker-popper {
|
|
6
5
|
z-index: 1070 !important;
|
|
7
6
|
}
|
|
8
7
|
|
|
8
|
+
.react-datepicker__time-list-item--disabled {
|
|
9
|
+
display: none !important;
|
|
10
|
+
}
|
|
11
|
+
|
|
9
12
|
.react-datepicker__header:not(.react-datepicker__header--has-time-select) {
|
|
10
13
|
border-top-right-radius: 0;
|
|
11
14
|
}
|