thm-p3-configurator 0.0.97 → 0.0.99

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.
@@ -8,8 +8,7 @@ Object.defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
10
  exports.default = void 0;
11
- var _index = _interopRequireDefault(require("./__pages__/index"));
12
- var _InternalBranchSelectorModal = _interopRequireDefault(require("./__containers__/internal/InternalBranchSelectorModal"));
11
+ var _TEST_ONLY_INTERNAL_ROUTES = _interopRequireDefault(require("./__pages__/internal/__TEST_ONLY_INTERNAL_ROUTES"));
13
12
  var _react = _interopRequireWildcard(require("react"));
14
13
  require("react-datepicker/src/stylesheets/datepicker-cssmodules.scss");
15
14
  var _reactGtmModule = _interopRequireDefault(require("react-gtm-module"));
@@ -20,12 +19,14 @@ var _Navbar = _interopRequireDefault(require("./__components__/Navbar"));
20
19
  var _constants__ = require("./__constants__");
21
20
  var _SentryWrapper = _interopRequireDefault(require("./__containers__/SentryWrapper"));
22
21
  var _StyleWrapper = _interopRequireDefault(require("./__containers__/StyleWrapper"));
22
+ var _InternalBranchSelectorModal = _interopRequireDefault(require("./__containers__/internal/InternalBranchSelectorModal"));
23
23
  var _ActiveMarkerContext = require("./__context__/ActiveMarkerContext");
24
24
  var _CountryContext = require("./__context__/CountryContext");
25
25
  var _FormulaContext = require("./__context__/FormulaContext");
26
26
  var _OrderSessionContext = require("./__context__/OrderSessionContext");
27
27
  var _cookiebot = require("./__helpers__/cookiebot");
28
28
  var _queryClient = _interopRequireDefault(require("./__helpers__/queryClient"));
29
+ var _index = _interopRequireDefault(require("./__pages__/index"));
29
30
  var _Experiments = _interopRequireDefault(require("./__services__/Experiments"));
30
31
  var _mainExternal = _interopRequireDefault(require("./__style__/main-external.scss"));
31
32
  var _main = _interopRequireDefault(require("./__style__/main.scss"));
@@ -59,8 +60,6 @@ function _interopRequireDefault(e) {
59
60
  default: e
60
61
  };
61
62
  }
62
- // import TEST_ONLY_INTERNAL_ROUTES from './__pages__/internal/__TEST_ONLY_INTERNAL_ROUTES';
63
-
64
63
  _reactGtmModule.default.initialize({
65
64
  gtmId: APP_CONFIG.googleTagManagerId || 'GTM-TC67SZ4'
66
65
  });
