thm-p3-configurator 0.0.283 → 0.0.285
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/__containers__/ProductsCartOverview.js +10 -9
- package/dist/src/shared/__helpers__/cartTable.js +21 -9
- package/dist/src/shared/__pages__/internal/InternalAppointmentPage.js +0 -3
- package/dist/src/shared/__pages__/internal/InternalQuotationPage.js +0 -3
- package/package.json +1 -1
|
@@ -571,7 +571,8 @@ const ProductCartTable = () => {
|
|
|
571
571
|
// ============================================================================
|
|
572
572
|
|
|
573
573
|
const showCatalogPrice = !isThc;
|
|
574
|
-
const
|
|
574
|
+
const showDiscountColumn = isTowmotive || isTowFormula;
|
|
575
|
+
const headerColumns = (0, _cartTable2.getCartTableHeaderColumns)(displayMode, showCatalogPrice, showDiscountColumn);
|
|
575
576
|
const montageRateInputCell = isThc ? {} : {
|
|
576
577
|
text: renderMontageRateInput(),
|
|
577
578
|
className: _cartTable.CART_TABLE_PRICE_CELL_CLASS
|
|
@@ -654,7 +655,7 @@ const ProductCartTable = () => {
|
|
|
654
655
|
sales: subtotals.main.exclVat
|
|
655
656
|
},
|
|
656
657
|
defaultSubtotal: subtotals.main.inclVat
|
|
657
|
-
}, showCatalogPrice)
|
|
658
|
+
}, showCatalogPrice, showDiscountColumn)
|
|
658
659
|
})), accessoireProducts.length > 0 && /*#__PURE__*/_react.default.createElement(_ProductTableSection.default, {
|
|
659
660
|
heading: "Toebehoren"
|
|
660
661
|
}, accessoireProducts.map(product => {
|
|
@@ -710,24 +711,24 @@ const ProductCartTable = () => {
|
|
|
710
711
|
sales: totals === null || totals === void 0 ? void 0 : totals.totalExtrasExclVat
|
|
711
712
|
},
|
|
712
713
|
defaultSubtotal: APP_CONFIG.internal ? totals === null || totals === void 0 ? void 0 : totals.totalExtrasInclVat : (totals === null || totals === void 0 ? void 0 : totals.totalExtrasExclVat) * _cartTable.VAT_RATE
|
|
713
|
-
}, showCatalogPrice)
|
|
714
|
+
}, showCatalogPrice, showDiscountColumn)
|
|
714
715
|
})), /*#__PURE__*/_react.default.createElement(_ProductTableTotal.default, {
|
|
715
716
|
rows: [(0, _cartTable2.getTotalRowCells)(displayMode, {
|
|
716
717
|
label: 'Producten (excl. btw)',
|
|
717
718
|
locationValue: totals === null || totals === void 0 ? void 0 : totals.totalLocationPriceExclVat,
|
|
718
719
|
consumerValue: isToggled ? totals === null || totals === void 0 ? void 0 : totals.totalBeforeDiscountExclVat : totals === null || totals === void 0 ? void 0 : totals.totalAfterDiscountExclVat,
|
|
719
720
|
className: 'text-end pt-2'
|
|
720
|
-
}, showCatalogPrice), (0, _cartTable2.getTotalRowCells)(displayMode, {
|
|
721
|
+
}, showCatalogPrice, showDiscountColumn), (0, _cartTable2.getTotalRowCells)(displayMode, {
|
|
721
722
|
label: 'btw',
|
|
722
723
|
locationValue: totals === null || totals === void 0 ? void 0 : totals.totalLocationVat,
|
|
723
724
|
consumerValue: isToggled ? totals === null || totals === void 0 ? void 0 : totals.totalVatBeforeDiscount : totals === null || totals === void 0 ? void 0 : totals.totalVatAfterDiscount,
|
|
724
725
|
className: 'text-end'
|
|
725
|
-
}, showCatalogPrice), (0, _cartTable2.getTotalRowCells)(displayMode, {
|
|
726
|
+
}, showCatalogPrice, showDiscountColumn), (0, _cartTable2.getTotalRowCells)(displayMode, {
|
|
726
727
|
label: 'Totaal (incl. btw)',
|
|
727
728
|
locationValue: totals === null || totals === void 0 ? void 0 : totals.totalLocationPriceInclVat,
|
|
728
729
|
consumerValue: isToggled ? totals === null || totals === void 0 ? void 0 : totals.totalBeforeDiscountInclVat : APP_CONFIG.internal ? totals === null || totals === void 0 ? void 0 : totals.totalBeforeDiscountInclVat : totals === null || totals === void 0 ? void 0 : totals.totalAfterDiscountInclVat,
|
|
729
730
|
className: 'fw-bold text-end'
|
|
730
|
-
}, showCatalogPrice)]
|
|
731
|
+
}, showCatalogPrice, showDiscountColumn)]
|
|
731
732
|
}), (discountAmount || discountPercentage) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", {
|
|
732
733
|
colSpan: "10",
|
|
733
734
|
className: (0, _helpers__.withStyle)('pt-4 pb-2')
|
|
@@ -736,15 +737,15 @@ const ProductCartTable = () => {
|
|
|
736
737
|
label: discountPercentage ? "Correctie (".concat(discountPercentage, "%)") : 'Correctie',
|
|
737
738
|
value: "-".concat((0, _helpers__.formatPrice)(totals === null || totals === void 0 ? void 0 : totals.discountInclVat)),
|
|
738
739
|
className: 'text-end text-success'
|
|
739
|
-
}, showCatalogPrice), (0, _cartTable2.getDiscountRowCells)(displayMode, {
|
|
740
|
+
}, showCatalogPrice, showDiscountColumn), (0, _cartTable2.getDiscountRowCells)(displayMode, {
|
|
740
741
|
label: 'Totaal na correctie (excl. btw)',
|
|
741
742
|
value: (0, _helpers__.formatPrice)(totals === null || totals === void 0 ? void 0 : totals.totalAfterDiscountExclVat),
|
|
742
743
|
className: 'text-end'
|
|
743
|
-
}, showCatalogPrice), (0, _cartTable2.getDiscountRowCells)(displayMode, {
|
|
744
|
+
}, showCatalogPrice, showDiscountColumn), (0, _cartTable2.getDiscountRowCells)(displayMode, {
|
|
744
745
|
label: 'Totaal na correctie (incl. btw)',
|
|
745
746
|
value: (0, _helpers__.formatPrice)(totals === null || totals === void 0 ? void 0 : totals.totalAfterDiscountInclVat),
|
|
746
747
|
className: 'fw-bold text-end'
|
|
747
|
-
}, showCatalogPrice)]
|
|
748
|
+
}, showCatalogPrice, showDiscountColumn)]
|
|
748
749
|
})))), APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_InternalDiscountForm.default, null)));
|
|
749
750
|
};
|
|
750
751
|
var _default = exports.default = ProductCartTable;
|
|
@@ -71,10 +71,12 @@ const emptyCells = exports.emptyCells = function emptyCells(count) {
|
|
|
71
71
|
* Get table header columns based on display mode
|
|
72
72
|
* @param {string} displayMode - The current display mode
|
|
73
73
|
* @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
|
|
74
|
+
* @param {boolean} showDiscountColumn - Whether to show the discount column (true for Towmotive/TOW/TM, false otherwise)
|
|
74
75
|
* @returns {Array} Array of column configuration objects
|
|
75
76
|
*/
|
|
76
77
|
const getCartTableHeaderColumns = exports.getCartTableHeaderColumns = function getCartTableHeaderColumns(displayMode) {
|
|
77
78
|
let showCatalogPrice = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
79
|
+
let showDiscountColumn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
78
80
|
const baseColumns = [{}, {}, {}, {}];
|
|
79
81
|
switch (displayMode) {
|
|
80
82
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
@@ -82,9 +84,10 @@ const getCartTableHeaderColumns = exports.getCartTableHeaderColumns = function g
|
|
|
82
84
|
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs ex BTW
|
|
83
85
|
return [...baseColumns, textCell('Inkoopprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Marge (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), ...(showCatalogPrice ? [textCell('Catalogprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)] : []), textCell('Verkoop Prijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)];
|
|
84
86
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
85
|
-
// THC: Inkoopprijs - Marge -
|
|
87
|
+
// THC (no discount): Inkoopprijs - Marge - Verkoopprijs ex BTW
|
|
88
|
+
// THC (with discount): Inkoopprijs - Marge - Korting% - Verkoopprijs ex BTW
|
|
86
89
|
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs ex BTW
|
|
87
|
-
return [...baseColumns, textCell('Inkoopprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Marge (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), ...(showCatalogPrice ? [textCell('Catalogusprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)] : []), textCell('Korting (%)', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Verkoop Prijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)];
|
|
90
|
+
return [...baseColumns, textCell('Inkoopprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Marge (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), ...(showCatalogPrice ? [textCell('Catalogusprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)] : []), ...(showDiscountColumn ? [textCell('Korting (%)', _cartTable.CART_TABLE_BOLD_END_CLASS)] : []), textCell('Verkoop Prijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)];
|
|
88
91
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
89
92
|
default:
|
|
90
93
|
return [...baseColumns, {}, {}, textCell('Verkoop Prijs (incl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)];
|
|
@@ -267,6 +270,7 @@ const getMarketCorrectionCells = exports.getMarketCorrectionCells = function get
|
|
|
267
270
|
* @param {Object} params.standardSubtotals - Standard subtotals
|
|
268
271
|
* @param {number} params.defaultSubtotal - Default subtotal
|
|
269
272
|
* @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
|
|
273
|
+
* @param {boolean} showDiscountColumn - Whether to show the discount column (true for Towmotive/TOW/TM, false otherwise)
|
|
270
274
|
* @returns {Array} Array of cell configuration objects
|
|
271
275
|
*/
|
|
272
276
|
const getSectionTotalCells = exports.getSectionTotalCells = function getSectionTotalCells(displayMode, _ref4) {
|
|
@@ -276,6 +280,7 @@ const getSectionTotalCells = exports.getSectionTotalCells = function getSectionT
|
|
|
276
280
|
defaultSubtotal
|
|
277
281
|
} = _ref4;
|
|
278
282
|
let showCatalogPrice = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
283
|
+
let showDiscountColumn = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
279
284
|
const baseCells = [{}, {}];
|
|
280
285
|
switch (displayMode) {
|
|
281
286
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
@@ -283,15 +288,16 @@ const getSectionTotalCells = exports.getSectionTotalCells = function getSectionT
|
|
|
283
288
|
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs
|
|
284
289
|
return [...baseCells, {}, {}, priceCell(tmgSubtotals.purchase, _cartTable.CART_TABLE_BOLD_END_CLASS), priceCell(tmgSubtotals.margin, _cartTable.CART_TABLE_BOLD_END_CLASS), ...(showCatalogPrice ? [priceCell(tmgSubtotals.catalog, _cartTable.CART_TABLE_BOLD_END_CLASS)] : []), textCell((0, _index.formatPrice)(tmgSubtotals.sales), 'fw-bold text-end pb-2')];
|
|
285
290
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
286
|
-
// THC: Inkoopprijs - Marge -
|
|
291
|
+
// THC (no discount): Inkoopprijs - Marge - Verkoopprijs
|
|
292
|
+
// THC (with discount): Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
287
293
|
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
288
294
|
return [...baseCells, emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Subtotaal inkoopprijs', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell((0, _index.formatPrice)(standardSubtotals.purchase), 'fw-bold text-end pb-2'),
|
|
289
295
|
// Marge column (no subtotal value)
|
|
290
296
|
emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS),
|
|
291
297
|
// Catalogusprijs column (only present for Towmotive)
|
|
292
298
|
...(showCatalogPrice ? [emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS)] : []),
|
|
293
|
-
// Korting column: show
|
|
294
|
-
textCell('Subtotaal (excl. btw)', 'fw-bold text-end pb-2'),
|
|
299
|
+
// Korting column: show label if column exists, otherwise empty
|
|
300
|
+
...(showDiscountColumn ? [textCell('Subtotaal (excl. btw)', 'fw-bold text-end pb-2')] : []),
|
|
295
301
|
// Verkoopprijs column: show subtotal sales value
|
|
296
302
|
textCell((0, _index.formatPrice)(standardSubtotals.sales), 'fw-bold text-end pb-2')];
|
|
297
303
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
@@ -309,6 +315,7 @@ const getSectionTotalCells = exports.getSectionTotalCells = function getSectionT
|
|
|
309
315
|
* @param {number} params.consumerValue - Consumer price value
|
|
310
316
|
* @param {string} params.className - CSS class for cells
|
|
311
317
|
* @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
|
|
318
|
+
* @param {boolean} showDiscountColumn - Whether to show the discount column (true for Towmotive/TOW/TM, false otherwise)
|
|
312
319
|
* @returns {Array} Array of cell configuration objects
|
|
313
320
|
*/
|
|
314
321
|
const getTotalRowCells = exports.getTotalRowCells = function getTotalRowCells(displayMode, _ref5) {
|
|
@@ -319,6 +326,7 @@ const getTotalRowCells = exports.getTotalRowCells = function getTotalRowCells(di
|
|
|
319
326
|
className = 'text-end'
|
|
320
327
|
} = _ref5;
|
|
321
328
|
let showCatalogPrice = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
329
|
+
let showDiscountColumn = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
322
330
|
const baseCells = [{}, {}, {}];
|
|
323
331
|
switch (displayMode) {
|
|
324
332
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
@@ -326,9 +334,10 @@ const getTotalRowCells = exports.getTotalRowCells = function getTotalRowCells(di
|
|
|
326
334
|
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs
|
|
327
335
|
return [...baseCells, {}, textCell(label, className), ...(showCatalogPrice ? [emptyCell(className)] : []), textCell((0, _index.formatPrice)(locationValue), className), textCell((0, _index.formatPrice)(consumerValue), className)];
|
|
328
336
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
329
|
-
// THC: Inkoopprijs - Marge -
|
|
337
|
+
// THC (no discount): Inkoopprijs - Marge - Verkoopprijs
|
|
338
|
+
// THC (with discount): Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
330
339
|
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
331
|
-
return [...baseCells, emptyCell(className), emptyCell(className), ...(showCatalogPrice ? [emptyCell(className)] : []), textCell(label, className), textCell((0, _index.formatPrice)(locationValue), className), textCell((0, _index.formatPrice)(consumerValue), className)];
|
|
340
|
+
return [...baseCells, emptyCell(className), emptyCell(className), ...(showCatalogPrice ? [emptyCell(className)] : []), ...(showDiscountColumn ? [emptyCell(className)] : []), textCell(label, className), textCell((0, _index.formatPrice)(locationValue), className), textCell((0, _index.formatPrice)(consumerValue), className)];
|
|
332
341
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
333
342
|
default:
|
|
334
343
|
return [...baseCells, {}, {}, textCell(label, className), textCell((0, _index.formatPrice)(consumerValue), className)];
|
|
@@ -343,6 +352,7 @@ const getTotalRowCells = exports.getTotalRowCells = function getTotalRowCells(di
|
|
|
343
352
|
* @param {string} params.value - Formatted value string
|
|
344
353
|
* @param {string} params.className - CSS class for cells
|
|
345
354
|
* @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
|
|
355
|
+
* @param {boolean} showDiscountColumn - Whether to show the discount column (true for Towmotive/TOW/TM, false otherwise)
|
|
346
356
|
* @returns {Array} Array of cell configuration objects
|
|
347
357
|
*/
|
|
348
358
|
const getDiscountRowCells = exports.getDiscountRowCells = function getDiscountRowCells(displayMode, _ref6) {
|
|
@@ -352,6 +362,7 @@ const getDiscountRowCells = exports.getDiscountRowCells = function getDiscountRo
|
|
|
352
362
|
className = 'text-end'
|
|
353
363
|
} = _ref6;
|
|
354
364
|
let showCatalogPrice = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
365
|
+
let showDiscountColumn = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
355
366
|
const baseCells = [{}, {}, {}];
|
|
356
367
|
switch (displayMode) {
|
|
357
368
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
@@ -359,9 +370,10 @@ const getDiscountRowCells = exports.getDiscountRowCells = function getDiscountRo
|
|
|
359
370
|
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs
|
|
360
371
|
return [...baseCells, {}, emptyCell(className), ...(showCatalogPrice ? [emptyCell(className)] : []), textCell(label, className), textCell(value, className)];
|
|
361
372
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
362
|
-
// THC: Inkoopprijs - Marge -
|
|
373
|
+
// THC (no discount): Inkoopprijs - Marge - Verkoopprijs
|
|
374
|
+
// THC (with discount): Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
363
375
|
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
364
|
-
return [...baseCells, emptyCell(className), emptyCell(className), ...(showCatalogPrice ? [emptyCell(className)] : []), emptyCell(className), textCell(label, className), textCell(value, className)];
|
|
376
|
+
return [...baseCells, emptyCell(className), emptyCell(className), ...(showCatalogPrice ? [emptyCell(className)] : []), ...(showDiscountColumn ? [emptyCell(className)] : []), textCell(label, className), textCell(value, className)];
|
|
365
377
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
366
378
|
default:
|
|
367
379
|
return [...baseCells, {}, {}, textCell(label, className), textCell(value, className)];
|
|
@@ -230,9 +230,6 @@ const InternalAppointmentPage = () => {
|
|
|
230
230
|
setEmailConflictData(null);
|
|
231
231
|
};
|
|
232
232
|
const handleCancelLink = () => {
|
|
233
|
-
if (pendingPayload) {
|
|
234
|
-
performSubmit(pendingPayload);
|
|
235
|
-
}
|
|
236
233
|
setIsEmailConflictModalShown(false);
|
|
237
234
|
setPendingPayload(null);
|
|
238
235
|
setEmailConflictData(null);
|
|
@@ -197,9 +197,6 @@ const InternalQuotationPage = () => {
|
|
|
197
197
|
setEmailConflictData(null);
|
|
198
198
|
};
|
|
199
199
|
const handleCancelLink = () => {
|
|
200
|
-
if (pendingPayload) {
|
|
201
|
-
performSubmit(pendingPayload);
|
|
202
|
-
}
|
|
203
200
|
setIsEmailConflictModalShown(false);
|
|
204
201
|
setPendingPayload(null);
|
|
205
202
|
setEmailConflictData(null);
|