thm-p3-configurator 0.0.272 → 0.0.273

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.
@@ -70,11 +70,11 @@ const App = () => {
70
70
  (0, _Experiments.default)();
71
71
  });
72
72
  return /*#__PURE__*/_react.default.createElement(_SentryWrapper.default, null, /*#__PURE__*/_react.default.createElement(_FormulaContext.FormulaController, {
73
- defaultFormula: _constants__.CONFIGURATOR_FORMULAS.THM
73
+ defaultFormula: _constants__.CONFIGURATOR_FORMULAS.THC
74
74
  }, /*#__PURE__*/_react.default.createElement(_CountryContext.CountryController, {
75
75
  defaultCountry: APP_CONFIG.country
76
76
  }, /*#__PURE__*/_react.default.createElement(_OrderSessionContext.OrderSessionController, null, /*#__PURE__*/_react.default.createElement(_reactQuery.QueryClientProvider, {
77
77
  client: _queryClient.default
78
- }, /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, null, /*#__PURE__*/_react.default.createElement(_reactHotLoader.AppContainer, null, /*#__PURE__*/_react.default.createElement(_ActiveMarkerContext.ActiveMarkerProvider, null, /*#__PURE__*/_react.default.createElement(_StyleWrapper.default, null, !APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_Navbar.default, null), APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_InternalBranchSelectorModal.default, null), /*#__PURE__*/_react.default.createElement(_pages__.default, null))))))))));
78
+ }, /*#__PURE__*/_react.default.createElement(_reactRouterDom.BrowserRouter, null, /*#__PURE__*/_react.default.createElement(_reactHotLoader.AppContainer, null, /*#__PURE__*/_react.default.createElement(_ActiveMarkerContext.ActiveMarkerProvider, null, /*#__PURE__*/_react.default.createElement(_StyleWrapper.default, null, !APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_Navbar.default, null), APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_InternalBranchSelectorModal.default, null), APP_CONFIG.nodeEnv === 'development' && APP_CONFIG.internal === true && /*#__PURE__*/_react.default.createElement(_TEST_ONLY_INTERNAL_ROUTES.default, null))))))))));
79
79
  };
80
80
  var _default = exports.default = App;
@@ -572,7 +572,8 @@ const ProductCartTable = () => {
572
572
  if (isLoadingProducts) {
573
573
  return /*#__PURE__*/_react.default.createElement(_FullPageSpinner.default, null);
574
574
  }
575
- const headerColumns = (0, _cartTable2.getCartTableHeaderColumns)(displayMode);
575
+ const showCatalogPrice = !isThc;
576
+ const headerColumns = (0, _cartTable2.getCartTableHeaderColumns)(displayMode, showCatalogPrice);
576
577
  const montageRateInputCell = isThc ? {} : {
577
578
  text: renderMontageRateInput(),
578
579
  className: _cartTable.CART_TABLE_PRICE_CELL_CLASS
@@ -625,6 +626,7 @@ const ProductCartTable = () => {
625
626
  discountInputCell: discountInputCellMain,
626
627
  vehicleCodingInputCell,
627
628
  isVehicleCodingProduct,
629
+ showCatalogPrice,
628
630
  treatZeroPurchaseAsNvt: Boolean(isBoardComputerProduct)
629
631
  })
630
632
  });