@@ -76,6 +75,6 @@ const App = () => {
76
75
  defaultCountry: APP_CONFIG.country
77
76
  }, /*#__PURE__*/_react.default.createElement(_OrderSessionContext.OrderSessionController, null, /*#__PURE__*/_react.default.createElement(_reactQuery.QueryClientProvider, {
78
77
  client: _queryClient.default
79
- }, /*#__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(_index.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))))))))));
80
79
  };
81
80
  var _default = exports.default = App;
@@ -11,9 +11,7 @@ require("core-js/modules/esnext.iterator.for-each.js");
11
11
  require("core-js/modules/esnext.iterator.map.js");
12
12
  require("core-js/modules/web.dom-collections.iterator.js");
13
13
  require("core-js/modules/web.url-search-params.js");
14
- require("core-js/modules/esnext.iterator.constructor.js");
15
14
  require("core-js/modules/esnext.iterator.filter.js");
16
- require("core-js/modules/esnext.iterator.for-each.js");
17
15
  Object.defineProperty(exports, "__esModule", {
18
16
  value: true
19
17
  });
@@ -23,6 +21,8 @@ require("core-js/modules/es.json.stringify.js");
23
21
  require("core-js/modules/es.object.from-entries.js");
24
22
  require("core-js/modules/es.promise.js");
25
23
  require("core-js/modules/es.regexp.to-string.js");
24
+ require("core-js/modules/esnext.iterator.constructor.js");
25
+ require("core-js/modules/esnext.iterator.for-each.js");
26
26
  require("core-js/modules/esnext.iterator.map.js");
27
27
  require("core-js/modules/web.dom-collections.iterator.js");
28
28
  require("core-js/modules/web.url-search-params.js");
@@ -279,8 +279,9 @@ const useSingleOrderArticles = exports.useSingleOrderArticles = function useSing
279
279
  totalArticles: 0
280
280
  };
281
281
  }
282
+ const currentArticles = await (0, _singleOrderArticles.enrichArticlesWithBrandsAndPrices)(articles, branchId, formula);
282
283
  return {
283
- articles: await (0, _singleOrderArticles.enrichArticlesWithBrandsAndPrices)(articles, branchId, formula),
284
+ articles: currentArticles,
284
285
  totalArticles: totalCount
285
286
  };
286
287
  }
@@ -300,6 +301,31 @@ const useSingleOrderCart = () => {
300
301
  singleOrderCart,
301
302
  singleOrderFormulaCode
302
303
  }] = (0, _OrderSessionContext.useOrderSession)();
304
+
305
+ // Create lookup map for cart totals
306
+ let totalQuantity = 0;
307
+ let totalBtw = 0;
308
+ let totalExclVat = 0;
309
+ let totalInclVat = 0;
310
+ const cartTotalsLookup = {};
311
+ singleOrderCart.forEach(article => {
312
+ const productBtw = (article.productPriceInclVat - article.productPrice) * article.quantity;
313
+ const productTotalExclVat = article.productPrice * article.quantity;
314
+ const productTotalInclVat = article.productPriceInclVat * article.quantity;
315
+ totalQuantity += article.quantity;
316
+ totalBtw += productBtw;
317
+ totalExclVat += productTotalExclVat;
318
+ totalInclVat += productTotalInclVat;
319
+ cartTotalsLookup[article.articleNumber] = {
320
+ productBtw,
321
+ productTotalExclVat,
322
+ productTotalInclVat,
323
+ quantity: article.quantity,
324
+ productPrice: article.productPrice,
325
+ individualPriceInclVat: article.productPriceInclVat,
326
+ individualPriceExclVat: article.productPrice
327
+ };
328
+ });
303
329
  let formula = (0, _FormulaContext.useFormula)();
304
330
  if (singleOrderFormulaCode) {
305
331
  formula = singleOrderFormulaCode;
@@ -329,14 +355,28 @@ const useSingleOrderCart = () => {
329
355
  const cartLookup = Object.fromEntries(cart.map(item => [item.articleNumber, item]));
330
356
  const articlesWithPrice = articles === null || articles === void 0 || (_articles$articles = articles.articles) === null || _articles$articles === void 0 ? void 0 : _articles$articles.map(article => {
331
357
  const cartItem = cartLookup[article.articleNumber];
358
+ const totals = cartTotalsLookup[article.articleNumber];
332
359
  return _objectSpread(_objectSpread({}, article), {}, {
333
360
  price: cartItem !== null && cartItem !== void 0 && cartItem.consumerTotal ? Math.round(Number(cartItem === null || cartItem === void 0 ? void 0 : cartItem.consumerTotal) * 100) / 100 : 0,
334
- quantity: Number(cartItem === null || cartItem === void 0 ? void 0 : cartItem.quantity)
361
+ quantity: Number(cartItem === null || cartItem === void 0 ? void 0 : cartItem.quantity),
362
+ // Add the calculated totals
363
+ productBtw: totals === null || totals === void 0 ? void 0 : totals.productBtw,
364
+ productTotalExclVat: totals === null || totals === void 0 ? void 0 : totals.productTotalExclVat,
365
+ productTotalInclVat: totals === null || totals === void 0 ? void 0 : totals.productTotalInclVat,
366
+ productPrice: totals === null || totals === void 0 ? void 0 : totals.productPrice,
367
+ productPriceInclVat: totals === null || totals === void 0 ? void 0 : totals.productPriceInclVat,
368
+ individualPriceInclVat: totals === null || totals === void 0 ? void 0 : totals.individualPriceInclVat,
369
+ individualPriceExclVat: totals === null || totals === void 0 ? void 0 : totals.individualPriceExclVat
335
370
  });
336
371
  });
337
372
  return {
338
373
  articles: articlesWithPrice,
339
- totals: orderResults.data.totals
374
+ totals: {
375
+ totalQuantity: Math.round(totalQuantity * 100) / 100,
376
+ totalBtw: Math.round(totalBtw * 100) / 100,
377
+ totalExclVat: Math.round(totalExclVat * 100) / 100,
378
+ totalInclVat: Math.round(totalInclVat * 100) / 100
379
+ }
340
380
  };
341
381
  }
342
382
  });
@@ -36,7 +36,7 @@ const ProductTableEditableRow = _ref => {
36
36
  src: productImage || _logoPrimary.default,
37
37
  alt: "product"
38
38
  })), /*#__PURE__*/_react.default.createElement("div", {
39
- className: (0, _helpers__.withStyle)('col container g-0')
39
+ className: (0, _helpers__.withStyle)('col')
40
40
  }, /*#__PURE__*/_react.default.createElement("p", null, productTitle), /*#__PURE__*/_react.default.createElement("div", {
41
41
  className: (0, _helpers__.withStyle)('row mt-0 flex-row flex-md-column flex-wrap flex-md-nowrap')
42
42
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -31,7 +31,7 @@ const ProductTableStaticRow = _ref => {
31
31
  src: productImage || _logoPrimary.default,
32
32
  alt: "product"
33
33
  })), /*#__PURE__*/_react.default.createElement("div", {
34
- className: (0, _helpers__.withStyle)('col container g-0')
34
+ className: (0, _helpers__.withStyle)('col')
35
35
  }, /*#__PURE__*/_react.default.createElement("p", null, productTitle)))), extraCells.map((_ref2, index) => {
36
36
  let {
37
37
  className = '',
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.number.to-fixed.js");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = void 0;
8
+ require("core-js/modules/es.number.to-fixed.js");
7
9
  var _react = _interopRequireDefault(require("react"));
8
10
  var _helpers__ = require("../__helpers__");
9
11
  var _LinkButton = _interopRequireDefault(require("./Buttons/LinkButton"));
@@ -36,6 +38,8 @@ const SingleOrderCartCard = _ref2 => {
36
38
  productImage,
37
39
  productTitle,
38
40
  productPrice,
41
+ productPriceInclVat,
42
+ productPriceExclVat,
39
43
  quantity = 0,
40
44
  handleQuantityChange,
41
45
  removeFromCart
@@ -57,14 +61,14 @@ const SingleOrderCartCard = _ref2 => {
57
61
  className: (0, _helpers__.withStyle)('mb-0')
58
62
  }, productTitle), /*#__PURE__*/_react.default.createElement("p", {
59
63
  className: (0, _helpers__.withStyle)('ms-2 fw-bold')
60
- }, "\u20AC", productPrice)), /*#__PURE__*/_react.default.createElement("div", {
64
+ }, "\u20AC", Number(productPrice).toFixed(2))), /*#__PURE__*/_react.default.createElement("div", {
61
65
  className: (0, _helpers__.withStyle)('d-flex mt-1 justify-content-between align-items-center')
62
66
  }, /*#__PURE__*/_react.default.createElement(_NumericInput.default, {
63
67
  className: (0, _helpers__.withStyle)('me-2 rounded'),
64
68
  width: "100px",
65
69
  height: "40px",
66
70
  defaultValue: quantity,
67
- onChange: value => handleQuantityChange(productId, value),
71
+ onChange: value => handleQuantityChange(productId, value, productPriceExclVat, productPriceInclVat),
68
72
  buttonTransformY: 40
69
73
  }), /*#__PURE__*/_react.default.createElement(_LinkButton.default, {
70
74
  label: "Verwijder",
@@ -1,22 +1,16 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.symbol.description.js");
4
- require("core-js/modules/es.weak-map.js");
5
3
  require("core-js/modules/esnext.iterator.constructor.js");
6
4
  require("core-js/modules/esnext.iterator.filter.js");
7
5
  require("core-js/modules/esnext.iterator.map.js");
8
- require("core-js/modules/web.dom-collections.iterator.js");
9
- require("core-js/modules/es.weak-map.js");
10
- require("core-js/modules/web.dom-collections.iterator.js");
11
6
  Object.defineProperty(exports, "__esModule", {
12
7
  value: true
13
8
  });
14
9
  exports.default = void 0;
15
- require("core-js/modules/es.symbol.description.js");
16
10
  require("core-js/modules/esnext.iterator.constructor.js");
17
11
  require("core-js/modules/esnext.iterator.filter.js");
18
12
  require("core-js/modules/esnext.iterator.map.js");
19
- var _react = _interopRequireWildcard(require("react"));
13
+ var _react = _interopRequireDefault(require("react"));
20
14
  var _queries = require("../__api__/queries");
21
15
  var _NumericInput = _interopRequireDefault(require("../__components__/Form/NumericInput"));
22
16
  var _helpers__ = require("../__helpers__");
@@ -29,31 +23,6 @@ function _interopRequireDefault(e) {
29
23
  default: e
30
24
  };
31
25
  }
32
- function _getRequireWildcardCache(e) {
33
- if ("function" != typeof WeakMap) return null;
34
- var r = new WeakMap(),
35
- t = new WeakMap();
36
- return (_getRequireWildcardCache = function _getRequireWildcardCache(e) {
37
- return e ? t : r;
38
- })(e);
39
- }
40
- function _interopRequireWildcard(e, r) {
41
- if (!r && e && e.__esModule) return e;
42
- if (null === e || "object" != typeof e && "function" != typeof e) return {
43
- default: e
44
- };
45
- var t = _getRequireWildcardCache(r);
46
- if (t && t.has(e)) return t.get(e);
47
- var n = {
48
- __proto__: null
49
- },
50
- a = Object.defineProperty && Object.getOwnPropertyDescriptor;
51
- for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
52
- var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
53
- i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
54
- }
55
- return n.default = e, t && t.set(e, n), n;
56
- }
57
26
  const ProductImage = _ref => {
58
27
  let {
59
28
  productImage
@@ -66,42 +35,19 @@ const ProductImage = _ref => {
66
35
  alt: ""
67
36
  }));
68
37
  };
69
- const ProductDescription = _ref2 => {
70
- let {
71
- description
72
- } = _ref2;
73
- return description && /*#__PURE__*/_react.default.createElement("div", {
74
- className: (0, _helpers__.withStyle)('card-text mb-3')
75
- }, /*#__PURE__*/_react.default.createElement("strong", null, "Omschrijving: "), (description !== null && description !== void 0 ? description : 'Niet beschikbaar').split('\n').map((line, index) => /*#__PURE__*/_react.default.createElement(_react.Fragment, {
76
- key: index
77
- }, line, /*#__PURE__*/_react.default.createElement("br", null))));
78
- };
79
- const ProductSpecifications = _ref3 => {
80
- let {
81
- specifications
82
- } = _ref3;
83
- return specifications && /*#__PURE__*/_react.default.createElement("div", {
84
- className: (0, _helpers__.withStyle)('card-text mb-3')
85
- }, /*#__PURE__*/_react.default.createElement("strong", null, "Specificaties: "), /*#__PURE__*/_react.default.createElement("br", null), specifications.map((_ref4, index) => {
86
- let {
87
- key,
88
- value
89
- } = _ref4;
90
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
91
- key: index
92
- }, key, ": ", value, /*#__PURE__*/_react.default.createElement("br", null));
93
- }));
94
- };
95
- const ProductActions = _ref5 => {
38
+ const ProductActions = _ref2 => {
96
39
  let {
40
+ isTmg,
97
41
  isOutOfStock,
98
42
  stock,
99
43
  quantity,
100
44
  productId,
101
45
  handleQuantityChange,
102
46
  handleSelected,
103
- removeFromCart
104
- } = _ref5;
47
+ removeFromCart,
48
+ productPrice,
49
+ productPriceInclVat
50
+ } = _ref2;
105
51
  return /*#__PURE__*/_react.default.createElement("div", {
106
52
  className: (0, _helpers__.withStyle)('d-flex justify-content-end')
107
53
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -110,30 +56,30 @@ const ProductActions = _ref5 => {
110
56
  className: (0, _helpers__.withStyle)('text-danger mb-1')
111
57
  }, "Niet op voorraad") : /*#__PURE__*/_react.default.createElement("div", {
112
58
  className: (0, _helpers__.withStyle)('text-success mb-1')
113
- }, stock, " op voorraad"), /*#__PURE__*/_react.default.createElement("div", {
59
+ }, isTmg ? "".concat(stock, " op voorraad") : 'Op voorraad'), /*#__PURE__*/_react.default.createElement("div", {
114
60
  className: (0, _helpers__.withStyle)('d-flex align-items-center')
115
61
  }, /*#__PURE__*/_react.default.createElement(_NumericInput.default, {
116
62
  className: (0, _helpers__.withStyle)('me-2 rounded'),
117
63
  width: "100px",
118
64
  height: "55px",
119
65
  defaultValue: quantity,
120
- onChange: value => handleQuantityChange(productId, value),
66
+ onChange: value => handleQuantityChange(productId, value, productPrice, productPriceInclVat),
121
67
  buttonTransformY: 40
122
68
  }), quantity === 0 ? /*#__PURE__*/_react.default.createElement(_PrimaryButton.default, {
123
- onClick: () => handleSelected(productId, quantity + 1),
69
+ onClick: () => handleSelected(productId, quantity + 1, productPrice, productPriceInclVat),
124
70
  label: "Toevoegen"
125
71
  }) : /*#__PURE__*/_react.default.createElement(_OutlinedButton.default, {
126
72
  onClick: () => removeFromCart(productId),
127
73
  label: "Verwijder"
128
74
  }))));
