thm-p3-configurator 0.0.308 → 0.0.310

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.
@@ -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,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.mapBranchFormulaToConfiguratorFormula = exports.VESTIGING_TYPE_ID = exports.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE = exports.VEHICLE_OWNERSHIP_TYPE = exports.VEHICLE_CODING_SUBGROUP_NAME = exports.USER_GEOLOCATION_KEY = exports.TOWMOTIVE_ORGANIZATION_TYPE = exports.TMG_ORGANIZATION_TYPE = exports.StockStatus = exports.STATUS_ASSESSMENT = exports.PRODUCT_CATEGORIES = exports.PRIVATE_SINGLE_ORDER_SESSION_KEY = exports.PARTNER_PORTAL_PAGE_TITLES_BY_THEME = exports.PARTNER_PORTAL_CHANNEL_TITLE = exports.ORDER_SESSION_KEY = exports.NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA = exports.NAVIGATION_STEPS_INTERNAL = exports.NAVIGATION_STEPS_EXTERNAL = exports.NAVIGATION_BUTTONS = exports.MOUSE_EXIT_INTENT_THROTTLE = exports.MOUSE_EXIT_INTENT_OFFSET = exports.LOCATION_TYPE = exports.LOCATION_CHANGE_BUTTON_LABEL = exports.LOCALE = exports.LEASE_TYPE_ID = exports.FORM_ERROR_MESSAGES = exports.DOSSIER_TYPES = exports.DISCOUNT_TYPES = exports.DEFAULT_MAP_LONGITUDE = exports.DEFAULT_MAP_LATITUDE = exports.DEFAULT_ARTICLE_BRAND = exports.DAY_NAMES = exports.CONFIGURATOR_FORMULAS = exports.BRANCH_THEME_BY_FORMULA = exports.BRANCH_FORMULAS = exports.BOARD_COMPUTER_DISABLED_KEY = exports.ApiStockStatus = exports.AUTH_SESSION_KEY = exports.ARTICLE_SPECS_TRANSLATIONS = exports.ARTICLES_SYSTEM_FIELDS = exports.API_ERROR_CODES = exports.ANWB_DISCOUNT_CODE = exports.ALL_EXPERIMENTS = exports.ACTIVE_VARIANTS = void 0;
6
+ exports.mapBranchFormulaToConfiguratorFormula = exports.VESTIGING_TYPE_ID = exports.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE = exports.VEHICLE_OWNERSHIP_TYPE = exports.VEHICLE_CODING_SUBGROUP_NAME = exports.USER_GEOLOCATION_KEY = exports.TOWMOTIVE_ORGANIZATION_TYPE = exports.TMG_ORGANIZATION_TYPE = exports.StockStatus = exports.STATUS_ASSESSMENT = exports.PRODUCT_CATEGORIES = exports.PRIVATE_SINGLE_ORDER_SESSION_KEY = exports.PARTNER_PORTAL_PAGE_TITLES_BY_THEME = exports.PARTNER_PORTAL_CHANNEL_TITLE = exports.ORDER_SESSION_KEY = exports.NO_PRODUCTS_CONTACT_DETAILS_BY_FORMULA = exports.NAVIGATION_STEPS_INTERNAL = exports.NAVIGATION_STEPS_EXTERNAL = exports.NAVIGATION_BUTTONS = exports.MOUSE_EXIT_INTENT_THROTTLE = exports.MOUSE_EXIT_INTENT_OFFSET = exports.LOCATION_TYPE = exports.LOCATION_CHANGE_BUTTON_LABEL = exports.LOCALE = exports.LEASE_TYPE_ID = exports.FORM_ERROR_MESSAGES = exports.DOSSIER_TYPES = exports.DISCOUNT_TYPES = exports.DEFAULT_MAP_LONGITUDE = exports.DEFAULT_MAP_LATITUDE = exports.DEFAULT_ARTICLE_BRAND = exports.DAY_NAMES = exports.CONFIGURATOR_FORMULAS = exports.BRANCH_THEME_BY_FORMULA = exports.BRANCH_FORMULAS = exports.BOARD_COMPUTER_DISABLED_KEY = exports.ApiStockStatus = exports.AUTH_SESSION_KEY = exports.ARTICLE_SPECS_TRANSLATIONS = exports.ARTICLES_SYSTEM_FIELDS = exports.API_ERROR_CODES = exports.ALL_EXPERIMENTS = exports.ACTIVE_VARIANTS = void 0;
7
7
  const DOSSIER_TYPES = exports.DOSSIER_TYPES = {
8
8
  Quotation: 'quotation',
9
9
  AppointmentRequest: 'appointment-request',
@@ -292,7 +292,6 @@ const mapBranchFormulaToConfiguratorFormula = branchFormula => {
292
292
  };
293
293
  exports.mapBranchFormulaToConfiguratorFormula = mapBranchFormulaToConfiguratorFormula;
294
294
  const LOCATION_TYPE = exports.LOCATION_TYPE = 'Vestiging';
295
- const ANWB_DISCOUNT_CODE = exports.ANWB_DISCOUNT_CODE = 'ANWBTHC25';
296
295
  const AUTH_SESSION_KEY = exports.AUTH_SESSION_KEY = '__authSession';
297
296
  const VEHICLE_OWNERSHIP_TYPE = exports.VEHICLE_OWNERSHIP_TYPE = {
298
297
  Particulier: 'Particulier',
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.array.includes.js");
3
4
  require("core-js/modules/es.json.stringify.js");
5
+ require("core-js/modules/es.string.includes.js");
4
6
  require("core-js/modules/es.weak-map.js");
5
7
  require("core-js/modules/esnext.iterator.map.js");
6
8
  require("core-js/modules/web.dom-collections.iterator.js");
@@ -9,14 +11,15 @@ Object.defineProperty(exports, "__esModule", {
9
11
  value: true
10
12
  });
11
13
  exports.default = void 0;
14
+ require("core-js/modules/es.array.includes.js");
12
15
  require("core-js/modules/es.json.stringify.js");
16
+ require("core-js/modules/es.string.includes.js");
13
17
  require("core-js/modules/esnext.iterator.map.js");
14
18
  require("core-js/modules/web.dom-collections.iterator.js");
15
19
  var _react = _interopRequireWildcard(require("react"));
16
20
  var _queries = require("../__api__/queries");
17
21
  var _PrimaryButton = _interopRequireDefault(require("../__components__/Buttons/PrimaryButton"));
18
22
  var _TextInput = _interopRequireDefault(require("../__components__/Form/TextInput"));
19
- var _constants__ = require("../__constants__");
20
23
  var _FormulaContext = require("../__context__/FormulaContext");
21
24
  var _OrderSessionContext = require("../__context__/OrderSessionContext");
22
25
  var _helpers__ = require("../__helpers__");
@@ -126,7 +129,7 @@ const ANWBMembershipValidator = () => {
126
129
  });
127
130
  }
128
131
  };
129
- if (discountCode !== _constants__.ANWB_DISCOUNT_CODE) {
132
+ if (discountCode.toLocaleLowerCase().includes('anwb')) {
130
133
  return null;
131
134
  }
132
135
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.308",
3
+ "version": "0.0.310",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",