thm-p3-configurator 0.0.101 → 0.0.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/shared/App.js +8 -7
- package/dist/src/shared/__api__/mutations.js +2 -2
- package/dist/src/shared/__api__/queries.js +45 -5
- package/dist/src/shared/__components__/SingleOrderCartCard.js +6 -2
- package/dist/src/shared/__components__/SingleOrderProductCard.js +25 -74
- package/dist/src/shared/__components__/internal/InternalCustomerDetailsForm.js +88 -46
- package/dist/src/shared/__constants__/index.js +5 -1
- package/dist/src/shared/__containers__/internal/InternalSingleOrderCart.js +20 -16
- package/dist/src/shared/__containers__/internal/InternalSingleOrderProductOverview.js +10 -3
- package/dist/src/shared/__context__/OrderSessionContext.js +19 -2
- package/dist/src/shared/__pages__/internal/InternalSingleOrderPage.js +8 -3
- package/package.json +1 -1
package/dist/src/shared/App.js
CHANGED
|
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
exports.default = void 0;
|
|
11
|
-
var _TEST_ONLY_INTERNAL_ROUTES = _interopRequireDefault(require("./__pages__/internal/__TEST_ONLY_INTERNAL_ROUTES"));
|
|
12
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
12
|
require("react-datepicker/src/stylesheets/datepicker-cssmodules.scss");
|
|
14
13
|
var _reactGtmModule = _interopRequireDefault(require("react-gtm-module"));
|
|
@@ -30,6 +29,11 @@ var _index = _interopRequireDefault(require("./__pages__/index"));
|
|
|
30
29
|
var _Experiments = _interopRequireDefault(require("./__services__/Experiments"));
|
|
31
30
|
var _mainExternal = _interopRequireDefault(require("./__style__/main-external.scss"));
|
|
32
31
|
var _main = _interopRequireDefault(require("./__style__/main.scss"));
|
|
32
|
+
function _interopRequireDefault(e) {
|
|
33
|
+
return e && e.__esModule ? e : {
|
|
34
|
+
default: e
|
|
35
|
+
};
|
|
36
|
+
}
|
|
33
37
|
function _getRequireWildcardCache(e) {
|
|
34
38
|
if ("function" != typeof WeakMap) return null;
|
|
35
39
|
var r = new WeakMap(),
|
|
@@ -55,11 +59,8 @@ function _interopRequireWildcard(e, r) {
|
|
|
55
59
|
}
|
|
56
60
|
return n.default = e, t && t.set(e, n), n;
|
|
57
61
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
default: e
|
|
61
|
-
};
|
|
62
|
-
}
|
|
62
|
+
// import TEST_ONLY_INTERNAL_ROUTES from './__pages__/internal/__TEST_ONLY_INTERNAL_ROUTES';
|
|
63
|
+
|
|
63
64
|
_reactGtmModule.default.initialize({
|
|
64
65
|
gtmId: APP_CONFIG.googleTagManagerId || 'GTM-TC67SZ4'
|
|
65
66
|
});
|
|
@@ -75,6 +76,6 @@ const App = () => {
|
|
|
75
76
|
defaultCountry: APP_CONFIG.country
|
|
76
77
|
}, /*#__PURE__*/_react.default.createElement(_OrderSessionContext.OrderSessionController, null, /*#__PURE__*/_react.default.createElement(_reactQuery.QueryClientProvider, {
|
|
77
78
|
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),
|
|
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))))))))));
|
|
79
80
|
};
|
|
80
81
|
var _default = exports.default = App;
|
|
@@ -101,7 +101,7 @@ const useCreateSingleOrderMutation = () => {
|
|
|
101
101
|
customer,
|
|
102
102
|
formula,
|
|
103
103
|
branchId,
|
|
104
|
-
|
|
104
|
+
vehicle,
|
|
105
105
|
preferredDateTime,
|
|
106
106
|
internalNote
|
|
107
107
|
} = _ref3;
|
|
@@ -112,7 +112,7 @@ const useCreateSingleOrderMutation = () => {
|
|
|
112
112
|
customer,
|
|
113
113
|
formula,
|
|
114
114
|
branchId,
|
|
115
|
-
|
|
115
|
+
vehicle,
|
|
116
116
|
preferredDateTime,
|
|
117
117
|
internalNote
|
|
118
118
|
});
|
|
@@ -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:
|
|
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:
|
|
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
|
});
|
|
@@ -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 =
|
|
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
|
|
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
|
-
|
|
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 =
|
|
76
|
+
const ProductCategories = _ref3 => {
|
|
131
77
|
let {
|
|
132
78
|
productType = null,
|
|
133
79
|
productGroup = null,
|
|
134
80
|
productSubgroup = null,
|
|
135
81
|
articleNumber = null
|
|
136
|
-
} =
|
|
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 =
|
|
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
|
-
|
|
113
|
+
isModelArticle = false,
|
|
114
|
+
isTmg = false
|
|
115
|
+
} = _ref4;
|
|
168
116
|
const {
|
|
169
117
|
productFieldLabels
|
|
170
118
|
} = (0, _queries.useProductFieldLabels)();
|
|
171
|
-
const filteredProductSpecifications = productSpecifications.filter(
|
|
119
|
+
const filteredProductSpecifications = productSpecifications.filter(_ref5 => {
|
|
172
120
|
let {
|
|
173
121
|
key
|
|
174
|
-
} =
|
|
122
|
+
} = _ref5;
|
|
175
123
|
return productFieldLabels === null || productFieldLabels === void 0 ? void 0 : productFieldLabels[key];
|
|
176
|
-
}).map(
|
|
124
|
+
}).map(_ref6 => {
|
|
177
125
|
let {
|
|
178
126
|
key,
|
|
179
127
|
value
|
|
180
|
-
} =
|
|
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;
|
|
@@ -4,11 +4,10 @@ require("core-js/modules/es.promise.js");
|
|
|
4
4
|
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
|
-
require("core-js/modules/esnext.iterator.find.js");
|
|
8
7
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
9
|
-
require("core-js/modules/esnext.iterator.map.js");
|
|
10
8
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
9
|
require("core-js/modules/es.weak-map.js");
|
|
10
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
12
11
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
13
12
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
14
13
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -16,9 +15,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
16
15
|
});
|
|
17
16
|
exports.default = void 0;
|
|
18
17
|
require("core-js/modules/es.promise.js");
|
|
19
|
-
require("core-js/modules/esnext.iterator.constructor.js");
|
|
20
|
-
require("core-js/modules/esnext.iterator.find.js");
|
|
21
|
-
require("core-js/modules/esnext.iterator.map.js");
|
|
22
18
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
23
19
|
var _react = _interopRequireWildcard(require("react"));
|
|
24
20
|
var _yup = require("yup");
|
|
@@ -30,7 +26,7 @@ var _LocalStorageWorker = require("../../__services__/LocalStorageWorker");
|
|
|
30
26
|
var _LinkButton = _interopRequireDefault(require("../Buttons/LinkButton"));
|
|
31
27
|
var _CardWide = _interopRequireDefault(require("../Cards/CardWide"));
|
|
32
28
|
var _DatePickerInput = _interopRequireDefault(require("../Form/DatePickerInput"));
|
|
33
|
-
var
|
|
29
|
+
var _RadioButtons = _interopRequireDefault(require("../Form/RadioButtons"));
|
|
34
30
|
var _TextAreaInput = _interopRequireDefault(require("../Form/TextAreaInput"));
|
|
35
31
|
var _TextInput = _interopRequireDefault(require("../Form/TextInput"));
|
|
36
32
|
var _TimePickerInput = _interopRequireDefault(require("../Form/TimePickerInput"));
|
|
@@ -108,19 +104,22 @@ function _toPrimitive(t, r) {
|
|
|
108
104
|
return ("string" === r ? String : Number)(t);
|
|
109
105
|
}
|
|
110
106
|
const customerDetailsFormSchema = (0, _yup.object)({
|
|
107
|
+
singleOrderOwnershipType: (0, _yup.string)().nullable(),
|
|
111
108
|
firstName: (0, _yup.string)().nullable(),
|
|
112
|
-
channelType: (0, _yup.string)().required(_constants__.FORM_ERROR_MESSAGES.required),
|
|
113
|
-
channelId: (0, _yup.string)().required(_constants__.FORM_ERROR_MESSAGES.required),
|
|
114
109
|
infix: (0, _yup.string)().nullable(),
|
|
115
|
-
lastName: (0, _yup.string)().
|
|
116
|
-
email: (0, _yup.string)().
|
|
117
|
-
phoneNumber: (0, _yup.string)().
|
|
110
|
+
lastName: (0, _yup.string)().nullable(),
|
|
111
|
+
email: (0, _yup.string)().nullable(),
|
|
112
|
+
phoneNumber: (0, _yup.string)().nullable(),
|
|
113
|
+
zipCode: (0, _yup.string)().nullable(),
|
|
114
|
+
houseNumber: (0, _yup.string)().nullable(),
|
|
115
|
+
streetName: (0, _yup.string)().nullable(),
|
|
116
|
+
city: (0, _yup.string)().nullable(),
|
|
118
117
|
date: (0, _yup.string)().nullable(),
|
|
119
118
|
time: (0, _yup.string)().nullable(),
|
|
120
119
|
internalNote: (0, _yup.string)().nullable()
|
|
121
120
|
});
|
|
122
121
|
const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
123
|
-
var _branchTypes$byId$aut, _authSession$branch
|
|
122
|
+
var _branchTypes$byId$aut, _authSession$branch;
|
|
124
123
|
let {
|
|
125
124
|
errors = {},
|
|
126
125
|
onValidationError,
|
|
@@ -131,7 +130,8 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
131
130
|
channel,
|
|
132
131
|
selectedBranch,
|
|
133
132
|
appointment,
|
|
134
|
-
internalNote
|
|
133
|
+
internalNote,
|
|
134
|
+
vehicle
|
|
135
135
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
136
136
|
const {
|
|
137
137
|
branchById
|
|
@@ -223,39 +223,21 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
223
223
|
label: 'Vestiginggegevens invullen?',
|
|
224
224
|
onClick: handleAutofillButtonClicked,
|
|
225
225
|
isDisabled: !branchById
|
|
226
|
-
})), /*#__PURE__*/_react.default.createElement(
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
label: "Kanaal:",
|
|
234
|
-
isRequired: true,
|
|
235
|
-
isLoading: isLoadingMarketingChannels,
|
|
236
|
-
noOptionsMessage: "Geen opties beschikbaar",
|
|
237
|
-
placeholder: "Maak een keuze",
|
|
238
|
-
errorMessage: (errors === null || errors === void 0 ? void 0 : errors['channelType']) || (errors === null || errors === void 0 ? void 0 : errors['channelId']),
|
|
239
|
-
initialValue: channel !== null && channel !== void 0 && channel.channelId ? {
|
|
240
|
-
label: marketingChannels === null || marketingChannels === void 0 || (_marketingChannels$fi = marketingChannels.find(marketingC => (marketingC === null || marketingC === void 0 ? void 0 : marketingC.entityId) === (channel === null || channel === void 0 ? void 0 : channel.channelId))) === null || _marketingChannels$fi === void 0 ? void 0 : _marketingChannels$fi.title,
|
|
241
|
-
value: marketingChannels === null || marketingChannels === void 0 ? void 0 : marketingChannels.find(marketingC => (marketingC === null || marketingC === void 0 ? void 0 : marketingC.entityId) === (channel === null || channel === void 0 ? void 0 : channel.channelId))
|
|
242
|
-
} : null,
|
|
243
|
-
onChange: _ref2 => {
|
|
244
|
-
var _value$kanaalType;
|
|
245
|
-
let {
|
|
246
|
-
label,
|
|
247
|
-
value
|
|
248
|
-
} = _ref2;
|
|
249
|
-
return dispatch({
|
|
250
|
-
type: _OrderSessionContext.orderSessionActions.SET_MARKETING_CHANNEL,
|
|
226
|
+
})), /*#__PURE__*/_react.default.createElement(_RadioButtons.default, {
|
|
227
|
+
name: "singleOrderOwnershipType",
|
|
228
|
+
label: "Type:",
|
|
229
|
+
initialValue: vehicle === null || vehicle === void 0 ? void 0 : vehicle.singleOrderOwnershipType,
|
|
230
|
+
onChange: val => {
|
|
231
|
+
dispatch({
|
|
232
|
+
type: _OrderSessionContext.orderSessionActions.SET_VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE,
|
|
251
233
|
payload: {
|
|
252
|
-
|
|
253
|
-
channelType: value === null || value === void 0 || (_value$kanaalType = value.kanaalType) === null || _value$kanaalType === void 0 || (_value$kanaalType = _value$kanaalType[0]) === null || _value$kanaalType === void 0 ? void 0 : _value$kanaalType.entityId,
|
|
254
|
-
channelId: value === null || value === void 0 ? void 0 : value.entityId
|
|
255
|
-
}
|
|
234
|
+
singleOrderOwnershipType: val
|
|
256
235
|
}
|
|
257
236
|
});
|
|
258
|
-
}
|
|
237
|
+
},
|
|
238
|
+
options: Object.values(_constants__.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE),
|
|
239
|
+
isRequired: false,
|
|
240
|
+
errorMessage: errors === null || errors === void 0 ? void 0 : errors['singleOrderOwnershipType']
|
|
259
241
|
}), /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
260
242
|
className: 'col-12 col-md-6',
|
|
261
243
|
placeholder: "",
|
|
@@ -297,7 +279,7 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
297
279
|
lastName: value
|
|
298
280
|
}
|
|
299
281
|
}),
|
|
300
|
-
isRequired:
|
|
282
|
+
isRequired: false,
|
|
301
283
|
form: form,
|
|
302
284
|
label: "Achternaam:",
|
|
303
285
|
errorMessage: errors === null || errors === void 0 ? void 0 : errors['lastName']
|
|
@@ -312,7 +294,7 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
312
294
|
email: value
|
|
313
295
|
}
|
|
314
296
|
}),
|
|
315
|
-
isRequired:
|
|
297
|
+
isRequired: false,
|
|
316
298
|
form: form,
|
|
317
299
|
label: "E-mailadres:",
|
|
318
300
|
errorMessage: errors === null || errors === void 0 ? void 0 : errors['email']
|
|
@@ -328,9 +310,69 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
328
310
|
}
|
|
329
311
|
}),
|
|
330
312
|
form: form,
|
|
331
|
-
isRequired:
|
|
313
|
+
isRequired: false,
|
|
332
314
|
label: "Telefoonnummer:",
|
|
333
315
|
errorMessage: errors === null || errors === void 0 ? void 0 : errors['phoneNumber']
|
|
316
|
+
}), /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
317
|
+
className: 'col-12 col-md-6',
|
|
318
|
+
placeholder: "",
|
|
319
|
+
initialValue: customer.zipCode,
|
|
320
|
+
name: "zipCode",
|
|
321
|
+
onChange: value => dispatch({
|
|
322
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_ZIP_CODE,
|
|
323
|
+
payload: {
|
|
324
|
+
zipCode: value
|
|
325
|
+
}
|
|
326
|
+
}),
|
|
327
|
+
isRequired: false,
|
|
328
|
+
form: form,
|
|
329
|
+
label: "Postcode:",
|
|
330
|
+
errorMessage: errors === null || errors === void 0 ? void 0 : errors['zipCode']
|
|
331
|
+
}), /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
332
|
+
className: 'col-12 col-md-6',
|
|
333
|
+
placeholder: "",
|
|
334
|
+
initialValue: customer.houseNumber,
|
|
335
|
+
name: "houseNumber",
|
|
336
|
+
onChange: value => dispatch({
|
|
337
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER,
|
|
338
|
+
payload: {
|
|
339
|
+
houseNumber: value
|
|
340
|
+
}
|
|
341
|
+
}),
|
|
342
|
+
isRequired: false,
|
|
343
|
+
form: form,
|
|
344
|
+
label: "Huisnummer:",
|
|
345
|
+
errorMessage: errors === null || errors === void 0 ? void 0 : errors['houseNumber']
|
|
346
|
+
}), /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
347
|
+
className: 'col-12 col-md-6',
|
|
348
|
+
placeholder: "",
|
|
349
|
+
initialValue: customer.streetName,
|
|
350
|
+
name: "streetName",
|
|
351
|
+
onChange: value => dispatch({
|
|
352
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_STREET_NAME,
|
|
353
|
+
payload: {
|
|
354
|
+
streetName: value
|
|
355
|
+
}
|
|
356
|
+
}),
|
|
357
|
+
isRequired: false,
|
|
358
|
+
form: form,
|
|
359
|
+
label: "Straat:",
|
|
360
|
+
errorMessage: errors === null || errors === void 0 ? void 0 : errors['streetName']
|
|
361
|
+
}), /*#__PURE__*/_react.default.createElement(_TextInput.default, {
|
|
362
|
+
className: 'col-12 col-md-6',
|
|
363
|
+
placeholder: "",
|
|
364
|
+
initialValue: customer.city,
|
|
365
|
+
name: "city",
|
|
366
|
+
onChange: value => dispatch({
|
|
367
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_CITY,
|
|
368
|
+
payload: {
|
|
369
|
+
city: value
|
|
370
|
+
}
|
|
371
|
+
}),
|
|
372
|
+
isRequired: false,
|
|
373
|
+
form: form,
|
|
374
|
+
label: "Stad:",
|
|
375
|
+
errorMessage: errors === null || errors === void 0 ? void 0 : errors['city']
|
|
334
376
|
})))), /*#__PURE__*/_react.default.createElement("div", {
|
|
335
377
|
className: (0, _helpers__.withStyle)('col-12')
|
|
336
378
|
}, /*#__PURE__*/_react.default.createElement(_CardWide.default, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.VESTIGING_TYPE_ID = exports.VEHICLE_OWNERSHIP_TYPE = exports.USER_GEOLOCATION_KEY = exports.TMG_ORGANIZATION_TYPE = exports.StockStatus = exports.PRODUCT_CATEGORIES = exports.PRIVATE_SINGLE_ORDER_SESSION_KEY = exports.ORDER_SESSION_KEY = 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.FORM_ERROR_MESSAGES = exports.DOSSIER_TYPES = exports.DISCOUNT_TYPES = exports.DEFAULT_MAP_LONGITUDE = exports.DEFAULT_MAP_LATITUDE = exports.DEFAULT_ARTICLE_BRAND = exports.CONFIGURATOR_FORMULAS = exports.BOARD_COMPUTER_DISABLED_KEY = exports.AUTH_SESSION_KEY = exports.ARTICLES_SYSTEM_FIELDS = exports.API_ERROR_CODES = exports.ANWB_DISCOUNT_CODE = exports.ALL_EXPERIMENTS = exports.ACTIVE_VARIANTS = void 0;
|
|
6
|
+
exports.VESTIGING_TYPE_ID = exports.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE = exports.VEHICLE_OWNERSHIP_TYPE = exports.USER_GEOLOCATION_KEY = exports.TMG_ORGANIZATION_TYPE = exports.StockStatus = exports.PRODUCT_CATEGORIES = exports.PRIVATE_SINGLE_ORDER_SESSION_KEY = exports.ORDER_SESSION_KEY = 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.FORM_ERROR_MESSAGES = exports.DOSSIER_TYPES = exports.DISCOUNT_TYPES = exports.DEFAULT_MAP_LONGITUDE = exports.DEFAULT_MAP_LATITUDE = exports.DEFAULT_ARTICLE_BRAND = exports.CONFIGURATOR_FORMULAS = exports.BOARD_COMPUTER_DISABLED_KEY = exports.AUTH_SESSION_KEY = exports.ARTICLES_SYSTEM_FIELDS = exports.API_ERROR_CODES = exports.ANWB_DISCOUNT_CODE = 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',
|
|
@@ -154,6 +154,10 @@ const VEHICLE_OWNERSHIP_TYPE = exports.VEHICLE_OWNERSHIP_TYPE = {
|
|
|
154
154
|
Zakelijk: 'Zakelijk',
|
|
155
155
|
Leasemaatschappij: 'Leasemaatschappij'
|
|
156
156
|
};
|
|
157
|
+
const VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE = exports.VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE = {
|
|
158
|
+
Particulier: 'Particulier',
|
|
159
|
+
Zakelijk: 'Zakelijk'
|
|
160
|
+
};
|
|
157
161
|
const DISCOUNT_TYPES = exports.DISCOUNT_TYPES = {
|
|
158
162
|
Percentage: '%',
|
|
159
163
|
Amount: '€'
|
|
@@ -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$
|
|
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 =>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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, "
|
|
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, "
|
|
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$
|
|
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$
|
|
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: () =>
|
|
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$
|
|
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
|
|
@@ -135,6 +135,7 @@ const INITIAL_ORDER_SESSION_STATE = {
|
|
|
135
135
|
customerAgreed: undefined,
|
|
136
136
|
vehicle: {
|
|
137
137
|
ownershipType: _constants__.VEHICLE_OWNERSHIP_TYPE.Particulier,
|
|
138
|
+
singleOrderOwnershipType: null,
|
|
138
139
|
leaseNumber: '',
|
|
139
140
|
leaseNumberUnknown: true
|
|
140
141
|
},
|
|
@@ -209,6 +210,7 @@ const orderSessionActions = exports.orderSessionActions = {
|
|
|
209
210
|
SET_VEHICLE_LEASE_NUMBER: 'SET_VEHICLE_LEASE_NUMBER',
|
|
210
211
|
SET_VEHICLE_LEASE_NUMBER_UNKNOWN: 'SET_VEHICLE_LEASE_NUMBER_UNKNOWN',
|
|
211
212
|
SET_VEHICLE_OWNERSHIP_TYPE: 'SET_VEHICLE_OWNERSHIP_TYPE',
|
|
213
|
+
SET_VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE: 'SET_VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE',
|
|
212
214
|
SET_MARKETING_CHANNEL: 'SET_MARKETING_CHANNEL',
|
|
213
215
|
SET_CUSTOMER_ZIP_CODE: 'SET_CUSTOMER_ZIP_CODE',
|
|
214
216
|
SET_CUSTOMER_CITY: 'SET_CUSTOMER_CITY',
|
|
@@ -512,12 +514,16 @@ const orderSessionReducer = (state, action) => {
|
|
|
512
514
|
{
|
|
513
515
|
const {
|
|
514
516
|
articleNumber,
|
|
515
|
-
quantity
|
|
517
|
+
quantity,
|
|
518
|
+
productPrice,
|
|
519
|
+
productPriceInclVat
|
|
516
520
|
} = action.payload;
|
|
517
521
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
518
522
|
singleOrderCart: [...state.singleOrderCart.filter(p => p.articleNumber !== articleNumber), {
|
|
519
523
|
articleNumber,
|
|
520
|
-
quantity
|
|
524
|
+
quantity,
|
|
525
|
+
productPrice,
|
|
526
|
+
productPriceInclVat
|
|
521
527
|
}],
|
|
522
528
|
isTouched: true
|
|
523
529
|
});
|
|
@@ -834,6 +840,17 @@ const orderSessionReducer = (state, action) => {
|
|
|
834
840
|
})
|
|
835
841
|
});
|
|
836
842
|
}
|
|
843
|
+
case orderSessionActions.SET_VEHICLE_SINGLE_ORDER_OWNERSHIP_TYPE:
|
|
844
|
+
{
|
|
845
|
+
const {
|
|
846
|
+
singleOrderOwnershipType
|
|
847
|
+
} = action.payload;
|
|
848
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
849
|
+
vehicle: _objectSpread(_objectSpread({}, state === null || state === void 0 ? void 0 : state.vehicle), {}, {
|
|
850
|
+
singleOrderOwnershipType
|
|
851
|
+
})
|
|
852
|
+
});
|
|
853
|
+
}
|
|
837
854
|
case orderSessionActions.REMOVE_DISCOUNTED_PRODUCT:
|
|
838
855
|
{
|
|
839
856
|
var _state$selectedDiscou;
|
|
@@ -143,6 +143,7 @@ const InternalSingleOrderPage = () => {
|
|
|
143
143
|
channel,
|
|
144
144
|
customer,
|
|
145
145
|
selectedBranch,
|
|
146
|
+
vehicle,
|
|
146
147
|
appointment,
|
|
147
148
|
internalNote,
|
|
148
149
|
singleOrderFormulaCode,
|
|
@@ -195,13 +196,15 @@ const InternalSingleOrderPage = () => {
|
|
|
195
196
|
type: _OrderSessionContext.orderSessionActions.RESET_LICENSEPLATE_FILTERS
|
|
196
197
|
});
|
|
197
198
|
}, [dispatch]);
|
|
198
|
-
const handleQuantityChange = (articleNumber, quantity) => {
|
|
199
|
+
const handleQuantityChange = (articleNumber, quantity, productPrice, productPriceInclVat) => {
|
|
199
200
|
if (quantity > 0) {
|
|
200
201
|
dispatch({
|
|
201
202
|
type: _OrderSessionContext.orderSessionActions.ADD_SINGLE_ORDER_PRODUCT,
|
|
202
203
|
payload: {
|
|
203
204
|
articleNumber,
|
|
204
|
-
quantity
|
|
205
|
+
quantity,
|
|
206
|
+
productPrice,
|
|
207
|
+
productPriceInclVat
|
|
205
208
|
}
|
|
206
209
|
});
|
|
207
210
|
} else {
|
|
@@ -213,7 +216,6 @@ const InternalSingleOrderPage = () => {
|
|
|
213
216
|
});
|
|
214
217
|
}
|
|
215
218
|
};
|
|
216
|
-
const [filtersResetTrigger, setFiltersResetTrigger] = (0, _react.useState)(false);
|
|
217
219
|
const filterModelOrLicenseplate = filter => {
|
|
218
220
|
var _filtersRef$current;
|
|
219
221
|
(_filtersRef$current = filtersRef.current) === null || _filtersRef$current === void 0 || _filtersRef$current.resetFilters(true);
|
|
@@ -256,10 +258,13 @@ const InternalSingleOrderPage = () => {
|
|
|
256
258
|
const isValid = await ((_customerFormRef$curr = customerFormRef.current) === null || _customerFormRef$curr === void 0 ? void 0 : _customerFormRef$curr.validateForm());
|
|
257
259
|
if (isValid) {
|
|
258
260
|
const preferredDateTime = appointment !== null && appointment !== void 0 && appointment.date && appointment !== null && appointment !== void 0 && appointment.time ? (0, _helpers__.parseDateAndTimeToTimestamp)(appointment === null || appointment === void 0 ? void 0 : appointment.date, appointment === null || appointment === void 0 ? void 0 : appointment.time) : null;
|
|
261
|
+
vehicle.ownershipType = vehicle.singleOrderOwnershipType;
|
|
262
|
+
delete vehicle.singleOrderOwnershipType;
|
|
259
263
|
createSingleOrder({
|
|
260
264
|
licensePlate: filters.licensePlate,
|
|
261
265
|
model: filters.model,
|
|
262
266
|
cart: singleOrderCart,
|
|
267
|
+
vehicle,
|
|
263
268
|
customer,
|
|
264
269
|
formula,
|
|
265
270
|
branchId: selectedBranch,
|