129
75
  };
130
- const ProductCategories = _ref6 => {
76
+ const ProductCategories = _ref3 => {
131
77
  let {
132
78
  productType = null,
133
79
  productGroup = null,
134
80
  productSubgroup = null,
135
81
  articleNumber = null
136
- } = _ref6;
82
+ } = _ref3;
137
83
  return /*#__PURE__*/_react.default.createElement("div", null, articleNumber && /*#__PURE__*/_react.default.createElement("p", {
138
84
  className: (0, _helpers__.withStyle)('fst-italic mb-0')
139
85
  }, /*#__PURE__*/_react.default.createElement("strong", null, "Artikelnummer:"), " ", articleNumber), productType && /*#__PURE__*/_react.default.createElement("p", {
@@ -144,7 +90,7 @@ const ProductCategories = _ref6 => {
144
90
  className: (0, _helpers__.withStyle)('fst-italic mb-0')
145
91
  }, /*#__PURE__*/_react.default.createElement("strong", null, "Subgroep:"), " ", productSubgroup));
146
92
  };
147
- const SingleOrderProductCard = _ref7 => {
93
+ const SingleOrderProductCard = _ref4 => {
148
94
  let {
149
95
  productId,
150
96
  isSelected,
@@ -159,25 +105,27 @@ const SingleOrderProductCard = _ref7 => {
159
105
  productUsps,
160
106
  productTitle,
161
107
  productPrice,
108
+ productPriceInclVat,
162
109
  productSpecifications,
163
110
  quantity = 0,
164
111
  handleQuantityChange,
165
112
  removeFromCart,
166
- isModelArticle = false
167
- } = _ref7;
113
+ isModelArticle = false,
114
+ isTmg = false
115
+ } = _ref4;
168
116
  const {
169
117
  productFieldLabels
170
118
  } = (0, _queries.useProductFieldLabels)();
171
- const filteredProductSpecifications = productSpecifications.filter(_ref8 => {
119
+ const filteredProductSpecifications = productSpecifications.filter(_ref5 => {
172
120
  let {
173
121
  key
174
- } = _ref8;
122
+ } = _ref5;
175
123
  return productFieldLabels === null || productFieldLabels === void 0 ? void 0 : productFieldLabels[key];
176
- }).map(_ref9 => {
124
+ }).map(_ref6 => {
177
125
  let {
178
126
  key,
179
127
  value
180
- } = _ref9;
128
+ } = _ref6;
181
129
  return {
182
130
  key: productFieldLabels[key],
183
131
  value
@@ -214,11 +162,14 @@ const SingleOrderProductCard = _ref7 => {
214
162
  }))), /*#__PURE__*/_react.default.createElement(ProductActions, {
215
163
  isOutOfStock: isOutOfStock,
216
164
  stock: stock,
165
+ isTmg: isTmg,
217
166
  quantity: quantity,
218
167
  productId: productId,
219
168
  handleQuantityChange: handleQuantityChange,
220
169
  handleSelected: handleSelected,
221
- removeFromCart: removeFromCart
170
+ removeFromCart: removeFromCart,
171
+ productPrice: productPrice,
172
+ productPriceInclVat: productPriceInclVat
222
173
  })))));
