thm-p3-configurator 0.0.291 → 0.0.293
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/__components__/ProductCard/ProductCardPrice.js +11 -8
- package/dist/src/shared/__containers__/ExtraProductsOverview.js +21 -3
- package/dist/src/shared/__containers__/internal/InternalAppointmentSuccessModal.js +1 -3
- package/dist/src/shared/__containers__/internal/InternalQuotationSuccessModal.js +1 -3
- package/package.json +1 -1
|
@@ -21,14 +21,17 @@ const ProductCardPrice = _ref => {
|
|
|
21
21
|
className: (0, _helpers__.withStyle)('card__price')
|
|
22
22
|
}, (0, _helpers__.formatPrice)(price));
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
if (discountedPrice < price) {
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
26
|
+
className: (0, _helpers__.withStyle)('card__price')
|
|
27
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
28
|
+
className: (0, _helpers__.withStyle)('strikethrough card-price-label')
|
|
29
|
+
}, (0, _helpers__.formatPrice)(price))), /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
+
className: (0, _helpers__.withStyle)('card__price text-danger')
|
|
31
|
+
}, (0, _helpers__.formatPrice)(discountedPrice)));
|
|
32
|
+
}
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
31
34
|
className: (0, _helpers__.withStyle)('card__price')
|
|
32
|
-
}, (0, _helpers__.formatPrice)(price))
|
|
35
|
+
}, (0, _helpers__.formatPrice)(price));
|
|
33
36
|
};
|
|
34
37
|
var _default = exports.default = ProductCardPrice;
|
|
@@ -21,6 +21,7 @@ var _queries = require("../__api__/queries");
|
|
|
21
21
|
var _ProductCard = _interopRequireDefault(require("../__components__/ProductCard"));
|
|
22
22
|
var _InlineSpinner = _interopRequireDefault(require("../__components__/Spinners/InlineSpinner"));
|
|
23
23
|
var _constants__ = require("../__constants__");
|
|
24
|
+
var _cartTable = require("../__constants__/cartTable");
|
|
24
25
|
var _FormulaContext = require("../__context__/FormulaContext");
|
|
25
26
|
var _OrderSessionContext = require("../__context__/OrderSessionContext");
|
|
26
27
|
var _helpers__ = require("../__helpers__");
|
|
@@ -168,7 +169,24 @@ const ExtraProductsOverview = () => {
|
|
|
168
169
|
className: (0, _helpers__.withStyle)(index === 0 ? 'mt-0' : 'mt-5'),
|
|
169
170
|
key: "category-".concat(item.categoryName)
|
|
170
171
|
}, /*#__PURE__*/_react.default.createElement("h2", null, item.categoryName), item.products.map((product, index) => {
|
|
171
|
-
var _product$locationPric, _product$images, _product$images2, _product$boldDescript;
|
|
172
|
+
var _product$consumerPric, _product$consumerPric2, _product$locationPric, _product$images, _product$images2, _product$boldDescript;
|
|
173
|
+
const isSelectedExtra = selectedExtras.hasOwnProperty(product.articleNumber);
|
|
174
|
+
const salesPriceInclVat = product === null || product === void 0 || (_product$consumerPric = product.consumerPrices) === null || _product$consumerPric === void 0 ? void 0 : _product$consumerPric.priceInclVat;
|
|
175
|
+
const listPriceExclVat = product === null || product === void 0 || (_product$consumerPric2 = product.consumerPrices) === null || _product$consumerPric2 === void 0 ? void 0 : _product$consumerPric2.listPriceExclVat;
|
|
176
|
+
const hasSalesPriceInclVat = salesPriceInclVat != null && !Number.isNaN(Number(salesPriceInclVat));
|
|
177
|
+
const resolvedSalesPriceInclVat = hasSalesPriceInclVat ? Number(salesPriceInclVat) : null;
|
|
178
|
+
const resolvedListPriceInclVat = listPriceExclVat != null && !Number.isNaN(Number(listPriceExclVat)) ? Number(listPriceExclVat) * _cartTable.VAT_RATE : null;
|
|
179
|
+
let resolvedProductPrice = (product === null || product === void 0 ? void 0 : product.fromPrice) || (product === null || product === void 0 ? void 0 : product.price);
|
|
180
|
+
let resolvedProductDiscountedPrice = product !== null && product !== void 0 && product.fromPrice ? product === null || product === void 0 ? void 0 : product.price : null;
|
|
181
|
+
if (hasSalesPriceInclVat) {
|
|
182
|
+
if (resolvedListPriceInclVat != null && resolvedListPriceInclVat > resolvedSalesPriceInclVat) {
|
|
183
|
+
resolvedProductPrice = resolvedListPriceInclVat;
|
|
184
|
+
resolvedProductDiscountedPrice = resolvedSalesPriceInclVat;
|
|
185
|
+
} else {
|
|
186
|
+
resolvedProductPrice = resolvedSalesPriceInclVat;
|
|
187
|
+
resolvedProductDiscountedPrice = null;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
172
190
|
return /*#__PURE__*/_react.default.createElement(_ProductCard.default, {
|
|
173
191
|
isTmg: isTmg,
|
|
174
192
|
stock: product === null || product === void 0 || (_product$locationPric = product.locationPrices) === null || _product$locationPric === void 0 ? void 0 : _product$locationPric.stock,
|
|
@@ -194,9 +212,9 @@ const ExtraProductsOverview = () => {
|
|
|
194
212
|
productCategory
|
|
195
213
|
});
|
|
196
214
|
},
|
|
197
|
-
productDiscountedPrice:
|
|
215
|
+
productDiscountedPrice: resolvedProductDiscountedPrice,
|
|
198
216
|
productDiscountedLabel: (_product$boldDescript = product.boldDescription) === null || _product$boldDescript === void 0 ? void 0 : _product$boldDescript.ops[0].insert,
|
|
199
|
-
productPrice:
|
|
217
|
+
productPrice: resolvedProductPrice,
|
|
200
218
|
productSpecifications: product.specifications ? (0, _product.extractProductSpecsArray)(product.specifications) : [],
|
|
201
219
|
showPrice: true
|
|
202
220
|
});
|
|
@@ -83,10 +83,8 @@ const InternalAppointmentSuccessModal = _ref => {
|
|
|
83
83
|
|
|
84
84
|
// Redirect to detail page if entityId is available, otherwise fallback to overview
|
|
85
85
|
if (entityId) {
|
|
86
|
-
const branchId = orderSession.selectedBranch;
|
|
87
86
|
const baseUrl = isAppointmentRequest ? "/afspraak-aanvragen/".concat(entityId) : "/afspraken/".concat(entityId);
|
|
88
|
-
|
|
89
|
-
history.push(url);
|
|
87
|
+
history.push(baseUrl);
|
|
90
88
|
} else {
|
|
91
89
|
history.push(isAppointmentRequest ? '/afspraak-aanvragen' : '/afspraken');
|
|
92
90
|
}
|
|
@@ -82,9 +82,7 @@ const InternalQuotationSuccessModal = _ref => {
|
|
|
82
82
|
|
|
83
83
|
// Redirect to detail page if entityId is available, otherwise fallback to overview
|
|
84
84
|
if (entityId) {
|
|
85
|
-
|
|
86
|
-
const url = branchId ? "/offertes/".concat(entityId, "?branchId=").concat(branchId) : "/offertes/".concat(entityId);
|
|
87
|
-
history.push(url);
|
|
85
|
+
history.push("/offertes/".concat(entityId));
|
|
88
86
|
} else {
|
|
89
87
|
history.push('/offertes');
|
|
90
88
|
}
|