thm-p3-configurator 0.0.99 → 0.0.101
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/__api__/queries.js +5 -45
- package/dist/src/shared/__components__/SingleOrderCartCard.js +2 -6
- package/dist/src/shared/__components__/SingleOrderProductCard.js +74 -25
- package/dist/src/shared/__components__/internal/InternalCustomerDetailsForm.js +24 -0
- package/dist/src/shared/__containers__/internal/InternalAppointmentForm.js +6 -0
- package/dist/src/shared/__containers__/internal/InternalSingleOrderCart.js +16 -20
- package/dist/src/shared/__containers__/internal/InternalSingleOrderProductOverview.js +3 -10
- package/dist/src/shared/__context__/OrderSessionContext.js +2 -6
- package/dist/src/shared/__pages__/internal/InternalSingleOrderPage.js +2 -4
- package/package.json +1 -1
|
@@ -11,7 +11,9 @@ 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");
|
|
14
15
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
16
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
15
17
|
Object.defineProperty(exports, "__esModule", {
|
|
16
18
|
value: true
|
|
17
19
|
});
|
|
@@ -21,8 +23,6 @@ require("core-js/modules/es.json.stringify.js");
|
|
|
21
23
|
require("core-js/modules/es.object.from-entries.js");
|
|
22
24
|
require("core-js/modules/es.promise.js");
|
|
23
25
|
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,9 +279,8 @@ const useSingleOrderArticles = exports.useSingleOrderArticles = function useSing
|
|
|
279
279
|
totalArticles: 0
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
|
-
const currentArticles = await (0, _singleOrderArticles.enrichArticlesWithBrandsAndPrices)(articles, branchId, formula);
|
|
283
282
|
return {
|
|
284
|
-
articles:
|
|
283
|
+
articles: await (0, _singleOrderArticles.enrichArticlesWithBrandsAndPrices)(articles, branchId, formula),
|
|
285
284
|
totalArticles: totalCount
|
|
286
285
|
};
|
|
287
286
|
}
|
|
@@ -301,31 +300,6 @@ const useSingleOrderCart = () => {
|
|
|
301
300
|
singleOrderCart,
|
|
302
301
|
singleOrderFormulaCode
|
|
303
302
|
}] = (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
|
-
});
|
|
329
303
|
let formula = (0, _FormulaContext.useFormula)();
|
|
330
304
|
if (singleOrderFormulaCode) {
|
|
331
305
|
formula = singleOrderFormulaCode;
|
|
@@ -355,28 +329,14 @@ const useSingleOrderCart = () => {
|
|
|
355
329
|
const cartLookup = Object.fromEntries(cart.map(item => [item.articleNumber, item]));
|
|
356
330
|
const articlesWithPrice = articles === null || articles === void 0 || (_articles$articles = articles.articles) === null || _articles$articles === void 0 ? void 0 : _articles$articles.map(article => {
|
|
357
331
|
const cartItem = cartLookup[article.articleNumber];
|
|
358
|
-
const totals = cartTotalsLookup[article.articleNumber];
|
|
359
332
|
return _objectSpread(_objectSpread({}, article), {}, {
|
|
360
333
|
price: cartItem !== null && cartItem !== void 0 && cartItem.consumerTotal ? Math.round(Number(cartItem === null || cartItem === void 0 ? void 0 : cartItem.consumerTotal) * 100) / 100 : 0,
|
|
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
|
|
334
|
+
quantity: Number(cartItem === null || cartItem === void 0 ? void 0 : cartItem.quantity)
|
|
370
335
|
});
|
|
371
336
|
});
|
|
372
337
|
return {
|
|
373
338
|
articles: articlesWithPrice,
|
|
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
|
-
}
|
|
339
|
+
totals: orderResults.data.totals
|
|
380
340
|
};
|
|
381
341
|
}
|
|
382
342
|
});
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.number.to-fixed.js");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
require("core-js/modules/es.number.to-fixed.js");
|
|
9
7
|
var _react = _interopRequireDefault(require("react"));
|
|
10
8
|
var _helpers__ = require("../__helpers__");
|
|
11
9
|
var _LinkButton = _interopRequireDefault(require("./Buttons/LinkButton"));
|
|
@@ -38,8 +36,6 @@ const SingleOrderCartCard = _ref2 => {
|
|
|
38
36
|
productImage,
|
|
39
37
|
productTitle,
|
|
40
38
|
productPrice,
|
|
41
|
-
productPriceInclVat,
|
|
42
|
-
productPriceExclVat,
|
|
43
39
|
quantity = 0,
|
|
44
40
|
handleQuantityChange,
|
|
45
41
|
removeFromCart
|
|
@@ -61,14 +57,14 @@ const SingleOrderCartCard = _ref2 => {
|
|
|
61
57
|
className: (0, _helpers__.withStyle)('mb-0')
|
|
62
58
|
}, productTitle), /*#__PURE__*/_react.default.createElement("p", {
|
|
63
59
|
className: (0, _helpers__.withStyle)('ms-2 fw-bold')
|
|
64
|
-
}, "\u20AC",
|
|
60
|
+
}, "\u20AC", productPrice)), /*#__PURE__*/_react.default.createElement("div", {
|
|
65
61
|
className: (0, _helpers__.withStyle)('d-flex mt-1 justify-content-between align-items-center')
|
|
66
62
|
}, /*#__PURE__*/_react.default.createElement(_NumericInput.default, {
|
|
67
63
|
className: (0, _helpers__.withStyle)('me-2 rounded'),
|
|
68
64
|
width: "100px",
|
|
69
65
|
height: "40px",
|
|
70
66
|
defaultValue: quantity,
|
|
71
|
-
onChange: value => handleQuantityChange(productId, value
|
|
67
|
+
onChange: value => handleQuantityChange(productId, value),
|
|
72
68
|
buttonTransformY: 40
|
|
73
69
|
}), /*#__PURE__*/_react.default.createElement(_LinkButton.default, {
|
|
74
70
|
label: "Verwijder",
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.symbol.description.js");
|
|
4
|
+
require("core-js/modules/es.weak-map.js");
|
|
3
5
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
4
6
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
5
7
|
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");
|
|
6
11
|
Object.defineProperty(exports, "__esModule", {
|
|
7
12
|
value: true
|
|
8
13
|
});
|
|
9
14
|
exports.default = void 0;
|
|
15
|
+
require("core-js/modules/es.symbol.description.js");
|
|
10
16
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
11
17
|
require("core-js/modules/esnext.iterator.filter.js");
|
|
12
18
|
require("core-js/modules/esnext.iterator.map.js");
|
|
13
|
-
var _react =
|
|
19
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
20
|
var _queries = require("../__api__/queries");
|
|
15
21
|
var _NumericInput = _interopRequireDefault(require("../__components__/Form/NumericInput"));
|
|
16
22
|
var _helpers__ = require("../__helpers__");
|
|
@@ -23,6 +29,31 @@ function _interopRequireDefault(e) {
|
|
|
23
29
|
default: e
|
|
24
30
|
};
|
|
25
31
|
}
|
|
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
|
+
}
|
|
26
57
|
const ProductImage = _ref => {
|
|
27
58
|
let {
|
|
28
59
|
productImage
|
|
@@ -35,19 +66,42 @@ const ProductImage = _ref => {
|
|
|
35
66
|
alt: ""
|
|
36
67
|
}));
|
|
37
68
|
};
|
|
38
|
-
const
|
|
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 => {
|
|
39
96
|
let {
|
|
40
|
-
isTmg,
|
|
41
97
|
isOutOfStock,
|
|
42
98
|
stock,
|
|
43
99
|
quantity,
|
|
44
100
|
productId,
|
|
45
101
|
handleQuantityChange,
|
|
46
102
|
handleSelected,
|
|
47
|
-
removeFromCart
|
|
48
|
-
|
|
49
|
-
productPriceInclVat
|
|
50
|
-
} = _ref2;
|
|
103
|
+
removeFromCart
|
|
104
|
+
} = _ref5;
|
|
51
105
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
52
106
|
className: (0, _helpers__.withStyle)('d-flex justify-content-end')
|
|
53
107
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -56,30 +110,30 @@ const ProductActions = _ref2 => {
|
|
|
56
110
|
className: (0, _helpers__.withStyle)('text-danger mb-1')
|
|
57
111
|
}, "Niet op voorraad") : /*#__PURE__*/_react.default.createElement("div", {
|
|
58
112
|
className: (0, _helpers__.withStyle)('text-success mb-1')
|
|
59
|
-
},
|
|
113
|
+
}, stock, " op voorraad"), /*#__PURE__*/_react.default.createElement("div", {
|
|
60
114
|
className: (0, _helpers__.withStyle)('d-flex align-items-center')
|
|
61
115
|
}, /*#__PURE__*/_react.default.createElement(_NumericInput.default, {
|
|
62
116
|
className: (0, _helpers__.withStyle)('me-2 rounded'),
|
|
63
117
|
width: "100px",
|
|
64
118
|
height: "55px",
|
|
65
119
|
defaultValue: quantity,
|
|
66
|
-
onChange: value => handleQuantityChange(productId, value
|
|
120
|
+
onChange: value => handleQuantityChange(productId, value),
|
|
67
121
|
buttonTransformY: 40
|
|
68
122
|
}), quantity === 0 ? /*#__PURE__*/_react.default.createElement(_PrimaryButton.default, {
|
|
69
|
-
onClick: () => handleSelected(productId, quantity + 1
|
|
123
|
+
onClick: () => handleSelected(productId, quantity + 1),
|
|
70
124
|
label: "Toevoegen"
|
|
71
125
|
}) : /*#__PURE__*/_react.default.createElement(_OutlinedButton.default, {
|
|
72
126
|
onClick: () => removeFromCart(productId),
|
|
73
127
|
label: "Verwijder"
|
|
74
128
|
}))));
|
|
75
129
|
};
|
|
76
|
-
const ProductCategories =
|
|
130
|
+
const ProductCategories = _ref6 => {
|
|
77
131
|
let {
|
|
78
132
|
productType = null,
|
|
79
133
|
productGroup = null,
|
|
80
134
|
productSubgroup = null,
|
|
81
135
|
articleNumber = null
|
|
82
|
-
} =
|
|
136
|
+
} = _ref6;
|
|
83
137
|
return /*#__PURE__*/_react.default.createElement("div", null, articleNumber && /*#__PURE__*/_react.default.createElement("p", {
|
|
84
138
|
className: (0, _helpers__.withStyle)('fst-italic mb-0')
|
|
85
139
|
}, /*#__PURE__*/_react.default.createElement("strong", null, "Artikelnummer:"), " ", articleNumber), productType && /*#__PURE__*/_react.default.createElement("p", {
|
|
@@ -90,7 +144,7 @@ const ProductCategories = _ref3 => {
|
|
|
90
144
|
className: (0, _helpers__.withStyle)('fst-italic mb-0')
|
|
91
145
|
}, /*#__PURE__*/_react.default.createElement("strong", null, "Subgroep:"), " ", productSubgroup));
|
|
92
146
|
};
|
|
93
|
-
const SingleOrderProductCard =
|
|
147
|
+
const SingleOrderProductCard = _ref7 => {
|
|
94
148
|
let {
|
|
95
149
|
productId,
|
|
96
150
|
isSelected,
|
|
@@ -105,27 +159,25 @@ const SingleOrderProductCard = _ref4 => {
|
|
|
105
159
|
productUsps,
|
|
106
160
|
productTitle,
|
|
107
161
|
productPrice,
|
|
108
|
-
productPriceInclVat,
|
|
109
162
|
productSpecifications,
|
|
110
163
|
quantity = 0,
|
|
111
164
|
handleQuantityChange,
|
|
112
165
|
removeFromCart,
|
|
113
|
-
isModelArticle = false
|
|
114
|
-
|
|
115
|
-
} = _ref4;
|
|
166
|
+
isModelArticle = false
|
|
167
|
+
} = _ref7;
|
|
116
168
|
const {
|
|
117
169
|
productFieldLabels
|
|
118
170
|
} = (0, _queries.useProductFieldLabels)();
|
|
119
|
-
const filteredProductSpecifications = productSpecifications.filter(
|
|
171
|
+
const filteredProductSpecifications = productSpecifications.filter(_ref8 => {
|
|
120
172
|
let {
|
|
121
173
|
key
|
|
122
|
-
} =
|
|
174
|
+
} = _ref8;
|
|
123
175
|
return productFieldLabels === null || productFieldLabels === void 0 ? void 0 : productFieldLabels[key];
|
|
124
|
-
}).map(
|
|
176
|
+
}).map(_ref9 => {
|
|
125
177
|
let {
|
|
126
178
|
key,
|
|
127
179
|
value
|
|
128
|
-
} =
|
|
180
|
+
} = _ref9;
|
|
129
181
|
return {
|
|
130
182
|
key: productFieldLabels[key],
|
|
131
183
|
value
|
|
@@ -162,14 +214,11 @@ const SingleOrderProductCard = _ref4 => {
|
|
|
162
214
|
}))), /*#__PURE__*/_react.default.createElement(ProductActions, {
|
|
163
215
|
isOutOfStock: isOutOfStock,
|
|
164
216
|
stock: stock,
|
|
165
|
-
isTmg: isTmg,
|
|
166
217
|
quantity: quantity,
|
|
167
218
|
productId: productId,
|
|
168
219
|
handleQuantityChange: handleQuantityChange,
|
|
169
220
|
handleSelected: handleSelected,
|
|
170
|
-
removeFromCart: removeFromCart
|
|
171
|
-
productPrice: productPrice,
|
|
172
|
-
productPriceInclVat: productPriceInclVat
|
|
221
|
+
removeFromCart: removeFromCart
|
|
173
222
|
})))));
|
|
174
223
|
};
|
|
175
224
|
var _default = exports.default = SingleOrderProductCard;
|
|
@@ -164,6 +164,30 @@ const InternalCustomerDetailsForm = (_ref, ref) => {
|
|
|
164
164
|
phoneNumber: branchById === null || branchById === void 0 ? void 0 : branchById.phone
|
|
165
165
|
}
|
|
166
166
|
});
|
|
167
|
+
dispatch({
|
|
168
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_ZIP_CODE,
|
|
169
|
+
payload: {
|
|
170
|
+
zipCode: branchById === null || branchById === void 0 ? void 0 : branchById.postalCode
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
dispatch({
|
|
174
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_STREET_NAME,
|
|
175
|
+
payload: {
|
|
176
|
+
streetName: branchById === null || branchById === void 0 ? void 0 : branchById.street
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
dispatch({
|
|
180
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_CITY,
|
|
181
|
+
payload: {
|
|
182
|
+
city: branchById === null || branchById === void 0 ? void 0 : branchById.city
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
dispatch({
|
|
186
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER,
|
|
187
|
+
payload: {
|
|
188
|
+
houseNumber: branchById === null || branchById === void 0 ? void 0 : branchById.street2
|
|
189
|
+
}
|
|
190
|
+
});
|
|
167
191
|
};
|
|
168
192
|
const validateForm = async () => {
|
|
169
193
|
try {
|
|
@@ -367,6 +367,12 @@ const InternalAppointmentForm = _ref => {
|
|
|
367
367
|
city: branchById === null || branchById === void 0 ? void 0 : branchById.city
|
|
368
368
|
}
|
|
369
369
|
});
|
|
370
|
+
dispatch({
|
|
371
|
+
type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER,
|
|
372
|
+
payload: {
|
|
373
|
+
houseNumber: branchById === null || branchById === void 0 ? void 0 : branchById.street2
|
|
374
|
+
}
|
|
375
|
+
});
|
|
370
376
|
};
|
|
371
377
|
const initialChannel = channel !== null && channel !== void 0 && channel.channelId ? {
|
|
372
378
|
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,
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.number.to-fixed.js");
|
|
4
3
|
require("core-js/modules/esnext.iterator.map.js");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
require("core-js/modules/es.number.to-fixed.js");
|
|
10
8
|
require("core-js/modules/esnext.iterator.map.js");
|
|
11
9
|
var _react = _interopRequireDefault(require("react"));
|
|
12
10
|
var _queries = require("../../__api__/queries");
|
|
@@ -29,7 +27,7 @@ const EmptyState = _ref => {
|
|
|
29
27
|
}, message));
|
|
30
28
|
};
|
|
31
29
|
const InternalSingleOrderCart = _ref2 => {
|
|
32
|
-
var _cart$articles, _cart$totals$
|
|
30
|
+
var _cart$articles, _cart$totals$totalBef, _cart$totals, _cart$totals$discount, _cart$totals2, _cart$totals$totalAft, _cart$totals3, _cart$totals$totalVat, _cart$totals4;
|
|
33
31
|
let {
|
|
34
32
|
handleQuantityChange,
|
|
35
33
|
removeFromCart: _removeFromCart,
|
|
@@ -57,20 +55,16 @@ const InternalSingleOrderCart = _ref2 => {
|
|
|
57
55
|
className: (0, _helpers__.withStyle)('w-full')
|
|
58
56
|
}, /*#__PURE__*/_react.default.createElement("strong", null, "Toebehoren"), isLoadingCart ? /*#__PURE__*/_react.default.createElement(EmptyState, {
|
|
59
57
|
message: "We zijn het overzicht aan het laden..."
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
quantity: article.quantity,
|
|
71
|
-
handleQuantityChange: handleQuantityChange
|
|
72
|
-
});
|
|
73
|
-
}) : /*#__PURE__*/_react.default.createElement(EmptyState, {
|
|
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, {
|
|
74
68
|
message: "Er zitten nog geen producten in je winkelwagen."
|
|
75
69
|
}), /*#__PURE__*/_react.default.createElement("hr", null), /*#__PURE__*/_react.default.createElement("div", {
|
|
76
70
|
className: (0, _helpers__.withStyle)('d-flex flex-column align-items-end w-100')
|
|
@@ -78,11 +72,13 @@ const InternalSingleOrderCart = _ref2 => {
|
|
|
78
72
|
className: (0, _helpers__.withStyle)('d-flex flex-column mt-1 w-100')
|
|
79
73
|
}, /*#__PURE__*/_react.default.createElement("p", {
|
|
80
74
|
className: (0, _helpers__.withStyle)('d-flex justify-content-between m-0')
|
|
81
|
-
}, /*#__PURE__*/_react.default.createElement("strong", null, "
|
|
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", {
|
|
82
76
|
className: (0, _helpers__.withStyle)('d-flex justify-content-between m-0')
|
|
83
|
-
}, /*#__PURE__*/_react.default.createElement("strong", null, "
|
|
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", {
|
|
84
78
|
className: (0, _helpers__.withStyle)('d-flex justify-content-between m-0')
|
|
85
|
-
}, /*#__PURE__*/_react.default.createElement("strong", null, "Totaal:"), /*#__PURE__*/_react.default.createElement("span", null, " \u20AC", (
|
|
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)))))
|
|
86
82
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
87
83
|
className: (0, _helpers__.withStyle)('d-flex mt-2 justify-content-between')
|
|
88
84
|
}, /*#__PURE__*/_react.default.createElement(_LinkButton.default, {
|
|
@@ -31,7 +31,6 @@ 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");
|
|
35
34
|
function _interopRequireDefault(e) {
|
|
36
35
|
return e && e.__esModule ? e : {
|
|
37
36
|
default: e
|
|
@@ -102,7 +101,6 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
102
101
|
if (singleOrderFormulaCode) {
|
|
103
102
|
formula = singleOrderFormulaCode;
|
|
104
103
|
}
|
|
105
|
-
const isTmg = (0, _useIsTmg.useIsTmg)();
|
|
106
104
|
const mergedFilters = _objectSpread(_objectSpread({}, filters), {}, {
|
|
107
105
|
licensePlate,
|
|
108
106
|
model,
|
|
@@ -127,9 +125,8 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
127
125
|
message: "Geen producten gevonden.",
|
|
128
126
|
subMessage: "Probeer een ander filter toe te passen."
|
|
129
127
|
}), 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 => {
|
|
130
|
-
var _cart$find$quantity, _cart$find, _article$locationPric, _article$locationPric2, _article$locationPric3, _article$
|
|
128
|
+
var _cart$find$quantity, _cart$find, _article$locationPric, _article$locationPric2, _article$locationPric3, _article$consumerPric;
|
|
131
129
|
return /*#__PURE__*/_react.default.createElement(_SingleOrderProductCard.default, {
|
|
132
|
-
isTmg: isTmg,
|
|
133
130
|
key: article.articleNumber,
|
|
134
131
|
isModelArticle: Boolean(model || licensePlate),
|
|
135
132
|
removeFromCart: () => _removeFromCart(article.articleNumber),
|
|
@@ -138,10 +135,7 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
138
135
|
isSelected: false,
|
|
139
136
|
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,
|
|
140
137
|
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,
|
|
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
|
-
},
|
|
138
|
+
handleSelected: () => handleQuantityChange(article.articleNumber, 1),
|
|
145
139
|
productUsps: [{
|
|
146
140
|
type: 'excl',
|
|
147
141
|
text: article === null || article === void 0 ? void 0 : article.excl
|
|
@@ -158,8 +152,7 @@ const InternalSingleOrderProductOverview = _ref => {
|
|
|
158
152
|
productImage: article.image,
|
|
159
153
|
productSpecifications: (0, _product.extractProductSpecsArray)(article),
|
|
160
154
|
productTitle: article.name,
|
|
161
|
-
productPrice: Number(article === null || article === void 0 || (_article$
|
|
162
|
-
productPriceInclVat: Number(article === null || article === void 0 || (_article$locationPric7 = article.locationPrices) === null || _article$locationPric7 === void 0 ? void 0 : _article$locationPric7.priceInclVat).toFixed(2),
|
|
155
|
+
productPrice: Number(article === null || article === void 0 || (_article$consumerPric = article.consumerPrices) === null || _article$consumerPric === void 0 ? void 0 : _article$consumerPric.priceInclVat).toFixed(2),
|
|
163
156
|
productType: article === null || article === void 0 ? void 0 : article.type,
|
|
164
157
|
productGroup: article === null || article === void 0 ? void 0 : article.group,
|
|
165
158
|
productSubgroup: article === null || article === void 0 ? void 0 : article.subgroup
|
|
@@ -512,16 +512,12 @@ const orderSessionReducer = (state, action) => {
|
|
|
512
512
|
{
|
|
513
513
|
const {
|
|
514
514
|
articleNumber,
|
|
515
|
-
quantity
|
|
516
|
-
productPrice,
|
|
517
|
-
productPriceInclVat
|
|
515
|
+
quantity
|
|
518
516
|
} = action.payload;
|
|
519
517
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
520
518
|
singleOrderCart: [...state.singleOrderCart.filter(p => p.articleNumber !== articleNumber), {
|
|
521
519
|
articleNumber,
|
|
522
|
-
quantity
|
|
523
|
-
productPrice,
|
|
524
|
-
productPriceInclVat
|
|
520
|
+
quantity
|
|
525
521
|
}],
|
|
526
522
|
isTouched: true
|
|
527
523
|
});
|
|
@@ -195,15 +195,13 @@ 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) => {
|
|
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
|
|
205
|
-
productPrice,
|
|
206
|
-
productPriceInclVat
|
|
204
|
+
quantity
|
|
207
205
|
}
|
|
208
206
|
});
|
|
209
207
|
} else {
|