thm-p3-configurator 0.0.282 → 0.0.284
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 +5 -4
- package/dist/src/shared/__helpers__/cartTable.js +29 -21
- 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
|
@@ -461,14 +461,15 @@ const ProductCartTable = () => {
|
|
|
461
461
|
const montageInclVat = !isToggled && APP_CONFIG.internal ? Number((totals === null || totals === void 0 ? void 0 : totals.montagePricePlusMarketCorrectionInclVat) || 0) : 0;
|
|
462
462
|
|
|
463
463
|
// Main products excl VAT (for toggled standard mode)
|
|
464
|
-
|
|
464
|
+
// Use !useTmgDisplayMode to match the display mode logic (isTmg && !isTowFormula)
|
|
465
|
+
const mainExclVat = isToggled && !useTmgDisplayMode ? mainProducts.reduce((total, product) => {
|
|
465
466
|
const {
|
|
466
467
|
salesPrice
|
|
467
468
|
} = product.priceInfo || {};
|
|
468
469
|
return salesPrice > 0 ? total + Number(salesPrice) : total;
|
|
469
470
|
}, 0) : 0;
|
|
470
|
-
const montageExclVat = isToggled && !
|
|
471
|
-
const marketCorrectionExclVat = isToggled && !
|
|
471
|
+
const montageExclVat = isToggled && !useTmgDisplayMode ? Number((totals === null || totals === void 0 ? void 0 : totals.totalMontageExclVat) || 0) : 0;
|
|
472
|
+
const marketCorrectionExclVat = isToggled && !useTmgDisplayMode && marketCorrectionValues.hasValue ? marketCorrectionValues.salesExcl : 0;
|
|
472
473
|
|
|
473
474
|
// TMG subtotals
|
|
474
475
|
const tmgCatalog = isTmg ? mainProducts.reduce((t, p) => {
|
|
@@ -519,7 +520,7 @@ const ProductCartTable = () => {
|
|
|
519
520
|
}
|
|
520
521
|
}
|
|
521
522
|
};
|
|
522
|
-
}, [mainProducts, accessoireProducts, marketCorrectionValues, isToggled, isTmg, totals]);
|
|
523
|
+
}, [mainProducts, accessoireProducts, marketCorrectionValues, isToggled, isTmg, useTmgDisplayMode, totals]);
|
|
523
524
|
|
|
524
525
|
// ============================================================================
|
|
525
526
|
// RENDER HELPERS
|
|
@@ -78,9 +78,9 @@ const getCartTableHeaderColumns = exports.getCartTableHeaderColumns = function g
|
|
|
78
78
|
const baseColumns = [{}, {}, {}, {}];
|
|
79
79
|
switch (displayMode) {
|
|
80
80
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
81
|
-
// THC:
|
|
82
|
-
// Towmotive:
|
|
83
|
-
return [...baseColumns,
|
|
81
|
+
// THC: Inkoopprijs - Marge - Verkoopprijs ex BTW (no catalog price)
|
|
82
|
+
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs ex BTW
|
|
83
|
+
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
84
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
85
85
|
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs ex BTW
|
|
86
86
|
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs ex BTW
|
|
@@ -131,7 +131,7 @@ const getMainProductCells = _ref => {
|
|
|
131
131
|
const baseCells = [vehicleCodingInputCell, {}, {}];
|
|
132
132
|
switch (displayMode) {
|
|
133
133
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
134
|
-
return [...baseCells,
|
|
134
|
+
return [...baseCells, textCell(shouldShowPurchasePrice ? (0, _index.formatPrice)(purchasePrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(hasLocationTotal ? (0, _index.formatPrice)(margin) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), ...(showCatalogPrice ? [priceCell(catalogPriceExcl)] : []), textCell(salesPrice > 0 ? (0, _index.formatPrice)(salesPrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)];
|
|
135
135
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
136
136
|
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
137
137
|
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
@@ -177,7 +177,7 @@ const getAccessoryProductCells = _ref2 => {
|
|
|
177
177
|
const baseCells = [{}, {}, {}];
|
|
178
178
|
switch (displayMode) {
|
|
179
179
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
180
|
-
return [...baseCells,
|
|
180
|
+
return [...baseCells, textCell(shouldShowPurchasePrice ? (0, _index.formatPrice)(purchasePrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(hasLocationTotal ? (0, _index.formatPrice)(margin) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), ...(showCatalogPrice ? [priceCell(catalogPriceExcl)] : []), textCell(salesPrice > 0 ? (0, _index.formatPrice)(salesPrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)];
|
|
181
181
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
182
182
|
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
183
183
|
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
@@ -214,9 +214,9 @@ const getMontageCells = exports.getMontageCells = function getMontageCells(displ
|
|
|
214
214
|
const nvt = textCell('N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS);
|
|
215
215
|
switch (displayMode) {
|
|
216
216
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
217
|
-
// THC:
|
|
218
|
-
// Towmotive:
|
|
219
|
-
return [...baseCells, ...(showCatalogPrice ? [nvt] : []),
|
|
217
|
+
// THC: Inkoopprijs - Marge - Verkoopprijs (no catalog price)
|
|
218
|
+
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs
|
|
219
|
+
return [...baseCells, nvt, nvt, ...(showCatalogPrice ? [nvt] : []), priceOverride || priceCell(montagePrice)];
|
|
220
220
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
221
221
|
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
222
222
|
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
@@ -247,9 +247,9 @@ const getMarketCorrectionCells = exports.getMarketCorrectionCells = function get
|
|
|
247
247
|
const baseCells = [{}, {}, {}];
|
|
248
248
|
switch (displayMode) {
|
|
249
249
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
250
|
-
// THC:
|
|
251
|
-
// Towmotive:
|
|
252
|
-
return [...baseCells, ...(showCatalogPrice ? [textCell('N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)] : []), priceCell(
|
|
250
|
+
// THC: Inkoopprijs - Marge - Verkoopprijs (no catalog price)
|
|
251
|
+
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs
|
|
252
|
+
return [...baseCells, priceCell(purchaseExcl), priceCell(margin), ...(showCatalogPrice ? [textCell('N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)] : []), priceCell(salesExcl)];
|
|
253
253
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
254
254
|
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
255
255
|
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
@@ -279,13 +279,21 @@ const getSectionTotalCells = exports.getSectionTotalCells = function getSectionT
|
|
|
279
279
|
const baseCells = [{}, {}];
|
|
280
280
|
switch (displayMode) {
|
|
281
281
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
282
|
-
// THC:
|
|
283
|
-
// Towmotive:
|
|
284
|
-
return [...baseCells, {}, {},
|
|
282
|
+
// THC: Inkoopprijs - Marge - Verkoopprijs (no catalog price)
|
|
283
|
+
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs
|
|
284
|
+
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
285
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
286
286
|
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
287
287
|
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
288
|
-
return [...baseCells, emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Subtotaal inkoopprijs', _cartTable.CART_TABLE_BOLD_END_CLASS),
|
|
288
|
+
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
|
+
// Marge column (no subtotal value)
|
|
290
|
+
emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS),
|
|
291
|
+
// Catalogusprijs column (only present for Towmotive)
|
|
292
|
+
...(showCatalogPrice ? [emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS)] : []),
|
|
293
|
+
// Korting column: show subtotal label for sales
|
|
294
|
+
textCell('Subtotaal (excl. btw)', 'fw-bold text-end pb-2'),
|
|
295
|
+
// Verkoopprijs column: show subtotal sales value
|
|
296
|
+
textCell((0, _index.formatPrice)(standardSubtotals.sales), 'fw-bold text-end pb-2')];
|
|
289
297
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
290
298
|
default:
|
|
291
299
|
return [...baseCells, {}, {}, {}, textCell('Subtotaal (incl. btw)', 'fw-bold text-end pb-2'), textCell((0, _index.formatPrice)(defaultSubtotal), 'fw-bold text-end pb-2')];
|
|
@@ -314,9 +322,9 @@ const getTotalRowCells = exports.getTotalRowCells = function getTotalRowCells(di
|
|
|
314
322
|
const baseCells = [{}, {}, {}];
|
|
315
323
|
switch (displayMode) {
|
|
316
324
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
317
|
-
// THC:
|
|
318
|
-
// Towmotive:
|
|
319
|
-
return [...baseCells, {}, ...(showCatalogPrice ? [emptyCell(className)] : []), textCell(
|
|
325
|
+
// THC: Inkoopprijs - Marge - Verkoopprijs (no catalog price)
|
|
326
|
+
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs
|
|
327
|
+
return [...baseCells, {}, textCell(label, className), ...(showCatalogPrice ? [emptyCell(className)] : []), textCell((0, _index.formatPrice)(locationValue), className), textCell((0, _index.formatPrice)(consumerValue), className)];
|
|
320
328
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
321
329
|
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
322
330
|
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
@@ -347,9 +355,9 @@ const getDiscountRowCells = exports.getDiscountRowCells = function getDiscountRo
|
|
|
347
355
|
const baseCells = [{}, {}, {}];
|
|
348
356
|
switch (displayMode) {
|
|
349
357
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
350
|
-
// THC:
|
|
351
|
-
// Towmotive:
|
|
352
|
-
return [...baseCells, {}, ...(showCatalogPrice ? [emptyCell(className)] : []),
|
|
358
|
+
// THC: Inkoopprijs - Marge - Verkoopprijs (no catalog price)
|
|
359
|
+
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs
|
|
360
|
+
return [...baseCells, {}, emptyCell(className), ...(showCatalogPrice ? [emptyCell(className)] : []), textCell(label, className), textCell(value, className)];
|
|
353
361
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
354
362
|
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
355
363
|
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
@@ -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);
|