223
174
  };
224
175
  var _default = exports.default = SingleOrderProductCard;
@@ -7,6 +7,7 @@ require("core-js/modules/es.weak-map.js");
7
7
  require("core-js/modules/esnext.iterator.constructor.js");
8
8
  require("core-js/modules/esnext.iterator.filter.js");
9
9
  require("core-js/modules/esnext.iterator.for-each.js");
10
+ require("core-js/modules/esnext.iterator.map.js");
10
11
  require("core-js/modules/web.dom-collections.iterator.js");
11
12
  require("core-js/modules/es.weak-map.js");
12
13
  require("core-js/modules/esnext.iterator.constructor.js");
@@ -19,6 +20,7 @@ exports.default = void 0;
19
20
  require("core-js/modules/es.promise.js");
20
21
  require("core-js/modules/es.regexp.exec.js");
21
22
  require("core-js/modules/es.string.replace.js");
23
+ require("core-js/modules/esnext.iterator.map.js");
22
24
  require("core-js/modules/web.dom-collections.iterator.js");
23
25
  var _react = _interopRequireWildcard(require("react"));
24
26
  var _reactRouter = require("react-router");
@@ -132,7 +134,8 @@ const AppointmentForm = () => {
132
134
  executionAnswer1,
133
135
  executionAnswer2,
134
136
  priceCalculationDate,
135
- selectedDiscountedProducts = []
137
+ selectedDiscountedProducts = [],
138
+ selectedExtras
136
139
  }, dispatch] = (0, _OrderSessionContext.useOrderSession)();
137
140
  const [errors, setErrors] = (0, _react.useState)({});
138
141
  const [isTermsAccepted, setIsTermsAccepted] = (0, _react.useState)(false);
@@ -181,7 +184,13 @@ const AppointmentForm = () => {
181
184
  }, {
182
185
  articleNumber: selectedTowbar,
183
186
  quantity: 1
184
- }, ...selectedDiscountedProducts])
187
+ }, ...Object.entries(selectedExtras).map(_ref => {
188
+ let [extraArticleNumber, extraQuantity] = _ref;
189
+ return {
190
+ articleNumber: extraArticleNumber,
191
+ quantity: extraQuantity
192
+ };
193
+ }), ...selectedDiscountedProducts])
185
194
  }));
186
195
  } catch (ex) {
187
196
  console.error("handleSubmit(): ".concat(ex));
@@ -7,6 +7,7 @@ require("core-js/modules/es.weak-map.js");
7
7
  require("core-js/modules/esnext.iterator.constructor.js");
8
8
  require("core-js/modules/esnext.iterator.filter.js");
9
9
  require("core-js/modules/esnext.iterator.for-each.js");
10
+ require("core-js/modules/esnext.iterator.map.js");
10
11
  require("core-js/modules/web.dom-collections.iterator.js");
11
12
  require("core-js/modules/es.weak-map.js");
12
13
  require("core-js/modules/esnext.iterator.constructor.js");
@@ -19,6 +20,7 @@ exports.default = void 0;
19
20
  require("core-js/modules/es.array.includes.js");
20
21
  require("core-js/modules/es.promise.js");
21
22
  require("core-js/modules/es.string.includes.js");
23
+ require("core-js/modules/esnext.iterator.map.js");
22
24
  require("core-js/modules/web.dom-collections.iterator.js");
23
25
  var _lodash = require("lodash");
24
26
  var _react = _interopRequireWildcard(require("react"));
@@ -134,7 +136,8 @@ const ExitIntentModal = () => {
134
136
  executionAnswer1,
135
137
  executionAnswer2,
136
138
  priceCalculationDate,
137
- selectedDiscountedProducts = []
139
+ selectedDiscountedProducts = [],
140
+ selectedExtras
138
141
  }, dispatch] = (0, _OrderSessionContext.useOrderSession)();
139
142
  const formula = (0, _FormulaContext.useFormula)();
140
143
  (0, _react.useEffect)(() => {
@@ -197,10 +200,13 @@ const ExitIntentModal = () => {
197
200
  }, {
198
201
  articleNumber: selectedTowbar,
199
202
  quantity: 1
200
- }, {
201
- articleNumber: selectedCableset,
202
- quantity: 1
203
- }, ...selectedDiscountedProducts])
203
+ }, ...Object.entries(selectedExtras).map(_ref => {
204
+ let [extraArticleNumber, extraQuantity] = _ref;
205
+ return {
206
+ articleNumber: extraArticleNumber,
207
+ quantity: extraQuantity
208
+ };
209
+ }), ...selectedDiscountedProducts])
204
210
  }));