@@ -632,11 +634,11 @@ const ProductCartTable = () => {
632
634
  productTitle: "Montage",
633
635
  productSubtitle: (0, _helpers__.formatMontageTime)(totals === null || totals === void 0 ? void 0 : totals.montageTime),
634
636
  productImage: _montagePlaceholder.default,
635
- extraCells: (0, _cartTable2.getMontageCells)(displayMode, totals === null || totals === void 0 ? void 0 : totals.totalMontageExclVat, totals === null || totals === void 0 ? void 0 : totals.montagePricePlusMarketCorrectionInclVat, montageRateCellOverrides)
637
+ extraCells: (0, _cartTable2.getMontageCells)(displayMode, totals === null || totals === void 0 ? void 0 : totals.totalMontageExclVat, totals === null || totals === void 0 ? void 0 : totals.montagePricePlusMarketCorrectionInclVat, montageRateCellOverrides, showCatalogPrice)
636
638
  }), isToggled && marketCorrectionValues.hasValue && /*#__PURE__*/_react.default.createElement(_ProductTableStaticRow.default, {
637
639
  productTitle: "Marktcorrectie",
638
640
  productImage: _montagePlaceholder.default,
639
- extraCells: (0, _cartTable2.getMarketCorrectionCells)(displayMode, marketCorrectionValues)
641
+ extraCells: (0, _cartTable2.getMarketCorrectionCells)(displayMode, marketCorrectionValues, showCatalogPrice)
640
642
  }), /*#__PURE__*/_react.default.createElement(_ProductTableSectionTotal.default, {
641
643
  isEditable: true,
642
644
  editLabel: "Wijzig je trekhaakpakket",
@@ -648,7 +650,7 @@ const ProductCartTable = () => {
648
650
  sales: subtotals.main.exclVat
649
651
  },
650
652
  defaultSubtotal: subtotals.main.inclVat
651
- })
653
+ }, showCatalogPrice)
652
654
  })), accessoireProducts.length > 0 && /*#__PURE__*/_react.default.createElement(_ProductTableSection.default, {
653
655
  heading: "Toebehoren"
654
656
  }, accessoireProducts.map(product => {
@@ -673,7 +675,8 @@ const ProductCartTable = () => {
673
675
  extraCells: (0, _cartTable2.getAccessoryProductCells)({
674
676
  displayMode,
675
677
  priceInfo: product.priceInfo,
676
- discountInputCell: discountInputCellAccessory
678
+ discountInputCell: discountInputCellAccessory,
679
+ showCatalogPrice
677
680
  }),
678
681
  productAmount: selectedExtras[product.articleNumber],
679
682
  onEdit: value => {
@@ -703,24 +706,24 @@ const ProductCartTable = () => {
703
706
  sales: totals === null || totals === void 0 ? void 0 : totals.totalExtrasExclVat
704
707
  },
705
708
  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
706
- })
709
+ }, showCatalogPrice)
707
710
  })), /*#__PURE__*/_react.default.createElement(_ProductTableTotal.default, {
708
711
  rows: [(0, _cartTable2.getTotalRowCells)(displayMode, {
709
712
  label: 'Producten (excl. btw)',
710
713
  locationValue: totals === null || totals === void 0 ? void 0 : totals.totalLocationPriceExclVat,
711
714
  consumerValue: isToggled ? totals === null || totals === void 0 ? void 0 : totals.totalBeforeDiscountExclVat : totals === null || totals === void 0 ? void 0 : totals.totalAfterDiscountExclVat,
712
715
  className: 'text-end pt-2'
713
- }), (0, _cartTable2.getTotalRowCells)(displayMode, {
716
+ }, showCatalogPrice), (0, _cartTable2.getTotalRowCells)(displayMode, {
714
717
  label: 'btw',
715
718
  locationValue: totals === null || totals === void 0 ? void 0 : totals.totalLocationVat,
716
719
  consumerValue: isToggled ? totals === null || totals === void 0 ? void 0 : totals.totalVatBeforeDiscount : totals === null || totals === void 0 ? void 0 : totals.totalVatAfterDiscount,
717
720
  className: 'text-end'
718
- }), (0, _cartTable2.getTotalRowCells)(displayMode, {
721
+ }, showCatalogPrice), (0, _cartTable2.getTotalRowCells)(displayMode, {
719
722
  label: 'Totaal (incl. btw)',
720
723
  locationValue: totals === null || totals === void 0 ? void 0 : totals.totalLocationPriceInclVat,
721
724
  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,
722
725
  className: 'fw-bold text-end'
723
- })]
726
+ }, showCatalogPrice)]
724
727
  }), (discountAmount || discountPercentage) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", {
725
728
  colSpan: "10",
726
729
  className: (0, _helpers__.withStyle)('pt-4 pb-2')
@@ -729,15 +732,15 @@ const ProductCartTable = () => {
729
732
  label: discountPercentage ? "Correctie (".concat(discountPercentage, "%)") : 'Correctie',
730
733
  value: "-".concat((0, _helpers__.formatPrice)(totals === null || totals === void 0 ? void 0 : totals.discountInclVat)),
731
734
  className: 'text-end text-success'
732
- }), (0, _cartTable2.getDiscountRowCells)(displayMode, {
735
+ }, showCatalogPrice), (0, _cartTable2.getDiscountRowCells)(displayMode, {
733
736
  label: 'Totaal na correctie (excl. btw)',
734
737
  value: (0, _helpers__.formatPrice)(totals === null || totals === void 0 ? void 0 : totals.totalAfterDiscountExclVat),
735
738
  className: 'text-end'
736
- }), (0, _cartTable2.getDiscountRowCells)(displayMode, {
739
+ }, showCatalogPrice), (0, _cartTable2.getDiscountRowCells)(displayMode, {
737
740
  label: 'Totaal na correctie (incl. btw)',
738
741
  value: (0, _helpers__.formatPrice)(totals === null || totals === void 0 ? void 0 : totals.totalAfterDiscountInclVat),
739
742
  className: 'fw-bold text-end'
740
- })]
743
+ }, showCatalogPrice)]
741
744
  })))), APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_InternalDiscountForm.default, null)));
