thm-p3-configurator 0.0.307 → 0.0.309
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 +9 -0
- package/dist/src/shared/__containers__/ProductCartSide.js +23 -2
- package/dist/src/shared/__containers__/internal/InternalAppointmentForm.js +8 -2
- package/dist/src/shared/__containers__/internal/InternalQuotationForm.js +7 -1
- package/dist/src/shared/__helpers__/cartTable.js +2 -2
- package/package.json +1 -1
|
@@ -223,6 +223,7 @@ const useCreatePrivateQuotationMutation = () => {
|
|
|
223
223
|
branchId,
|
|
224
224
|
formula,
|
|
225
225
|
discount,
|
|
226
|
+
extraPrice,
|
|
226
227
|
isExitIntent = false,
|
|
227
228
|
montageRate
|
|
228
229
|
} = _ref5;
|
|
@@ -241,6 +242,7 @@ const useCreatePrivateQuotationMutation = () => {
|
|
|
241
242
|
channel,
|
|
242
243
|
formula,
|
|
243
244
|
discount,
|
|
245
|
+
extraPrice,
|
|
244
246
|
answers,
|
|
245
247
|
cart,
|
|
246
248
|
selectBoardComputerUpdate,
|
|
@@ -258,6 +260,7 @@ const useCreatePrivateQuotationMutation = () => {
|
|
|
258
260
|
channel,
|
|
259
261
|
formula,
|
|
260
262
|
discount,
|
|
263
|
+
extraPrice,
|
|
261
264
|
answers,
|
|
262
265
|
cart,
|
|
263
266
|
selectBoardComputerUpdate,
|
|
@@ -312,6 +315,7 @@ const useCreatePrivateAppointmentMutation = () => {
|
|
|
312
315
|
branchId,
|
|
313
316
|
formula,
|
|
314
317
|
discount,
|
|
318
|
+
extraPrice,
|
|
315
319
|
customerAgreed,
|
|
316
320
|
invoicePaymentByLeaseCompany,
|
|
317
321
|
montageRate
|
|
@@ -331,6 +335,7 @@ const useCreatePrivateAppointmentMutation = () => {
|
|
|
331
335
|
chassisNumber,
|
|
332
336
|
formula,
|
|
333
337
|
discount,
|
|
338
|
+
extraPrice,
|
|
334
339
|
answers,
|
|
335
340
|
cart,
|
|
336
341
|
selectBoardComputerUpdate,
|
|
@@ -520,6 +525,7 @@ const useUpdatePrivateQuotationByIdMutation = id => {
|
|
|
520
525
|
branchId,
|
|
521
526
|
formula,
|
|
522
527
|
discount,
|
|
528
|
+
extraPrice,
|
|
523
529
|
priceCalculationDate,
|
|
524
530
|
montageRate
|
|
525
531
|
} = _ref13;
|
|
@@ -546,6 +552,7 @@ const useUpdatePrivateQuotationByIdMutation = id => {
|
|
|
546
552
|
channel,
|
|
547
553
|
formula,
|
|
548
554
|
discount,
|
|
555
|
+
extraPrice,
|
|
549
556
|
answers,
|
|
550
557
|
cart,
|
|
551
558
|
selectBoardComputerUpdate,
|
|
@@ -587,6 +594,7 @@ const useUpdatePrivateAppointmentByIdMutation = id => {
|
|
|
587
594
|
branchId,
|
|
588
595
|
formula,
|
|
589
596
|
discount,
|
|
597
|
+
extraPrice,
|
|
590
598
|
priceCalculationDate,
|
|
591
599
|
customerAgreed,
|
|
592
600
|
montageRate
|
|
@@ -616,6 +624,7 @@ const useUpdatePrivateAppointmentByIdMutation = id => {
|
|
|
616
624
|
channel,
|
|
617
625
|
formula,
|
|
618
626
|
discount,
|
|
627
|
+
extraPrice,
|
|
619
628
|
answers,
|
|
620
629
|
cart,
|
|
621
630
|
selectBoardComputerUpdate,
|
|
@@ -38,12 +38,14 @@ var _ProductTableSectionTotal = _interopRequireDefault(require("../__components_
|
|
|
38
38
|
var _ProductTableStaticRow = _interopRequireDefault(require("../__components__/ProductTable/ProductTableStaticRow"));
|
|
39
39
|
var _ProductTableTotal = _interopRequireDefault(require("../__components__/ProductTable/ProductTableTotal"));
|
|
40
40
|
var _InlineSpinner = _interopRequireDefault(require("../__components__/Spinners/InlineSpinner"));
|
|
41
|
+
var _cartTable = require("../__constants__/cartTable");
|
|
41
42
|
var _FormulaContext = require("../__context__/FormulaContext");
|
|
42
43
|
var _OrderSessionContext = require("../__context__/OrderSessionContext");
|
|
43
44
|
var _helpers__ = require("../__helpers__");
|
|
44
45
|
var _image = require("../__helpers__/image");
|
|
45
46
|
var _montageRate = require("../__helpers__/montageRate");
|
|
46
47
|
var _product = require("../__helpers__/product");
|
|
48
|
+
var _useIsTmg = require("../__hooks__/useIsTmg");
|
|
47
49
|
var _useIsTowmotive = require("../__hooks__/useIsTowmotive");
|
|
48
50
|
function _interopRequireDefault(e) {
|
|
49
51
|
return e && e.__esModule ? e : {
|
|
@@ -97,8 +99,10 @@ const ProductCartSide = () => {
|
|
|
97
99
|
consumerDiscounts,
|
|
98
100
|
discountAmount,
|
|
99
101
|
discountPercentage,
|
|
100
|
-
montageRate
|
|
102
|
+
montageRate,
|
|
103
|
+
extraPriceAmount
|
|
101
104
|
} = order;
|
|
105
|
+
const isTmg = (0, _useIsTmg.useIsTmg)();
|
|
102
106
|
const isTowmotive = (0, _useIsTowmotive.useIsTowmotive)();
|
|
103
107
|
const cartInput = (0, _product.buildCartInput)({
|
|
104
108
|
selectedCableset,
|
|
@@ -127,9 +131,17 @@ const ProductCartSide = () => {
|
|
|
127
131
|
branchId: isToggled ? selectedBranch : undefined,
|
|
128
132
|
discountAmount,
|
|
129
133
|
discountPercentage,
|
|
130
|
-
montageRate: (0, _montageRate.toApiMontageRate)(montageRate)
|
|
134
|
+
montageRate: (0, _montageRate.toApiMontageRate)(montageRate),
|
|
135
|
+
extraPriceAmount
|
|
131
136
|
});
|
|
132
137
|
const marketCorrection = cart === null || cart === void 0 ? void 0 : cart.find(item => item.articleNumber === 'MC');
|
|
138
|
+
const extraPriceItem = cart === null || cart === void 0 ? void 0 : cart.find(item => item.articleNumber === _cartTable.EXTRA_PRICE_ARTICLE_NUMBER);
|
|
139
|
+
|
|
140
|
+
// Calculate extra price values
|
|
141
|
+
const extraPriceConsumerTotal = Number(extraPriceItem === null || extraPriceItem === void 0 ? void 0 : extraPriceItem.consumerTotal) || 0;
|
|
142
|
+
const hasExtraPrice = extraPriceConsumerTotal !== 0;
|
|
143
|
+
const extraPriceSalesIncl = extraPriceConsumerTotal;
|
|
144
|
+
const extraPriceSalesExcl = extraPriceConsumerTotal / _cartTable.VAT_RATE;
|
|
133
145
|
let mainProducts = [];
|
|
134
146
|
let accessoireProducts = [];
|
|
135
147
|
if (products) {
|
|
@@ -289,6 +301,15 @@ const ProductCartSide = () => {
|
|
|
289
301
|
}),
|
|
290
302
|
isDisabled: false
|
|
291
303
|
});
|
|
304
|
+
})), hasExtraPrice && (isTowmotive || isTmg) && /*#__PURE__*/_react.default.createElement(_ProductTableSection.default, {
|
|
305
|
+
heading: "Meerprijs"
|
|
306
|
+
}, /*#__PURE__*/_react.default.createElement(_ProductTableStaticRow.default, {
|
|
307
|
+
productTitle: "Meerprijs",
|
|
308
|
+
productImage: _montagePlaceholder.default,
|
|
309
|
+
extraCells: [{}, {
|
|
310
|
+
text: isToggled ? (0, _helpers__.formatPrice)(extraPriceSalesExcl) : (0, _helpers__.formatPrice)(extraPriceSalesIncl),
|
|
311
|
+
className: 'cart__table-purchase-price text-end'
|
|
312
|
+
}]
|
|
292
313
|
})), /*#__PURE__*/_react.default.createElement(_ProductTableSectionTotal.default, {
|
|
293
314
|
isEditable: false,
|
|
294
315
|
extraCells: [{}, {
|
|
@@ -236,7 +236,9 @@ const InternalAppointmentForm = _ref => {
|
|
|
236
236
|
consumerDiscounts,
|
|
237
237
|
montageRate,
|
|
238
238
|
hasGoedkeuringsnummerActivity,
|
|
239
|
-
isTowCenterBranch
|
|
239
|
+
isTowCenterBranch,
|
|
240
|
+
extraPriceAmount,
|
|
241
|
+
extraPriceDescription
|
|
240
242
|
} = order;
|
|
241
243
|
|
|
242
244
|
// Track the original ownership type from context
|
|
@@ -543,7 +545,11 @@ const InternalAppointmentForm = _ref => {
|
|
|
543
545
|
code: discountCode,
|
|
544
546
|
amount: discountAmount,
|
|
545
547
|
percentage: discountPercentage
|
|
546
|
-
})
|
|
548
|
+
}),
|
|
549
|
+
extraPrice: extraPriceAmount != null ? {
|
|
550
|
+
amount: extraPriceAmount,
|
|
551
|
+
description: extraPriceDescription || ''
|
|
552
|
+
} : undefined
|
|
547
553
|
}, formula === _constants__.CONFIGURATOR_FORMULAS.THM ? {
|
|
548
554
|
formula: _constants__.CONFIGURATOR_FORMULAS.TM
|
|
549
555
|
} : {
|
|
@@ -204,7 +204,9 @@ const InternalQuotationForm = _ref => {
|
|
|
204
204
|
vehicleCodingDiscountPercentage,
|
|
205
205
|
consumerDiscounts,
|
|
206
206
|
montageRate,
|
|
207
|
-
isTowCenterBranch
|
|
207
|
+
isTowCenterBranch,
|
|
208
|
+
extraPriceAmount,
|
|
209
|
+
extraPriceDescription
|
|
208
210
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
209
211
|
const [errors, setErrors] = (0, _react.useState)({});
|
|
210
212
|
const [companySearchTerm, setCompanySearchTerm] = (0, _react.useState)('');
|
|
@@ -486,6 +488,10 @@ const InternalQuotationForm = _ref => {
|
|
|
486
488
|
amount: discountAmount,
|
|
487
489
|
percentage: discountPercentage
|
|
488
490
|
}),
|
|
491
|
+
extraPrice: extraPriceAmount != null ? {
|
|
492
|
+
amount: extraPriceAmount,
|
|
493
|
+
description: extraPriceDescription || ''
|
|
494
|
+
} : undefined,
|
|
489
495
|
priceCalculationDate
|
|
490
496
|
}, formula === _constants__.CONFIGURATOR_FORMULAS.THM ? {
|
|
491
497
|
formula: _constants__.CONFIGURATOR_FORMULAS.TM
|
|
@@ -291,8 +291,8 @@ const getExtraPriceCells = exports.getExtraPriceCells = function getExtraPriceCe
|
|
|
291
291
|
// No discount for extra price
|
|
292
292
|
priceCell(salesExcl)];
|
|
293
293
|
default:
|
|
294
|
-
// Default mode: Just show price incl VAT
|
|
295
|
-
return [...baseCells, priceCell(salesIncl)];
|
|
294
|
+
// Default mode: Just show price incl VAT (needs 2 empty cells before price to align)
|
|
295
|
+
return [...baseCells, {}, {}, priceCell(salesIncl)];
|
|
296
296
|
}
|
|
297
297
|
};
|
|
298
298
|
|