205
211
  } catch (ex) {
206
212
  console.error("handleSubmit(): ".concat(ex));
@@ -59,6 +59,7 @@ const ManualSelectionForm = _ref => {
59
59
  var _initialValues$model;
60
60
  let {
61
61
  onSubmit,
62
+ canSearchLicenseplate = true,
62
63
  initialValues = null,
63
64
  isFilter = false,
64
65
  filterModalChange = () => {}
@@ -205,7 +206,7 @@ const ManualSelectionForm = _ref => {
205
206
  value: model,
206
207
  label: model
207
208
  }
208
- }), /*#__PURE__*/_react.default.createElement("div", {
209
+ }), canSearchLicenseplate && /*#__PURE__*/_react.default.createElement("div", {
209
210
  className: (0, _helpers__.withStyle)('row mt-3')
210
211
  }, /*#__PURE__*/_react.default.createElement("div", {
211
212
  className: (0, _helpers__.withStyle)('d-grid gap-2')
@@ -30,6 +30,7 @@ require("core-js/modules/esnext.iterator.reduce.js");
30
30
  require("core-js/modules/web.dom-collections.iterator.js");
31
31
  var _react = _interopRequireWildcard(require("react"));
32
32
  var _logoPrimary = _interopRequireDefault(require("../../../public/assets/images/logo-primary.png"));
33
+ var _montagePlaceholder = _interopRequireDefault(require("../../../public/assets/images/montage-placeholder.png"));
33
34
  var _queries = require("../__api__/queries");
34
35
  var _TogglableCard = _interopRequireDefault(require("../__components__/Cards/TogglableCard"));
35
36
  var _ProductTableEditableRow = _interopRequireDefault(require("../__components__/ProductTable/ProductTableEditableRow"));
@@ -165,15 +166,20 @@ const ProductCartTable = () => {
165
166
  };
166
167
 
167
168
  // Calculate subtotal for main products
168
- const subtotalPriceProducts = (cart === null || cart === void 0 ? void 0 : cart.reduce((acc, item) => {
169
- if (mainProducts.find(product => product.articleNumber === item.articleNumber)) {
170
- const {
171
- salesPrice
172
- } = getItemPrices(item);
173
- return acc + salesPrice * 1.21;
174
- }
175
- return acc;
176
- }, 0)) || 0;
169
+ let subtotalPriceProducts = 0;
170
+ if (isToggled) {
171
+ subtotalPriceProducts = (cart === null || cart === void 0 ? void 0 : cart.reduce((acc, item) => {
172
+ if (mainProducts.find(product => product.articleNumber === item.articleNumber)) {
173
+ const {
174
+ salesPrice
175
+ } = getItemPrices(item);
176
+ return acc + salesPrice * 1.21;
177
+ }
178
+ return acc;
179
+ }, 0)) || 0;
180
+ } else {
181
+ subtotalPriceProducts = subtotalPriceProducts + (isToggled ? totals === null || totals === void 0 ? void 0 : totals.subtotalMontagePurchaseExclVat : (totals === null || totals === void 0 ? void 0 : totals.subtotalMontageExclVat) * 1.21);
182
+ }
177
183
 
178
184
  // Calculate subtotal for accessories
179
185
  const subtotalPriceAccessoires = (cart === null || cart === void 0 ? void 0 : cart.reduce((acc, item) => {
@@ -200,8 +206,6 @@ const ProductCartTable = () => {
200
206
 
201
207
  // Calculate original total
202
208
  const calculateOriginalTotal = () => {
203
- const totalExclVat = isToggled ? (totals === null || totals === void 0 ? void 0 : totals.subtotalMontagePurchaseExclVat) || 0 : (totals === null || totals === void 0 ? void 0 : totals.subtotalMontageExclVat) || 0;
204
- const totalVat = isToggled ? (totals === null || totals === void 0 ? void 0 : totals.totalPurchaseVatAfterDiscount) || 0 : (totals === null || totals === void 0 ? void 0 : totals.totalVatAfterDiscount) || 0;
205
209
  return subtotalPriceProducts + subtotalPriceAccessoires;
206
210
  };
207
211
 
@@ -261,17 +265,24 @@ const ProductCartTable = () => {
261
265
  productImage: product !== null && product !== void 0 && (_product$images = product.images) !== null && _product$images !== void 0 && _product$images[0] ? (0, _image.getImageFromHyper)({
262
266
  imageId: (_product$images2 = product.images) === null || _product$images2 === void 0 ? void 0 : _product$images2[0]
263
267
  }) : _logoPrimary.default,
264
- extraCells: [{}, {}, ...(isToggled ? [{
265
- text: (0, _helpers__.formatPrice)(purchasePrice),
266
- className: 'cart__table-price text-end'
267
- }, {
268
- text: "".concat((0, _helpers__.formatPrice)(margin), " (").concat(marginPercentage, "%)"),
269
- className: 'cart__table-price text-end'
270
- }] : [{}, {}]), {
271
- text: (0, _helpers__.formatPrice)(isToggled ? salesPrice : salesPriceInclVat),
268
+ extraCells: [{}, {}, ...(isToggled ? [{}, {}] : [{}, {}]), {
269
+ text: salesPrice !== 0 || salesPriceInclVat !== 0 ? (0, _helpers__.formatPrice)(isToggled ? salesPrice : salesPriceInclVat) : '',
272
270
  className: 'cart__table-price text-end'
273
271
  }]
274
272
  });
273
+ }), mainProducts && /*#__PURE__*/_react.default.createElement(_ProductTableStaticRow.default, {
274
+ productTitle: 'Montage',
275
+ productImage: _montagePlaceholder.default,
276
+ extraCells: [{}, {}, ...(isToggled ? [{
277
+ text: (0, _helpers__.formatPrice)(purchasePrice),
278
+ className: 'cart__table-price text-end'
279
+ }, {
280
+ text: "".concat((0, _helpers__.formatPrice)(margin), " (").concat(marginPercentage, "%)"),
281
+ className: 'cart__table-price text-end'
282
+ }] : [{}, {}]), {
283
+ text: (0, _helpers__.formatPrice)(isToggled ? totals === null || totals === void 0 ? void 0 : totals.montagePricePlusMarketCorrectionExclVat : totals === null || totals === void 0 ? void 0 : totals.montagePricePlusMarketCorrectionInclVat),
284
+ className: 'cart__table-price text-end'
285
+ }]
275
286
  }), /*#__PURE__*/_react.default.createElement(_ProductTableSectionTotal.default, {
276
287
  isEditable: true,
277
288
  editLabel: 'Wijzig je trekhaakpakket',
@@ -5,6 +5,7 @@ require("core-js/modules/es.weak-map.js");
5
5
  require("core-js/modules/esnext.iterator.constructor.js");
6
6
  require("core-js/modules/esnext.iterator.filter.js");
7
7
  require("core-js/modules/esnext.iterator.for-each.js");
8
+ require("core-js/modules/esnext.iterator.map.js");
8
9
  require("core-js/modules/web.dom-collections.iterator.js");
9
10
  require("core-js/modules/es.weak-map.js");
10
11
  require("core-js/modules/esnext.iterator.constructor.js");
@@ -15,6 +16,7 @@ Object.defineProperty(exports, "__esModule", {
15
16
  });
16
17
  exports.default = void 0;
17
18
  require("core-js/modules/es.promise.js");
19
+ require("core-js/modules/esnext.iterator.map.js");
18
20
  require("core-js/modules/web.dom-collections.iterator.js");
19
21
  var _react = _interopRequireWildcard(require("react"));
20
22
  var _reactRouter = require("react-router");
@@ -127,7 +129,8 @@ const QuotationForm = () => {
127
129
  selectedTowbar,
128
130
  selectedBranch,
129
131
  discountCode,
130
- selectedDiscountedProducts = []
132
+ selectedDiscountedProducts = [],
133
+ selectedExtras
131
134
  }, dispatch] = (0, _OrderSessionContext.useOrderSession)();
132
135
  const [errors, setErrors] = (0, _react.useState)({});
133
136
  const [isTermsAccepted, setIsTermsAccepted] = (0, _react.useState)(false);
@@ -175,7 +178,13 @@ const QuotationForm = () => {
175
178
  }, {
176
179
  articleNumber: selectedTowbar,
177
180
  quantity: 1
178
- }, ...selectedDiscountedProducts])
181
+ }, ...Object.entries(selectedExtras).map(_ref => {
182
+ let [extraArticleNumber, extraQuantity] = _ref;
183
+ return {
184
+ articleNumber: extraArticleNumber,
185
+ quantity: extraQuantity
186
+ };
187
+ }), ...selectedDiscountedProducts])
179
188
  }));
180
189
  } catch (ex) {
181
190
  console.error("handleSubmit(): ".concat(ex));
@@ -177,7 +177,8 @@ const InternalAppointmentForm = _ref => {
177
177
  selectedDiscountedProducts = [],
178
178
  executionAnswer1,
179
179
  executionAnswer2,
180
- priceCalculationDate
180
+ priceCalculationDate,
181
+ selectedExtras
181
182
  }, dispatch] = (0, _OrderSessionContext.useOrderSession)();
182
183
  const [errors, setErrors] = (0, _react.useState)({});