742
745
  };
743
746
  var _default = exports.default = ProductCartTable;
@@ -70,15 +70,21 @@ const emptyCells = exports.emptyCells = function emptyCells(count) {
70
70
  /**
71
71
  * Get table header columns based on display mode
72
72
  * @param {string} displayMode - The current display mode
73
+ * @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
73
74
  * @returns {Array} Array of column configuration objects
74
75
  */
75
- const getCartTableHeaderColumns = displayMode => {
76
+ const getCartTableHeaderColumns = exports.getCartTableHeaderColumns = function getCartTableHeaderColumns(displayMode) {
77
+ let showCatalogPrice = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
76
78
  const baseColumns = [{}, {}, {}, {}];
77
79
  switch (displayMode) {
78
80
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
79
- return [...baseColumns, textCell('Catalogprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Marge (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Inkoopprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Verkoop Prijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)];
81
+ // THC: Marge - Inkoopprijs - Verkoopprijs ex BTW (no catalog price)
82
+ // Towmotive: Catalogprijs - Marge - Inkoopprijs - Verkoopprijs ex BTW
83
+ return [...baseColumns, ...(showCatalogPrice ? [textCell('Catalogprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)] : []), textCell('Marge (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Inkoopprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Verkoop Prijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)];
80
84
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
81
- return [...baseColumns, textCell('Inkoopprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Marge (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), 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)];
85
+ // THC: Inkoopprijs - Marge - Korting% - Verkoopprijs ex BTW
86
+ // 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)];
82
88
  case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
83
89
  default:
84
90
  return [...baseColumns, {}, {}, textCell('Verkoop Prijs (incl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)];
@@ -97,9 +103,9 @@ const getCartTableHeaderColumns = displayMode => {
97
103
  * @param {Object} params.discountInputCell - Discount input cell (or empty)
98
104
  * @param {Object} params.vehicleCodingInputCell - Vehicle coding input cell (or empty)
99
105
  * @param {boolean} params.isVehicleCodingProduct - Whether this is a vehicle coding product
106
+ * @param {boolean} params.showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
100
107
  * @returns {Array} Array of cell configuration objects
101
108
  */
102
- exports.getCartTableHeaderColumns = getCartTableHeaderColumns;
103
109
  const getMainProductCells = _ref => {
104
110
  let {
105
111
  displayMode,
@@ -107,6 +113,7 @@ const getMainProductCells = _ref => {
107
113
  discountInputCell,
108
114
  vehicleCodingInputCell,
109
115
  isVehicleCodingProduct,
116
+ showCatalogPrice = false,
110
117
  treatZeroPurchaseAsNvt = false
111
118
  } = _ref;
112
119
  const {
@@ -124,9 +131,11 @@ const getMainProductCells = _ref => {
124
131
  const baseCells = [vehicleCodingInputCell, {}, {}];
125
132
  switch (displayMode) {
126
133
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
127
- return [...baseCells, priceCell(catalogPriceExcl), textCell(hasLocationTotal ? (0, _index.formatPrice)(margin) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(shouldShowPurchasePrice ? (0, _index.formatPrice)(purchasePrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(salesPrice > 0 ? (0, _index.formatPrice)(salesPrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)];
134
+ return [...baseCells, ...(showCatalogPrice ? [priceCell(catalogPriceExcl)] : []), textCell(hasLocationTotal ? (0, _index.formatPrice)(margin) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(shouldShowPurchasePrice ? (0, _index.formatPrice)(purchasePrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(salesPrice > 0 ? (0, _index.formatPrice)(salesPrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)];
128
135
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
129
- 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), priceCell(catalogPriceExcl), discountInputCell, priceCell(salesPrice)];
136
+ // THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
137
+ // Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
138
+ 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)];
130
139
  case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
131
140
  default:
132
141
  {
@@ -142,6 +151,7 @@ const getMainProductCells = _ref => {
142
151
  * @param {string} params.displayMode - Current display mode
143
152
  * @param {Object} params.priceInfo - Price information for the product
144
153
  * @param {Object} params.discountInputCell - Discount input cell (or empty)
154
+ * @param {boolean} params.showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
145
155
  * @returns {Array} Array of cell configuration objects
146
156
  */
147
157
  exports.getMainProductCells = getMainProductCells;
@@ -149,7 +159,8 @@ const getAccessoryProductCells = _ref2 => {
149
159
  let {
150
160
  displayMode,
151
161
  priceInfo,
152
- discountInputCell
162
+ discountInputCell,
163
+ showCatalogPrice = false
153
164
  } = _ref2;
154
165
  const {
155
166
  purchasePrice,
@@ -166,9 +177,11 @@ const getAccessoryProductCells = _ref2 => {
166
177
  const baseCells = [{}, {}, {}];
167
178
  switch (displayMode) {
168
179
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
169
- return [...baseCells, priceCell(catalogPriceExcl), textCell(hasLocationTotal ? (0, _index.formatPrice)(margin) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(shouldShowPurchasePrice ? (0, _index.formatPrice)(purchasePrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(salesPrice > 0 ? (0, _index.formatPrice)(salesPrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)];
180
+ return [...baseCells, ...(showCatalogPrice ? [priceCell(catalogPriceExcl)] : []), textCell(hasLocationTotal ? (0, _index.formatPrice)(margin) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(shouldShowPurchasePrice ? (0, _index.formatPrice)(purchasePrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(salesPrice > 0 ? (0, _index.formatPrice)(salesPrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)];
170
181
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
171
- 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), priceCell(catalogPriceExcl), discountInputCell, priceCell(salesPrice)];
182
+ // THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
183
+ // Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
184
+ 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)];
172
185
  case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
173
186
  default:
174
187
  {
@@ -186,11 +199,13 @@ const getAccessoryProductCells = _ref2 => {
186
199
  * @param {Object} overrides - Optional overrides for discount/price cells
187
200
  * @param {Object} overrides.discountCell - Override cell for discount column (toggled standard)
188
201
  * @param {Object} overrides.priceCell - Override cell for price column
202
+ * @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
189
203
  * @returns {Array} Array of cell configuration objects
190
204
  */
191
205
  exports.getAccessoryProductCells = getAccessoryProductCells;
192
206
  const getMontageCells = exports.getMontageCells = function getMontageCells(displayMode, montagePrice, montagePriceInclVat) {
193
207
  let overrides = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
208
+ let showCatalogPrice = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
194
209
  const {
195
210
  discountCell: discountOverride,
196
211
  priceCell: priceOverride
@@ -199,9 +214,13 @@ const getMontageCells = exports.getMontageCells = function getMontageCells(displ
199
214
  const nvt = textCell('N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS);
200
215
  switch (displayMode) {
201
216
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
202
- return [...baseCells, nvt, nvt, nvt, priceOverride || priceCell(montagePrice)];
217
+ // THC: Marge - Inkoopprijs - Verkoopprijs (no catalog price)
218
+ // Towmotive: Catalogprijs - Marge - Inkoopprijs - Verkoopprijs
219
+ return [...baseCells, ...(showCatalogPrice ? [nvt] : []), nvt, nvt, priceOverride || priceCell(montagePrice)];
203
220
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
204
- return [...baseCells, nvt, nvt, nvt, discountOverride || emptyCell(_cartTable.CART_TABLE_PRICE_CELL_CLASS), priceOverride || priceCell(montagePrice)];
221
+ // THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
222
+ // Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
223
+ return [...baseCells, nvt, nvt, ...(showCatalogPrice ? [nvt] : []), discountOverride || emptyCell(_cartTable.CART_TABLE_PRICE_CELL_CLASS), priceOverride || priceCell(montagePrice)];
205
224
  case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
206
225
  default:
207
226
  return [discountOverride || {}, {}, {}, {}, {}, priceOverride || priceCell(montagePriceInclVat)];
@@ -215,20 +234,26 @@ const getMontageCells = exports.getMontageCells = function getMontageCells(displ
215
234
  * @param {number} values.purchaseExcl - Purchase price excl VAT
216
235
  * @param {number} values.margin - Margin
217
236
  * @param {number} values.salesExcl - Sales price excl VAT
237
+ * @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
218
238
  * @returns {Array} Array of cell configuration objects
219
239
  */
220
- const getMarketCorrectionCells = (displayMode, _ref3) => {
240
+ const getMarketCorrectionCells = exports.getMarketCorrectionCells = function getMarketCorrectionCells(displayMode, _ref3) {
221
241
  let {
222
242
  purchaseExcl,
223
243
  margin,
224
244
  salesExcl
225
245
  } = _ref3;
246
+ let showCatalogPrice = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
226
247
  const baseCells = [{}, {}, {}];
227
248
  switch (displayMode) {
228
249
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
229
- return [...baseCells, textCell('N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), priceCell(margin), priceCell(purchaseExcl), priceCell(salesExcl)];
250
+ // THC: Marge - Inkoopprijs - Verkoopprijs (no catalog price)
251
+ // Towmotive: Catalogprijs - Marge - Inkoopprijs - Verkoopprijs
252
+ return [...baseCells, ...(showCatalogPrice ? [textCell('N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)] : []), priceCell(margin), priceCell(purchaseExcl), priceCell(salesExcl)];
230
253
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
231
- return [...baseCells, priceCell(purchaseExcl), priceCell(margin), textCell('N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), emptyCell(_cartTable.CART_TABLE_PRICE_CELL_CLASS), priceCell(salesExcl)];
254
+ // THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
255
+ // Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
256
+ 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)];
232
257
  default:
233
258
  return baseCells;
234
259
  }
@@ -241,21 +266,26 @@ const getMarketCorrectionCells = (displayMode, _ref3) => {
241
266
  * @param {Object} params.tmgSubtotals - TMG subtotals
242
267
  * @param {Object} params.standardSubtotals - Standard subtotals
243
268
  * @param {number} params.defaultSubtotal - Default subtotal
269
+ * @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
244
270
  * @returns {Array} Array of cell configuration objects
245
271
  */
246
- exports.getMarketCorrectionCells = getMarketCorrectionCells;
247
- const getSectionTotalCells = (displayMode, _ref4) => {
272
+ const getSectionTotalCells = exports.getSectionTotalCells = function getSectionTotalCells(displayMode, _ref4) {
248
273
  let {
249
274
  tmgSubtotals,
250
275
  standardSubtotals,
251
276
  defaultSubtotal
252
277
  } = _ref4;
278
+ let showCatalogPrice = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
253
279
  const baseCells = [{}, {}];
254
280
  switch (displayMode) {
255
281
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
256
- return [...baseCells, {}, {}, priceCell(tmgSubtotals.catalog, _cartTable.CART_TABLE_BOLD_END_CLASS), priceCell(tmgSubtotals.margin, _cartTable.CART_TABLE_BOLD_END_CLASS), priceCell(tmgSubtotals.purchase, _cartTable.CART_TABLE_BOLD_END_CLASS), textCell((0, _index.formatPrice)(tmgSubtotals.sales), 'fw-bold text-end pb-2')];
282
+ // THC: Marge - Inkoopprijs - Verkoopprijs (no catalog price)
283
+ // Towmotive: Catalogprijs - Marge - Inkoopprijs - Verkoopprijs
284
+ return [...baseCells, {}, {}, ...(showCatalogPrice ? [priceCell(tmgSubtotals.catalog, _cartTable.CART_TABLE_BOLD_END_CLASS)] : []), priceCell(tmgSubtotals.margin, _cartTable.CART_TABLE_BOLD_END_CLASS), priceCell(tmgSubtotals.purchase, _cartTable.CART_TABLE_BOLD_END_CLASS), textCell((0, _index.formatPrice)(tmgSubtotals.sales), 'fw-bold text-end pb-2')];
257
285
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
258
- return [...baseCells, emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Subtotaal inkoopprijs', _cartTable.CART_TABLE_BOLD_END_CLASS), emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS), emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Subtotaal (excl. btw)', 'fw-bold text-end pb-2'), textCell((0, _index.formatPrice)(standardSubtotals.purchase), 'fw-bold text-end pb-2'), textCell((0, _index.formatPrice)(standardSubtotals.sales), 'fw-bold text-end pb-2')];
286
+ // THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
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), ...(showCatalogPrice ? [emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS)] : []), emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Subtotaal (excl. btw)', 'fw-bold text-end pb-2'), textCell((0, _index.formatPrice)(standardSubtotals.purchase), 'fw-bold text-end pb-2'), textCell((0, _index.formatPrice)(standardSubtotals.sales), 'fw-bold text-end pb-2')];
259
289
  case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
260
290
  default:
261
291
  return [...baseCells, {}, {}, {}, textCell('Subtotaal (incl. btw)', 'fw-bold text-end pb-2'), textCell((0, _index.formatPrice)(defaultSubtotal), 'fw-bold text-end pb-2')];
@@ -270,22 +300,27 @@ const getSectionTotalCells = (displayMode, _ref4) => {
270
300
  * @param {number} params.locationValue - Location price value
271
301
  * @param {number} params.consumerValue - Consumer price value
272
302
  * @param {string} params.className - CSS class for cells
303
+ * @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
273
304
  * @returns {Array} Array of cell configuration objects
274
305
  */
275
- exports.getSectionTotalCells = getSectionTotalCells;
276
- const getTotalRowCells = (displayMode, _ref5) => {
306
+ const getTotalRowCells = exports.getTotalRowCells = function getTotalRowCells(displayMode, _ref5) {
277
307
  let {
278
308
  label,
279
309
  locationValue,
280
310
  consumerValue,
281
311
  className = 'text-end'
282
312
  } = _ref5;
313
+ let showCatalogPrice = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
283
314
  const baseCells = [{}, {}, {}];
284
315
  switch (displayMode) {
285
316
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
286
- return [...baseCells, {}, emptyCell(className), textCell(label, className), textCell((0, _index.formatPrice)(locationValue), className), textCell((0, _index.formatPrice)(consumerValue), className)];
317
+ // THC: Marge - Inkoopprijs - Verkoopprijs (no catalog price)
318
+ // Towmotive: Catalogprijs - Marge - Inkoopprijs - Verkoopprijs
319
+ return [...baseCells, {}, ...(showCatalogPrice ? [emptyCell(className)] : []), textCell(label, className), textCell((0, _index.formatPrice)(locationValue), className), textCell((0, _index.formatPrice)(consumerValue), className)];
287
320
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
288
- return [...baseCells, emptyCell(className), emptyCell(className), emptyCell(className), textCell(label, className), textCell((0, _index.formatPrice)(locationValue), className), textCell((0, _index.formatPrice)(consumerValue), className)];
321
+ // THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
322
+ // Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
323
+ return [...baseCells, emptyCell(className), emptyCell(className), ...(showCatalogPrice ? [emptyCell(className)] : []), textCell(label, className), textCell((0, _index.formatPrice)(locationValue), className), textCell((0, _index.formatPrice)(consumerValue), className)];
289
324
  case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
290
325
  default:
291
326
  return [...baseCells, {}, {}, textCell(label, className), textCell((0, _index.formatPrice)(consumerValue), className)];
@@ -299,24 +334,28 @@ const getTotalRowCells = (displayMode, _ref5) => {
299
334
  * @param {string} params.label - Row label
300
335
  * @param {string} params.value - Formatted value string
301
336
  * @param {string} params.className - CSS class for cells
337
+ * @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
302
338
  * @returns {Array} Array of cell configuration objects
303
339
  */
304
- exports.getTotalRowCells = getTotalRowCells;
305
- const getDiscountRowCells = (displayMode, _ref6) => {
340
+ const getDiscountRowCells = exports.getDiscountRowCells = function getDiscountRowCells(displayMode, _ref6) {
306
341
  let {
307
342
  label,
308
343
  value,
309
344
  className = 'text-end'
310
345
  } = _ref6;
346
+ let showCatalogPrice = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
311
347
  const baseCells = [{}, {}, {}];
312
348
  switch (displayMode) {
313
349
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
314
- return [...baseCells, {}, emptyCell(className), emptyCell(className), textCell(label, className), textCell(value, className)];
350
+ // THC: Marge - Inkoopprijs - Verkoopprijs (no catalog price)
351
+ // Towmotive: Catalogprijs - Marge - Inkoopprijs - Verkoopprijs
352
+ return [...baseCells, {}, ...(showCatalogPrice ? [emptyCell(className)] : []), emptyCell(className), textCell(label, className), textCell(value, className)];
315
353
  case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
316
- return [...baseCells, emptyCell(className), emptyCell(className), emptyCell(className), emptyCell(className), textCell(label, className), textCell(value, className)];
354
+ // THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
355
+ // Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
356
+ return [...baseCells, emptyCell(className), emptyCell(className), ...(showCatalogPrice ? [emptyCell(className)] : []), emptyCell(className), textCell(label, className), textCell(value, className)];
317
357
  case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
318
358
  default:
319
359
  return [...baseCells, {}, {}, textCell(label, className), textCell(value, className)];
320
360
  }
321
- };
322
- exports.getDiscountRowCells = getDiscountRowCells;
361
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.272",
3
+ "version": "0.0.273",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",