thm-p3-configurator 0.0.284 → 0.0.286
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.
|
@@ -173,7 +173,9 @@ const ProductCartTable = () => {
|
|
|
173
173
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
174
174
|
|
|
175
175
|
// Determine display mode
|
|
176
|
-
|
|
176
|
+
// THC users who cannot edit discounts should use TMG display mode (no Korting column)
|
|
177
|
+
const canEditDiscounts = isTowmotive || isTowFormula;
|
|
178
|
+
const useTmgDisplayMode = isTmg && !isTowFormula || isThc && !canEditDiscounts;
|
|
177
179
|
const displayMode = (0, _cartTable2.getCartTableDisplayMode)(isToggled, useTmgDisplayMode);
|
|
178
180
|
const handleVehicleCodingDiscountChange = function handleVehicleCodingDiscountChange(value) {
|
|
179
181
|
let articleNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
@@ -82,8 +82,8 @@ const getCartTableHeaderColumns = exports.getCartTableHeaderColumns = function g
|
|
|
82
82
|
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs ex BTW
|
|
83
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
|
-
//
|
|
86
|
-
//
|
|
85
|
+
// Towmotive/TowFormula: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs ex BTW
|
|
86
|
+
// (THC without discount capability uses TOGGLED_TMG mode instead)
|
|
87
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)];
|
|
88
88
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
89
89
|
default:
|
|
@@ -133,8 +133,7 @@ const getMainProductCells = _ref => {
|
|
|
133
133
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
134
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
|
-
//
|
|
137
|
-
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
136
|
+
// Towmotive/TowFormula: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
138
137
|
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)] : []), discountInputCell, priceCell(salesPrice)];
|
|
139
138
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
140
139
|
default:
|
|
@@ -179,8 +178,7 @@ const getAccessoryProductCells = _ref2 => {
|
|
|
179
178
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
180
179
|
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
180
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
182
|
-
//
|
|
183
|
-
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
181
|
+
// Towmotive/TowFormula: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
184
182
|
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)] : []), discountInputCell, priceCell(salesPrice)];
|
|
185
183
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
186
184
|
default:
|
|
@@ -218,8 +216,7 @@ const getMontageCells = exports.getMontageCells = function getMontageCells(displ
|
|
|
218
216
|
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs
|
|
219
217
|
return [...baseCells, nvt, nvt, ...(showCatalogPrice ? [nvt] : []), priceOverride || priceCell(montagePrice)];
|
|
220
218
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
221
|
-
//
|
|
222
|
-
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
219
|
+
// Towmotive/TowFormula: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
223
220
|
return [...baseCells, nvt, nvt, ...(showCatalogPrice ? [nvt] : []), discountOverride || emptyCell(_cartTable.CART_TABLE_PRICE_CELL_CLASS), priceOverride || priceCell(montagePrice)];
|
|
224
221
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
225
222
|
default:
|
|
@@ -251,8 +248,7 @@ const getMarketCorrectionCells = exports.getMarketCorrectionCells = function get
|
|
|
251
248
|
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs
|
|
252
249
|
return [...baseCells, priceCell(purchaseExcl), priceCell(margin), ...(showCatalogPrice ? [textCell('N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)] : []), priceCell(salesExcl)];
|
|
253
250
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
254
|
-
//
|
|
255
|
-
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
251
|
+
// Towmotive/TowFormula: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
256
252
|
return [...baseCells, priceCell(purchaseExcl), priceCell(margin), ...(showCatalogPrice ? [textCell('N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)] : []), emptyCell(_cartTable.CART_TABLE_PRICE_CELL_CLASS), priceCell(salesExcl)];
|
|
257
253
|
default:
|
|
258
254
|
return baseCells;
|
|
@@ -283,8 +279,7 @@ const getSectionTotalCells = exports.getSectionTotalCells = function getSectionT
|
|
|
283
279
|
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs
|
|
284
280
|
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
281
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
286
|
-
//
|
|
287
|
-
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
282
|
+
// Towmotive/TowFormula: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
288
283
|
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
284
|
// Marge column (no subtotal value)
|
|
290
285
|
emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS),
|
|
@@ -326,8 +321,7 @@ const getTotalRowCells = exports.getTotalRowCells = function getTotalRowCells(di
|
|
|
326
321
|
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs
|
|
327
322
|
return [...baseCells, {}, textCell(label, className), ...(showCatalogPrice ? [emptyCell(className)] : []), textCell((0, _index.formatPrice)(locationValue), className), textCell((0, _index.formatPrice)(consumerValue), className)];
|
|
328
323
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
329
|
-
//
|
|
330
|
-
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
324
|
+
// Towmotive/TowFormula: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
331
325
|
return [...baseCells, emptyCell(className), emptyCell(className), ...(showCatalogPrice ? [emptyCell(className)] : []), textCell(label, className), textCell((0, _index.formatPrice)(locationValue), className), textCell((0, _index.formatPrice)(consumerValue), className)];
|
|
332
326
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
333
327
|
default:
|
|
@@ -359,8 +353,7 @@ const getDiscountRowCells = exports.getDiscountRowCells = function getDiscountRo
|
|
|
359
353
|
// Towmotive: Inkoopprijs - Marge - Catalogprijs - Verkoopprijs
|
|
360
354
|
return [...baseCells, {}, emptyCell(className), ...(showCatalogPrice ? [emptyCell(className)] : []), textCell(label, className), textCell(value, className)];
|
|
361
355
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
362
|
-
//
|
|
363
|
-
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
356
|
+
// Towmotive/TowFormula: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
364
357
|
return [...baseCells, emptyCell(className), emptyCell(className), ...(showCatalogPrice ? [emptyCell(className)] : []), emptyCell(className), textCell(label, className), textCell(value, className)];
|
|
365
358
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
366
359
|
default:
|