183
184
  const [_licensePlate, _setLicensePlate] = (0, _react.useState)();
@@ -309,7 +310,13 @@ const InternalAppointmentForm = _ref => {
309
310
  }, {
310
311
  articleNumber: selectedTowbar,
311
312
  quantity: 1
312
- }, ...selectedDiscountedProducts])
313
+ }, ...Object.entries(selectedExtras).map(_ref3 => {
314
+ let [extraArticleNumber, extraQuantity] = _ref3;
315
+ return {
316
+ articleNumber: extraArticleNumber,
317
+ quantity: extraQuantity
318
+ };
319
+ }), ...selectedDiscountedProducts])
313
320
  }));
314
321
  } catch (ex) {
315
322
  console.error("handleSubmit(): ".concat(ex));
@@ -392,12 +399,12 @@ const InternalAppointmentForm = _ref => {
392
399
  placeholder: "Maak een keuze",
393
400
  errorMessage: (errors === null || errors === void 0 ? void 0 : errors['channelType']) || (errors === null || errors === void 0 ? void 0 : errors['channelId']),
394
401
  initialValue: initialChannel,
395
- onChange: _ref3 => {
402
+ onChange: _ref4 => {
396
403
  var _value$kanaalType;
397
404
  let {
398
405
  label,
399
406
  value
400
- } = _ref3;
407
+ } = _ref4;
401
408
  return dispatch({
402
409
  type: _OrderSessionContext.orderSessionActions.SET_MARKETING_CHANNEL,
403
410
  payload: {
@@ -167,7 +167,8 @@ const InternalQuotationForm = _ref => {
167
167
  discountAmount,
168
168
  discountPercentage,
169
169
  selectedDiscountedProducts = [],
170
- channel
170
+ channel,
171
+ selectedExtras
171
172
  }, dispatch] = (0, _OrderSessionContext.useOrderSession)();
172
173
  const [errors, setErrors] = (0, _react.useState)({});
173
174
  const [_licensePlate, _setLicensePlate] = (0, _react.useState)(licensePlate);
@@ -298,7 +299,13 @@ const InternalQuotationForm = _ref => {
298
299
  }, {
299
300
  articleNumber: selectedTowbar,
300
301
  quantity: 1
301
- }, ...selectedDiscountedProducts])
302
+ }, ...Object.entries(selectedExtras).map(_ref3 => {
303
+ let [extraArticleNumber, extraQuantity] = _ref3;
304
+ return {
305
+ articleNumber: extraArticleNumber,
306
+ quantity: extraQuantity
307
+ };
308
+ }), ...selectedDiscountedProducts])
302
309
  }));
303
310
  } catch (ex) {
304
311
  console.error("handleSubmit(): ".concat(ex));
@@ -330,12 +337,12 @@ const InternalQuotationForm = _ref => {
330
337
  placeholder: "Maak een keuze",
331
338
  errorMessage: (errors === null || errors === void 0 ? void 0 : errors['channelId']) || (errors === null || errors === void 0 ? void 0 : errors['channelType']),
332
339
  initialValue: initialChannel,
333
- onChange: _ref3 => {
340
+ onChange: _ref4 => {
334
341
  var _value$kanaalType;
335
342
  let {
336
343
  label,
337
344
  value
338
- } = _ref3;
345
+ } = _ref4;
339
346
  return dispatch({
340
347
  type: _OrderSessionContext.orderSessionActions.SET_MARKETING_CHANNEL,
341
348
  payload: {
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.number.to-fixed.js");
3
4
  require("core-js/modules/esnext.iterator.map.js");
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
9
+ require("core-js/modules/es.number.to-fixed.js");
8
10
  require("core-js/modules/esnext.iterator.map.js");
9
11
  var _react = _interopRequireDefault(require("react"));
10
12
  var _queries = require("../../__api__/queries");
@@ -27,7 +29,7 @@ const EmptyState = _ref => {
27
29
  }, message));
28
30
  };
29
31
  const InternalSingleOrderCart = _ref2 => {
30
- var _cart$articles, _cart$totals$totalBef, _cart$totals, _cart$totals$discount, _cart$totals2, _cart$totals$totalAft, _cart$totals3, _cart$totals$totalVat, _cart$totals4;
32
+ var _cart$articles, _cart$totals$totalExc, _cart$totals, _cart$totals$totalBtw, _cart$totals2, _cart$totals$totalInc, _cart$totals3;
31
33
  let {
32
34
  handleQuantityChange,
33
35
  removeFromCart: _removeFromCart,
@@ -55,16 +57,20 @@ const InternalSingleOrderCart = _ref2 => {
55
57
  className: (0, _helpers__.withStyle)('w-full')
56
58
  }, /*#__PURE__*/_react.default.createElement("strong", null, "Toebehoren"), isLoadingCart ? /*#__PURE__*/_react.default.createElement(EmptyState, {
57
59
  message: "We zijn het overzicht aan het laden..."
58
- }) : (cart === null || cart === void 0 || (_cart$articles = cart.articles) === null || _cart$articles === void 0 ? void 0 : _cart$articles.length) > 0 ? cart.articles.map(article => /*#__PURE__*/_react.default.createElement(_SingleOrderCartCard.default, {
59
- key: article.articleNumber,
60
- productId: article.articleNumber,
61
- productImage: article.image,
62
- productTitle: article.name,
63
- productPrice: article.price,
64
- removeFromCart: () => _removeFromCart(article.articleNumber),
65
- quantity: article.quantity,
66
- handleQuantityChange: handleQuantityChange
67
- })) : /*#__PURE__*/_react.default.createElement(EmptyState, {
60
+ }) : (cart === null || cart === void 0 || (_cart$articles = cart.articles) === null || _cart$articles === void 0 ? void 0 : _cart$articles.length) > 0 ? cart.articles.map(article => {
61
+ return /*#__PURE__*/_react.default.createElement(_SingleOrderCartCard.default, {
62
+ key: article.articleNumber,
63
+ productId: article.articleNumber,
64
+ productImage: article.image,
65
+ productTitle: article.name,
66
+ productPrice: article.productTotalExclVat,
67
+ productPriceInclVat: article.individualPriceInclVat,
68
+ productPriceExclVat: article.individualPriceExclVat,
69
+ removeFromCart: () => _removeFromCart(article.articleNumber),
70
+ quantity: article.quantity,
71
+ handleQuantityChange: handleQuantityChange
72
+ });
73
+ }) : /*#__PURE__*/_react.default.createElement(EmptyState, {
68
74
  message: "Er zitten nog geen producten in je winkelwagen."
69
75
  }), /*#__PURE__*/_react.default.createElement("hr", null), /*#__PURE__*/_react.default.createElement("div", {
70
76
  className: (0, _helpers__.withStyle)('d-flex flex-column align-items-end w-100')
@@ -72,13 +78,11 @@ const InternalSingleOrderCart = _ref2 => {
72
78
  className: (0, _helpers__.withStyle)('d-flex flex-column mt-1 w-100')
73
79
  }, /*#__PURE__*/_react.default.createElement("p", {
74
80
  className: (0, _helpers__.withStyle)('d-flex justify-content-between m-0')
75
- }, /*#__PURE__*/_react.default.createElement("strong", null, "Subtotaal:"), /*#__PURE__*/_react.default.createElement("span", null, " \u20AC", (_cart$totals$totalBef = cart === null || cart === void 0 || (_cart$totals = cart.totals) === null || _cart$totals === void 0 ? void 0 : _cart$totals.totalBeforeDiscountInclVat) !== null && _cart$totals$totalBef !== void 0 ? _cart$totals$totalBef : 0)), /*#__PURE__*/_react.default.createElement("p", {
81
+ }, /*#__PURE__*/_react.default.createElement("strong", null, "Totaal excl BTW:"), /*#__PURE__*/_react.default.createElement("span", null, " \u20AC", ((_cart$totals$totalExc = cart === null || cart === void 0 || (_cart$totals = cart.totals) === null || _cart$totals === void 0 ? void 0 : _cart$totals.totalExclVat) !== null && _cart$totals$totalExc !== void 0 ? _cart$totals$totalExc : 0).toFixed(2))), /*#__PURE__*/_react.default.createElement("p", {
76
82
  className: (0, _helpers__.withStyle)('d-flex justify-content-between m-0')
77
- }, /*#__PURE__*/_react.default.createElement("strong", null, "Kortingen:"), /*#__PURE__*/_react.default.createElement("span", null, " \u20AC", (_cart$totals$discount = cart === null || cart === void 0 || (_cart$totals2 = cart.totals) === null || _cart$totals2 === void 0 ? void 0 : _cart$totals2.discountInclVat) !== null && _cart$totals$discount !== void 0 ? _cart$totals$discount : 0)), /*#__PURE__*/_react.default.createElement("p", {
83
+ }, /*#__PURE__*/_react.default.createElement("strong", null, "BTW:"), /*#__PURE__*/_react.default.createElement("span", null, " \u20AC", ((_cart$totals$totalBtw = cart === null || cart === void 0 || (_cart$totals2 = cart.totals) === null || _cart$totals2 === void 0 ? void 0 : _cart$totals2.totalBtw) !== null && _cart$totals$totalBtw !== void 0 ? _cart$totals$totalBtw : 0).toFixed(2))), /*#__PURE__*/_react.default.createElement("hr", null), /*#__PURE__*/_react.default.createElement("p", {
78
84
  className: (0, _helpers__.withStyle)('d-flex justify-content-between m-0')
79
- }, /*#__PURE__*/_react.default.createElement("strong", null, "Totaal:"), /*#__PURE__*/_react.default.createElement("span", null, " \u20AC", (_cart$totals$totalAft = cart === null || cart === void 0 || (_cart$totals3 = cart.totals) === null || _cart$totals3 === void 0 ? void 0 : _cart$totals3.totalAfterDiscountInclVat) !== null && _cart$totals$totalAft !== void 0 ? _cart$totals$totalAft : 0)), /*#__PURE__*/_react.default.createElement("hr", null), /*#__PURE__*/_react.default.createElement("p", {
80
- className: (0, _helpers__.withStyle)('d-flex justify-content-between m-0')
81
- }, /*#__PURE__*/_react.default.createElement("strong", null, "BTW:"), /*#__PURE__*/_react.default.createElement("span", null, " \u20AC", (_cart$totals$totalVat = cart === null || cart === void 0 || (_cart$totals4 = cart.totals) === null || _cart$totals4 === void 0 ? void 0 : _cart$totals4.totalVatAfterDiscount) !== null && _cart$totals$totalVat !== void 0 ? _cart$totals$totalVat : 0)))))
85
+ }, /*#__PURE__*/_react.default.createElement("strong", null, "Totaal:"), /*#__PURE__*/_react.default.createElement("span", null, " \u20AC", ((_cart$totals$totalInc = cart === null || cart === void 0 || (_cart$totals3 = cart.totals) === null || _cart$totals3 === void 0 ? void 0 : _cart$totals3.totalInclVat) !== null && _cart$totals$totalInc !== void 0 ? _cart$totals$totalInc : 0).toFixed(2))))))
82
86
  }), /*#__PURE__*/_react.default.createElement("div", {
83
87
  className: (0, _helpers__.withStyle)('d-flex mt-2 justify-content-between')
84
88
  }, /*#__PURE__*/_react.default.createElement(_LinkButton.default, {
@@ -31,6 +31,7 @@ var _FormulaContext = require("../../__context__/FormulaContext");
31
31
  var _OrderSessionContext = require("../../__context__/OrderSessionContext");
32
32
  var _helpers__ = require("../../__helpers__");
33
33
  var _product = require("../../__helpers__/product");
34
+ var _useIsTmg = require("../../__hooks__/useIsTmg");
34
35
  function _interopRequireDefault(e) {
35
36
  return e && e.__esModule ? e : {
36
37
  default: e
@@ -101,6 +102,7 @@ const InternalSingleOrderProductOverview = _ref => {
101
102
  if (singleOrderFormulaCode) {
102
103
  formula = singleOrderFormulaCode;
103
104
  }
105
+ const isTmg = (0, _useIsTmg.useIsTmg)();
104
106
  const mergedFilters = _objectSpread(_objectSpread({}, filters), {}, {
105
107
  licensePlate,
106
108
  model,
@@ -125,8 +127,9 @@ const InternalSingleOrderProductOverview = _ref => {
125
127
  message: "Geen producten gevonden.",
126
128
  subMessage: "Probeer een ander filter toe te passen."
127
129
  }), articles && hasActiveFilters && (articles === null || articles === void 0 || (_articles$articles2 = articles.articles) === null || _articles$articles2 === void 0 ? void 0 : _articles$articles2.length) > 0 && (articles === null || articles === void 0 || (_articles$articles3 = articles.articles) === null || _articles$articles3 === void 0 ? void 0 : _articles$articles3.map(article => {
128
- var _cart$find$quantity, _cart$find, _article$locationPric, _article$locationPric2, _article$locationPric3, _article$consumerPric;
130
+ var _cart$find$quantity, _cart$find, _article$locationPric, _article$locationPric2, _article$locationPric3, _article$locationPric6, _article$locationPric7;
129
131
  return /*#__PURE__*/_react.default.createElement(_SingleOrderProductCard.default, {
132
+ isTmg: isTmg,
130
133
  key: article.articleNumber,
131
134
  isModelArticle: Boolean(model || licensePlate),
132
135
  removeFromCart: () => _removeFromCart(article.articleNumber),
@@ -135,7 +138,10 @@ const InternalSingleOrderProductOverview = _ref => {
135
138
  isSelected: false,
136
139
  stock: (_article$locationPric = article === null || article === void 0 || (_article$locationPric2 = article.locationPrices) === null || _article$locationPric2 === void 0 || (_article$locationPric2 = _article$locationPric2.stock) === null || _article$locationPric2 === void 0 ? void 0 : _article$locationPric2.quantity) !== null && _article$locationPric !== void 0 ? _article$locationPric : 0,
137
140
  isOutOfStock: (article === null || article === void 0 || (_article$locationPric3 = article.locationPrices) === null || _article$locationPric3 === void 0 || (_article$locationPric3 = _article$locationPric3.stock) === null || _article$locationPric3 === void 0 ? void 0 : _article$locationPric3.status) == _constants__.StockStatus.OutOfStock,
138
- handleSelected: () => handleQuantityChange(article.articleNumber, 1),
141
+ handleSelected: () => {
142
+ var _article$locationPric4, _article$locationPric5;
143
+ return handleQuantityChange(article.articleNumber, 1, article === null || article === void 0 || (_article$locationPric4 = article.locationPrices) === null || _article$locationPric4 === void 0 ? void 0 : _article$locationPric4.priceExclVat, article === null || article === void 0 || (_article$locationPric5 = article.locationPrices) === null || _article$locationPric5 === void 0 ? void 0 : _article$locationPric5.priceInclVat);
144
+ },
139
145
  productUsps: [{
140
146
  type: 'excl',
141
147
  text: article === null || article === void 0 ? void 0 : article.excl
@@ -152,7 +158,8 @@ const InternalSingleOrderProductOverview = _ref => {
152
158
  productImage: article.image,
153
159
  productSpecifications: (0, _product.extractProductSpecsArray)(article),
154
160
  productTitle: article.name,
155
- productPrice: Number(article === null || article === void 0 || (_article$consumerPric = article.consumerPrices) === null || _article$consumerPric === void 0 ? void 0 : _article$consumerPric.priceInclVat).toFixed(2),
161
+ productPrice: Number(article === null || article === void 0 || (_article$locationPric6 = article.locationPrices) === null || _article$locationPric6 === void 0 ? void 0 : _article$locationPric6.priceExclVat).toFixed(2),
162
+ productPriceInclVat: Number(article === null || article === void 0 || (_article$locationPric7 = article.locationPrices) === null || _article$locationPric7 === void 0 ? void 0 : _article$locationPric7.priceInclVat).toFixed(2),
156
163
  productType: article === null || article === void 0 ? void 0 : article.type,
157
164
  productGroup: article === null || article === void 0 ? void 0 : article.group,
158
165
  productSubgroup: article === null || article === void 0 ? void 0 : article.subgroup
@@ -512,12 +512,16 @@ const orderSessionReducer = (state, action) => {
512
512
  {
513
513
  const {
514
514
  articleNumber,
515
- quantity
515
+ quantity,
516
+ productPrice,
517
+ productPriceInclVat
516
518
  } = action.payload;
517
519
  return _objectSpread(_objectSpread({}, state), {}, {
518
520
  singleOrderCart: [...state.singleOrderCart.filter(p => p.articleNumber !== articleNumber), {
519
521
  articleNumber,
520
- quantity
522
+ quantity,
523
+ productPrice,
524
+ productPriceInclVat
521
525
  }],
522
526
  isTouched: true
523
527
  });
@@ -56,17 +56,22 @@ const getSteps = _ref => {
56
56
  onNext,
57
57
  onPrev,
58
58
  onSubmit,
59
- initialValues
59
+ initialValues,
60
+ canSearchLicenseplate
60
61
  } = _ref;
61
62
  return [/*#__PURE__*/_react.default.createElement(_ManualSelectionForm.default, {
62
63
  onSubmit: onNext,
63
- initialValues: initialValues
64
+ initialValues: initialValues,
65
+ canSearchLicenseplate: canSearchLicenseplate
64
66
  }), /*#__PURE__*/_react.default.createElement(_QuestionsForm.default, {
65
67
  onPrev: onPrev,
66
68
  onSubmit: onSubmit
67
69
  })];
68
70
  };
69
- const InternalManualSelectionPage = () => {
71
+ const InternalManualSelectionPage = _ref2 => {
72
+ let {
73
+ canSearchLicenseplate = true
74
+ } = _ref2;
70
75
  const [{
71
76
  brand,
72
77
  model,
@@ -124,7 +129,8 @@ const InternalManualSelectionPage = () => {
124
129
  },
125
130
  onNext: handleNext,
126
131
  onPrev: handlePrev,
127
- onSubmit: handleSubmit
132
+ onSubmit: handleSubmit,
133
+ canSearchLicenseplate
128
134
  }), [persistSession, originalVehicle.current]);
129
135
  return /*#__PURE__*/_react.default.createElement("div", {
130
136
  className: (0, _helpers__.withStyle)('vh-100')
@@ -195,13 +195,15 @@ const InternalSingleOrderPage = () => {
195
195
  type: _OrderSessionContext.orderSessionActions.RESET_LICENSEPLATE_FILTERS
196
196
  });
197
197
  }, [dispatch]);
198
- const handleQuantityChange = (articleNumber, quantity) => {
198
+ const handleQuantityChange = (articleNumber, quantity, productPrice, productPriceInclVat) => {
199
199
  if (quantity > 0) {
200
200
  dispatch({
201
201
  type: _OrderSessionContext.orderSessionActions.ADD_SINGLE_ORDER_PRODUCT,
202
202
  payload: {
203
203
  articleNumber,
204
- quantity
204
+ quantity,
205
+ productPrice,
206
+ productPriceInclVat
205
207
  }
206
208
  });
207
209
  } else {
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.object.assign.js");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = void 0;
8
+ require("core-js/modules/es.object.assign.js");
7
9
  var _react = _interopRequireDefault(require("react"));
8
10
  var _reactRouterDom = require("react-router-dom");
9
11
  var _ = require(".");
@@ -16,8 +18,15 @@ function _interopRequireDefault(e) {
16
18
  default: e
17
19
  };
18
20
  }
19
- // Pages
20
-
21
+ function _extends() {
22
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
23
+ for (var e = 1; e < arguments.length; e++) {
24
+ var t = arguments[e];
25
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
26
+ }
27
+ return n;
28
+ }, _extends.apply(null, arguments);
29
+ } // Pages
21
30
  const TEST_ONLY_INTERNAL_ROUTES = () => {
22
31
  return /*#__PURE__*/_react.default.createElement(_reactRouterDom.Switch, null, /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
23
32
  exact: true,
@@ -48,7 +57,9 @@ const TEST_ONLY_INTERNAL_ROUTES = () => {
48
57
  render: props => /*#__PURE__*/_react.default.createElement(_.InternalProductsPage, null)
49
58
  }), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
50
59
  path: "/configurator/manual",
51
- render: props => /*#__PURE__*/_react.default.createElement(_.InternalManualSelectionPage, props)
60
+ render: props => /*#__PURE__*/_react.default.createElement(_.InternalManualSelectionPage, _extends({
61
+ canSearchLicenseplate: false
62
+ }, props))
52
63
  }), /*#__PURE__*/_react.default.createElement(_reactRouterDom.Route, {
53
64
  exact: true,
54
65
  path: "/configurator/overzicht",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.97",
3
+ "version": "0.0.99",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",