thm-p3-configurator 0.0.272 → 0.0.274
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 +1 -1
- package/dist/src/shared/__components__/Spinners/InlineSpinner.js +26 -0
- package/dist/src/shared/__containers__/ExtraProductsOverview.js +8 -7
- package/dist/src/shared/__containers__/ProductCartSide.js +8 -5
- package/dist/src/shared/__containers__/ProductsCartOverview.js +23 -17
- package/dist/src/shared/__containers__/ProductsOverview.js +8 -6
- package/dist/src/shared/__containers__/VehicleData.js +10 -2
- package/dist/src/shared/__containers__/internal/InternalBranchSelectorModal.js +21 -9
- package/dist/src/shared/__helpers__/cartTable.js +67 -28
- package/package.json +1 -1
package/dist/src/shared/App.js
CHANGED
|
@@ -70,7 +70,7 @@ const App = () => {
|
|
|
70
70
|
(0, _Experiments.default)();
|
|
71
71
|
});
|
|
72
72
|
return /*#__PURE__*/_react.default.createElement(_SentryWrapper.default, null, /*#__PURE__*/_react.default.createElement(_FormulaContext.FormulaController, {
|
|
73
|
-
defaultFormula: _constants__.CONFIGURATOR_FORMULAS.
|
|
73
|
+
defaultFormula: _constants__.CONFIGURATOR_FORMULAS.THC
|
|
74
74
|
}, /*#__PURE__*/_react.default.createElement(_CountryContext.CountryController, {
|
|
75
75
|
defaultCountry: APP_CONFIG.country
|
|
76
76
|
}, /*#__PURE__*/_react.default.createElement(_OrderSessionContext.OrderSessionController, null, /*#__PURE__*/_react.default.createElement(_reactQuery.QueryClientProvider, {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _helpers__ = require("../../__helpers__");
|
|
9
|
+
function _interopRequireDefault(e) {
|
|
10
|
+
return e && e.__esModule ? e : {
|
|
11
|
+
default: e
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
const InlineSpinner = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
size = '1rem',
|
|
17
|
+
color = 'primary'
|
|
18
|
+
} = _ref;
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement("i", {
|
|
20
|
+
className: "fas fa-cog fa-spin ".concat((0, _helpers__.withStyle)("text-".concat(color))),
|
|
21
|
+
style: {
|
|
22
|
+
fontSize: size
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var _default = exports.default = InlineSpinner;
|
|
@@ -19,7 +19,7 @@ var _reactRouter = require("react-router");
|
|
|
19
19
|
var _logoPrimary = _interopRequireDefault(require("../../../public/assets/images/logo-primary.png"));
|
|
20
20
|
var _queries = require("../__api__/queries");
|
|
21
21
|
var _ProductCard = _interopRequireDefault(require("../__components__/ProductCard"));
|
|
22
|
-
var
|
|
22
|
+
var _InlineSpinner = _interopRequireDefault(require("../__components__/Spinners/InlineSpinner"));
|
|
23
23
|
var _constants__ = require("../__constants__");
|
|
24
24
|
var _FormulaContext = require("../__context__/FormulaContext");
|
|
25
25
|
var _OrderSessionContext = require("../__context__/OrderSessionContext");
|
|
@@ -60,7 +60,6 @@ function _interopRequireWildcard(e, r) {
|
|
|
60
60
|
}
|
|
61
61
|
const ExtraProductsOverview = () => {
|
|
62
62
|
var _products$Extras;
|
|
63
|
-
const isProductsInitialLoad = (0, _react.useRef)(true);
|
|
64
63
|
const formula = (0, _FormulaContext.useFormula)();
|
|
65
64
|
const isTmg = (0, _useIsTmg.useIsTmg)();
|
|
66
65
|
const [skipFilters, setSkipFilters] = (0, _react.useState)(false);
|
|
@@ -104,10 +103,6 @@ const ExtraProductsOverview = () => {
|
|
|
104
103
|
discountCode,
|
|
105
104
|
skipFilters
|
|
106
105
|
});
|
|
107
|
-
if (isLoadingProducts && isProductsInitialLoad.current === true) {
|
|
108
|
-
isProductsInitialLoad.current = false;
|
|
109
|
-
return /*#__PURE__*/_react.default.createElement(_FullPageSpinner.default, null);
|
|
110
|
-
}
|
|
111
106
|
if (isProductsError || !isLoadingProducts && !(products !== null && products !== void 0 && (_products$Extras = products.Extras) !== null && _products$Extras !== void 0 && _products$Extras.length)) {
|
|
112
107
|
return /*#__PURE__*/_react.default.createElement(_reactRouter.Redirect, {
|
|
113
108
|
to: "/configurator/geen-producten"
|
|
@@ -142,7 +137,13 @@ const ExtraProductsOverview = () => {
|
|
|
142
137
|
delete products[_constants__.PRODUCT_CATEGORIES.CABLESET];
|
|
143
138
|
delete products[_constants__.PRODUCT_CATEGORIES.COMBISET];
|
|
144
139
|
delete products[_constants__.PRODUCT_CATEGORIES.BOARD_COMPUTER];
|
|
145
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null,
|
|
140
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, isLoadingProducts ? /*#__PURE__*/_react.default.createElement("div", {
|
|
141
|
+
className: (0, _helpers__.withStyle)('d-flex justify-content-center align-items-center py-5')
|
|
142
|
+
}, /*#__PURE__*/_react.default.createElement(_InlineSpinner.default, {
|
|
143
|
+
size: "2rem"
|
|
144
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
145
|
+
className: (0, _helpers__.withStyle)('ms-3')
|
|
146
|
+
}, "Extra producten laden...")) : Object.entries(products).map((_ref2, index) => {
|
|
146
147
|
let [productCategory, productsPerCategory] = _ref2;
|
|
147
148
|
if (!productsPerCategory.length || productCategory !== _constants__.PRODUCT_CATEGORIES.EXTRAS) {
|
|
148
149
|
return null;
|
|
@@ -37,7 +37,7 @@ var _ProductTableSection = _interopRequireDefault(require("../__components__/Pro
|
|
|
37
37
|
var _ProductTableSectionTotal = _interopRequireDefault(require("../__components__/ProductTable/ProductTableSectionTotal"));
|
|
38
38
|
var _ProductTableStaticRow = _interopRequireDefault(require("../__components__/ProductTable/ProductTableStaticRow"));
|
|
39
39
|
var _ProductTableTotal = _interopRequireDefault(require("../__components__/ProductTable/ProductTableTotal"));
|
|
40
|
-
var
|
|
40
|
+
var _InlineSpinner = _interopRequireDefault(require("../__components__/Spinners/InlineSpinner"));
|
|
41
41
|
var _FormulaContext = require("../__context__/FormulaContext");
|
|
42
42
|
var _OrderSessionContext = require("../__context__/OrderSessionContext");
|
|
43
43
|
var _helpers__ = require("../__helpers__");
|
|
@@ -141,9 +141,6 @@ const ProductCartSide = () => {
|
|
|
141
141
|
mainProducts = [towbar, combiset, cableset, boardComputer].filter(Boolean);
|
|
142
142
|
accessoireProducts = extras.length > 0 && ((_products$Extras = products.Extras) === null || _products$Extras === void 0 ? void 0 : _products$Extras.filter(product => extras.includes(product.articleNumber.toString()))) || [];
|
|
143
143
|
}
|
|
144
|
-
if (isLoadingProducts) {
|
|
145
|
-
return /*#__PURE__*/_react.default.createElement(_FullPageSpinner.default, null);
|
|
146
|
-
}
|
|
147
144
|
|
|
148
145
|
/**
|
|
149
146
|
* Calculate item prices from a cart item
|
|
@@ -181,7 +178,13 @@ const ProductCartSide = () => {
|
|
|
181
178
|
const montageInclVat = parseFloat(totals === null || totals === void 0 ? void 0 : totals.montagePricePlusMarketCorrectionInclVat) || 0;
|
|
182
179
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
183
180
|
className: (0, _helpers__.withStyle)("col-lg mt-3")
|
|
184
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
181
|
+
}, isLoadingProducts ? /*#__PURE__*/_react.default.createElement("div", {
|
|
182
|
+
className: (0, _helpers__.withStyle)('d-flex justify-content-center align-items-center py-5')
|
|
183
|
+
}, /*#__PURE__*/_react.default.createElement(_InlineSpinner.default, {
|
|
184
|
+
size: "2rem"
|
|
185
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
186
|
+
className: (0, _helpers__.withStyle)('ms-3')
|
|
187
|
+
}, "Overzicht laden...")) : /*#__PURE__*/_react.default.createElement(_TogglableCard.default, {
|
|
185
188
|
title: 'Overzicht',
|
|
186
189
|
untoggleButton: selectedBranch ? 'Verberg inkoopprijzen' : undefined,
|
|
187
190
|
toggleButton: selectedBranch ? 'Toon inkoopprijzen' : undefined,
|
|
@@ -53,7 +53,7 @@ var _ProductTableSection = _interopRequireDefault(require("../__components__/Pro
|
|
|
53
53
|
var _ProductTableSectionTotal = _interopRequireDefault(require("../__components__/ProductTable/ProductTableSectionTotal"));
|
|
54
54
|
var _ProductTableStaticRow = _interopRequireDefault(require("../__components__/ProductTable/ProductTableStaticRow"));
|
|
55
55
|
var _ProductTableTotal = _interopRequireDefault(require("../__components__/ProductTable/ProductTableTotal"));
|
|
56
|
-
var
|
|
56
|
+
var _InlineSpinner = _interopRequireDefault(require("../__components__/Spinners/InlineSpinner"));
|
|
57
57
|
var _constants__ = require("../__constants__");
|
|
58
58
|
var _cartTable = require("../__constants__/cartTable");
|
|
59
59
|
var _FormulaContext = require("../__context__/FormulaContext");
|
|
@@ -569,10 +569,8 @@ const ProductCartTable = () => {
|
|
|
569
569
|
// RENDER
|
|
570
570
|
// ============================================================================
|
|
571
571
|
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
}
|
|
575
|
-
const headerColumns = (0, _cartTable2.getCartTableHeaderColumns)(displayMode);
|
|
572
|
+
const showCatalogPrice = !isThc;
|
|
573
|
+
const headerColumns = (0, _cartTable2.getCartTableHeaderColumns)(displayMode, showCatalogPrice);
|
|
576
574
|
const montageRateInputCell = isThc ? {} : {
|
|
577
575
|
text: renderMontageRateInput(),
|
|
578
576
|
className: _cartTable.CART_TABLE_PRICE_CELL_CLASS
|
|
@@ -586,7 +584,13 @@ const ProductCartTable = () => {
|
|
|
586
584
|
} : {} : {};
|
|
587
585
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
588
586
|
className: (0, _helpers__.withStyle)('content col-lg')
|
|
589
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
587
|
+
}, isLoadingProducts ? /*#__PURE__*/_react.default.createElement("div", {
|
|
588
|
+
className: (0, _helpers__.withStyle)('d-flex justify-content-center align-items-center py-5')
|
|
589
|
+
}, /*#__PURE__*/_react.default.createElement(_InlineSpinner.default, {
|
|
590
|
+
size: "2rem"
|
|
591
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
592
|
+
className: (0, _helpers__.withStyle)('ms-3')
|
|
593
|
+
}, "Overzicht laden...")) : /*#__PURE__*/_react.default.createElement(_TogglableCard.default, {
|
|
590
594
|
title: "Overzicht",
|
|
591
595
|
untoggleButton: selectedBranch || isTmg ? 'Verberg inkoopprijzen' : undefined,
|
|
592
596
|
toggleButton: selectedBranch || isTmg ? 'Toon inkoopprijzen' : undefined,
|
|
@@ -625,6 +629,7 @@ const ProductCartTable = () => {
|
|
|
625
629
|
discountInputCell: discountInputCellMain,
|
|
626
630
|
vehicleCodingInputCell,
|
|
627
631
|
isVehicleCodingProduct,
|
|
632
|
+
showCatalogPrice,
|
|
628
633
|
treatZeroPurchaseAsNvt: Boolean(isBoardComputerProduct)
|
|
629
634
|
})
|
|
630
635
|
});
|
|
@@ -632,11 +637,11 @@ const ProductCartTable = () => {
|
|
|
632
637
|
productTitle: "Montage",
|
|
633
638
|
productSubtitle: (0, _helpers__.formatMontageTime)(totals === null || totals === void 0 ? void 0 : totals.montageTime),
|
|
634
639
|
productImage: _montagePlaceholder.default,
|
|
635
|
-
extraCells: (0, _cartTable2.getMontageCells)(displayMode, totals === null || totals === void 0 ? void 0 : totals.totalMontageExclVat, totals === null || totals === void 0 ? void 0 : totals.montagePricePlusMarketCorrectionInclVat, montageRateCellOverrides)
|
|
640
|
+
extraCells: (0, _cartTable2.getMontageCells)(displayMode, totals === null || totals === void 0 ? void 0 : totals.totalMontageExclVat, totals === null || totals === void 0 ? void 0 : totals.montagePricePlusMarketCorrectionInclVat, montageRateCellOverrides, showCatalogPrice)
|
|
636
641
|
}), isToggled && marketCorrectionValues.hasValue && /*#__PURE__*/_react.default.createElement(_ProductTableStaticRow.default, {
|
|
637
642
|
productTitle: "Marktcorrectie",
|
|
638
643
|
productImage: _montagePlaceholder.default,
|
|
639
|
-
extraCells: (0, _cartTable2.getMarketCorrectionCells)(displayMode, marketCorrectionValues)
|
|
644
|
+
extraCells: (0, _cartTable2.getMarketCorrectionCells)(displayMode, marketCorrectionValues, showCatalogPrice)
|
|
640
645
|
}), /*#__PURE__*/_react.default.createElement(_ProductTableSectionTotal.default, {
|
|
641
646
|
isEditable: true,
|
|
642
647
|
editLabel: "Wijzig je trekhaakpakket",
|
|
@@ -648,7 +653,7 @@ const ProductCartTable = () => {
|
|
|
648
653
|
sales: subtotals.main.exclVat
|
|
649
654
|
},
|
|
650
655
|
defaultSubtotal: subtotals.main.inclVat
|
|
651
|
-
})
|
|
656
|
+
}, showCatalogPrice)
|
|
652
657
|
})), accessoireProducts.length > 0 && /*#__PURE__*/_react.default.createElement(_ProductTableSection.default, {
|
|
653
658
|
heading: "Toebehoren"
|
|
654
659
|
}, accessoireProducts.map(product => {
|
|
@@ -673,7 +678,8 @@ const ProductCartTable = () => {
|
|
|
673
678
|
extraCells: (0, _cartTable2.getAccessoryProductCells)({
|
|
674
679
|
displayMode,
|
|
675
680
|
priceInfo: product.priceInfo,
|
|
676
|
-
discountInputCell: discountInputCellAccessory
|
|
681
|
+
discountInputCell: discountInputCellAccessory,
|
|
682
|
+
showCatalogPrice
|
|
677
683
|
}),
|
|
678
684
|
productAmount: selectedExtras[product.articleNumber],
|
|
679
685
|
onEdit: value => {
|
|
@@ -703,24 +709,24 @@ const ProductCartTable = () => {
|
|
|
703
709
|
sales: totals === null || totals === void 0 ? void 0 : totals.totalExtrasExclVat
|
|
704
710
|
},
|
|
705
711
|
defaultSubtotal: APP_CONFIG.internal ? totals === null || totals === void 0 ? void 0 : totals.totalExtrasInclVat : (totals === null || totals === void 0 ? void 0 : totals.totalExtrasExclVat) * _cartTable.VAT_RATE
|
|
706
|
-
})
|
|
712
|
+
}, showCatalogPrice)
|
|
707
713
|
})), /*#__PURE__*/_react.default.createElement(_ProductTableTotal.default, {
|
|
708
714
|
rows: [(0, _cartTable2.getTotalRowCells)(displayMode, {
|
|
709
715
|
label: 'Producten (excl. btw)',
|
|
710
716
|
locationValue: totals === null || totals === void 0 ? void 0 : totals.totalLocationPriceExclVat,
|
|
711
717
|
consumerValue: isToggled ? totals === null || totals === void 0 ? void 0 : totals.totalBeforeDiscountExclVat : totals === null || totals === void 0 ? void 0 : totals.totalAfterDiscountExclVat,
|
|
712
718
|
className: 'text-end pt-2'
|
|
713
|
-
}), (0, _cartTable2.getTotalRowCells)(displayMode, {
|
|
719
|
+
}, showCatalogPrice), (0, _cartTable2.getTotalRowCells)(displayMode, {
|
|
714
720
|
label: 'btw',
|
|
715
721
|
locationValue: totals === null || totals === void 0 ? void 0 : totals.totalLocationVat,
|
|
716
722
|
consumerValue: isToggled ? totals === null || totals === void 0 ? void 0 : totals.totalVatBeforeDiscount : totals === null || totals === void 0 ? void 0 : totals.totalVatAfterDiscount,
|
|
717
723
|
className: 'text-end'
|
|
718
|
-
}), (0, _cartTable2.getTotalRowCells)(displayMode, {
|
|
724
|
+
}, showCatalogPrice), (0, _cartTable2.getTotalRowCells)(displayMode, {
|
|
719
725
|
label: 'Totaal (incl. btw)',
|
|
720
726
|
locationValue: totals === null || totals === void 0 ? void 0 : totals.totalLocationPriceInclVat,
|
|
721
727
|
consumerValue: isToggled ? totals === null || totals === void 0 ? void 0 : totals.totalBeforeDiscountInclVat : APP_CONFIG.internal ? totals === null || totals === void 0 ? void 0 : totals.totalBeforeDiscountInclVat : totals === null || totals === void 0 ? void 0 : totals.totalAfterDiscountInclVat,
|
|
722
728
|
className: 'fw-bold text-end'
|
|
723
|
-
})]
|
|
729
|
+
}, showCatalogPrice)]
|
|
724
730
|
}), (discountAmount || discountPercentage) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", {
|
|
725
731
|
colSpan: "10",
|
|
726
732
|
className: (0, _helpers__.withStyle)('pt-4 pb-2')
|
|
@@ -729,15 +735,15 @@ const ProductCartTable = () => {
|
|
|
729
735
|
label: discountPercentage ? "Correctie (".concat(discountPercentage, "%)") : 'Correctie',
|
|
730
736
|
value: "-".concat((0, _helpers__.formatPrice)(totals === null || totals === void 0 ? void 0 : totals.discountInclVat)),
|
|
731
737
|
className: 'text-end text-success'
|
|
732
|
-
}), (0, _cartTable2.getDiscountRowCells)(displayMode, {
|
|
738
|
+
}, showCatalogPrice), (0, _cartTable2.getDiscountRowCells)(displayMode, {
|
|
733
739
|
label: 'Totaal na correctie (excl. btw)',
|
|
734
740
|
value: (0, _helpers__.formatPrice)(totals === null || totals === void 0 ? void 0 : totals.totalAfterDiscountExclVat),
|
|
735
741
|
className: 'text-end'
|
|
736
|
-
}), (0, _cartTable2.getDiscountRowCells)(displayMode, {
|
|
742
|
+
}, showCatalogPrice), (0, _cartTable2.getDiscountRowCells)(displayMode, {
|
|
737
743
|
label: 'Totaal na correctie (incl. btw)',
|
|
738
744
|
value: (0, _helpers__.formatPrice)(totals === null || totals === void 0 ? void 0 : totals.totalAfterDiscountInclVat),
|
|
739
745
|
className: 'fw-bold text-end'
|
|
740
|
-
})]
|
|
746
|
+
}, showCatalogPrice)]
|
|
741
747
|
})))), APP_CONFIG.internal && /*#__PURE__*/_react.default.createElement(_InternalDiscountForm.default, null)));
|
|
742
748
|
};
|
|
743
749
|
var _default = exports.default = ProductCartTable;
|
|
@@ -26,7 +26,7 @@ var _logoPrimary = _interopRequireDefault(require("../../../public/assets/images
|
|
|
26
26
|
var _queries = require("../__api__/queries");
|
|
27
27
|
var _CheckboxInput = _interopRequireDefault(require("../__components__/Form/CheckboxInput"));
|
|
28
28
|
var _ProductCard = _interopRequireDefault(require("../__components__/ProductCard"));
|
|
29
|
-
var
|
|
29
|
+
var _InlineSpinner = _interopRequireDefault(require("../__components__/Spinners/InlineSpinner"));
|
|
30
30
|
var _constants__ = require("../__constants__");
|
|
31
31
|
var _FormulaContext = require("../__context__/FormulaContext");
|
|
32
32
|
var _OrderSessionContext = require("../__context__/OrderSessionContext");
|
|
@@ -181,10 +181,6 @@ const ProductsOverview = () => {
|
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
183
|
}, [isLoadingProducts, products, selectedTowbar, selectedCableset, selectedBoardComputer, isBoardComputerDeselected, dispatch]);
|
|
184
|
-
if (isLoadingProducts && isProductsInitialLoad.current === true) {
|
|
185
|
-
isProductsInitialLoad.current = false;
|
|
186
|
-
return /*#__PURE__*/_react.default.createElement(_FullPageSpinner.default, null);
|
|
187
|
-
}
|
|
188
184
|
if (isProductsError || !isLoadingProducts && (!(products !== null && products !== void 0 && (_products$Trekhaak3 = products.Trekhaak) !== null && _products$Trekhaak3 !== void 0 && _products$Trekhaak3.length) || !(products !== null && products !== void 0 && (_products$Kabelset = products.Kabelset) !== null && _products$Kabelset !== void 0 && _products$Kabelset.length)) && !(products !== null && products !== void 0 && (_products$Combiset = products.Combiset) !== null && _products$Combiset !== void 0 && _products$Combiset.length)) {
|
|
189
185
|
return /*#__PURE__*/_react.default.createElement(_reactRouter.Redirect, {
|
|
190
186
|
to: "/configurator/geen-producten"
|
|
@@ -305,7 +301,13 @@ const ProductsOverview = () => {
|
|
|
305
301
|
setSkipFilters(value);
|
|
306
302
|
},
|
|
307
303
|
label: "Toon alle artikelen"
|
|
308
|
-
}),
|
|
304
|
+
}), isLoadingProducts && isProductsInitialLoad.current === true ? /*#__PURE__*/_react.default.createElement("div", {
|
|
305
|
+
className: (0, _helpers__.withStyle)('d-flex justify-content-center align-items-center py-5')
|
|
306
|
+
}, /*#__PURE__*/_react.default.createElement(_InlineSpinner.default, {
|
|
307
|
+
size: "2rem"
|
|
308
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
309
|
+
className: (0, _helpers__.withStyle)('ms-3')
|
|
310
|
+
}, "Producten laden...")) : Object.entries(products).map((_ref2, index) => {
|
|
309
311
|
let [productCategory, productsPerCategory] = _ref2;
|
|
310
312
|
if (!productsPerCategory.length) {
|
|
311
313
|
return null;
|
|
@@ -19,6 +19,7 @@ var _queries = require("../__api__/queries");
|
|
|
19
19
|
var _LinkButton = _interopRequireDefault(require("../__components__/Buttons/LinkButton"));
|
|
20
20
|
var _ExpandableCard = _interopRequireDefault(require("../__components__/Cards/ExpandableCard"));
|
|
21
21
|
var _LicensePlateInput = _interopRequireDefault(require("../__components__/Form/LicensePlateInput"));
|
|
22
|
+
var _InlineSpinner = _interopRequireDefault(require("../__components__/Spinners/InlineSpinner"));
|
|
22
23
|
var _FormulaContext = require("../__context__/FormulaContext");
|
|
23
24
|
var _OrderSessionContext = require("../__context__/OrderSessionContext");
|
|
24
25
|
var _helpers__ = require("../__helpers__");
|
|
@@ -51,7 +52,8 @@ const VehicleData = _ref => {
|
|
|
51
52
|
}
|
|
52
53
|
const {
|
|
53
54
|
vehicleDetails,
|
|
54
|
-
vehicleLogo
|
|
55
|
+
vehicleLogo,
|
|
56
|
+
isLoadingProducts
|
|
55
57
|
} = (0, _queries.useProductsQuery)({
|
|
56
58
|
licensePlate,
|
|
57
59
|
model,
|
|
@@ -90,7 +92,13 @@ const VehicleData = _ref => {
|
|
|
90
92
|
className: (0, _helpers__.withStyle)('license-plate__edit link-primary col-12'),
|
|
91
93
|
type: "button"
|
|
92
94
|
})),
|
|
93
|
-
expandedBody:
|
|
95
|
+
expandedBody: isLoadingProducts ? /*#__PURE__*/_react.default.createElement("div", {
|
|
96
|
+
className: (0, _helpers__.withStyle)('d-flex justify-content-center align-items-center py-3')
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement(_InlineSpinner.default, {
|
|
98
|
+
size: "1.5rem"
|
|
99
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
100
|
+
className: (0, _helpers__.withStyle)('ms-2')
|
|
101
|
+
}, "Gegevens laden...")) : Object.entries(vehicleDetails).filter(_ref2 => {
|
|
94
102
|
let [key] = _ref2;
|
|
95
103
|
return isTmg || key !== 'kType' && key !== 'kMod';
|
|
96
104
|
}).map(_ref3 => {
|
|
@@ -72,6 +72,10 @@ const NormalPageModalContent = _ref => {
|
|
|
72
72
|
} = _ref;
|
|
73
73
|
const [_selectedBranchId, _setSelectedBranchId] = (0, _react.useState)();
|
|
74
74
|
const [_branches, _setBranches] = (0, _react.useState)([]);
|
|
75
|
+
const [{
|
|
76
|
+
licensePlate,
|
|
77
|
+
model
|
|
78
|
+
}] = (0, _OrderSessionContext.useOrderSession)();
|
|
75
79
|
const {
|
|
76
80
|
myBranches,
|
|
77
81
|
isLoadingMyBranches
|
|
@@ -97,6 +101,7 @@ const NormalPageModalContent = _ref => {
|
|
|
97
101
|
if (!(_branches !== null && _branches !== void 0 && _branches.length)) return;
|
|
98
102
|
if (selectedBranch) return;
|
|
99
103
|
const shouldAutoSelect = !existingDossierId && !isTMGOrganization && _branches.length === 1;
|
|
104
|
+
console.log(existingDossierId, isTMGOrganization, _branches.length);
|
|
100
105
|
if (!shouldAutoSelect) return;
|
|
101
106
|
const branchToSelect = (_branches$ = _branches[0]) === null || _branches$ === void 0 ? void 0 : _branches$.entityId;
|
|
102
107
|
if (branchToSelect) {
|
|
@@ -249,7 +254,9 @@ const InternalBranchSelectorModal = () => {
|
|
|
249
254
|
const [{
|
|
250
255
|
selectedBranch,
|
|
251
256
|
existingDossierId,
|
|
252
|
-
orderType
|
|
257
|
+
orderType,
|
|
258
|
+
licensePlate,
|
|
259
|
+
model
|
|
253
260
|
}, dispatch] = (0, _OrderSessionContext.useOrderSession)();
|
|
254
261
|
const {
|
|
255
262
|
myBranches,
|
|
@@ -281,15 +288,20 @@ const InternalBranchSelectorModal = () => {
|
|
|
281
288
|
};
|
|
282
289
|
const shouldShowModalForSingleOrder = APP_CONFIG.internal && !selectedBranch && !existingDossierId && isSingleOrderPage && !shouldAutoSelect;
|
|
283
290
|
const shouldShowModalForOtherPages = APP_CONFIG.internal && !selectedBranch && !existingDossierId && !isSingleOrderPage && !isTMGOrganization && !shouldAutoSelect && !isLoadingMyBranches;
|
|
284
|
-
if (isLoadingBranchTypes || isLoadingMyBranches) {
|
|
285
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
286
|
-
className: "thm-configurator-wrapper--offset"
|
|
287
|
-
}, /*#__PURE__*/_react.default.createElement(_FullPageSpinner.default, null));
|
|
288
|
-
}
|
|
289
291
|
|
|
290
|
-
//
|
|
291
|
-
|
|
292
|
-
|
|
292
|
+
// Show loading state only when we actually need to show the modal
|
|
293
|
+
const shouldShowModal = shouldShowModalForSingleOrder || shouldShowModalForOtherPages;
|
|
294
|
+
if (shouldShowModal && (isLoadingBranchTypes || isLoadingMyBranches)) {
|
|
295
|
+
if (licensePlate || model) {
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
299
|
+
className: "thm-configurator-wrapper--offset d-flex justify-content-center align-items-center py-5"
|
|
300
|
+
}, /*#__PURE__*/_react.default.createElement(_FullPageSpinner.default, {
|
|
301
|
+
size: "2rem"
|
|
302
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
303
|
+
className: "ms-3"
|
|
304
|
+
}, "Vestigingen laden..."));
|
|
293
305
|
}
|
|
294
306
|
if ((shouldShowModalForSingleOrder || shouldShowModalForOtherPages) && isTMGOrganization && formula === _constants__.CONFIGURATOR_FORMULAS.TMG && !orderType) {
|
|
295
307
|
return /*#__PURE__*/_react.default.createElement(_OrderTypeSelectorModal.default, {
|
|
@@ -70,15 +70,21 @@ const emptyCells = exports.emptyCells = function emptyCells(count) {
|
|
|
70
70
|
/**
|
|
71
71
|
* Get table header columns based on display mode
|
|
72
72
|
* @param {string} displayMode - The current display mode
|
|
73
|
+
* @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
|
|
73
74
|
* @returns {Array} Array of column configuration objects
|
|
74
75
|
*/
|
|
75
|
-
const getCartTableHeaderColumns = displayMode
|
|
76
|
+
const getCartTableHeaderColumns = exports.getCartTableHeaderColumns = function getCartTableHeaderColumns(displayMode) {
|
|
77
|
+
let showCatalogPrice = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
76
78
|
const baseColumns = [{}, {}, {}, {}];
|
|
77
79
|
switch (displayMode) {
|
|
78
80
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
79
|
-
|
|
81
|
+
// THC: Marge - Inkoopprijs - Verkoopprijs ex BTW (no catalog price)
|
|
82
|
+
// Towmotive: Catalogprijs - Marge - Inkoopprijs - Verkoopprijs ex BTW
|
|
83
|
+
return [...baseColumns, ...(showCatalogPrice ? [textCell('Catalogprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)] : []), textCell('Marge (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Inkoopprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Verkoop Prijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)];
|
|
80
84
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
81
|
-
|
|
85
|
+
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs ex BTW
|
|
86
|
+
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs ex BTW
|
|
87
|
+
return [...baseColumns, textCell('Inkoopprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Marge (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS), ...(showCatalogPrice ? [textCell('Catalogusprijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)] : []), textCell('Korting (%)', _cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Verkoop Prijs (excl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)];
|
|
82
88
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
83
89
|
default:
|
|
84
90
|
return [...baseColumns, {}, {}, textCell('Verkoop Prijs (incl. btw)', _cartTable.CART_TABLE_BOLD_END_CLASS)];
|
|
@@ -97,9 +103,9 @@ const getCartTableHeaderColumns = displayMode => {
|
|
|
97
103
|
* @param {Object} params.discountInputCell - Discount input cell (or empty)
|
|
98
104
|
* @param {Object} params.vehicleCodingInputCell - Vehicle coding input cell (or empty)
|
|
99
105
|
* @param {boolean} params.isVehicleCodingProduct - Whether this is a vehicle coding product
|
|
106
|
+
* @param {boolean} params.showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
|
|
100
107
|
* @returns {Array} Array of cell configuration objects
|
|
101
108
|
*/
|
|
102
|
-
exports.getCartTableHeaderColumns = getCartTableHeaderColumns;
|
|
103
109
|
const getMainProductCells = _ref => {
|
|
104
110
|
let {
|
|
105
111
|
displayMode,
|
|
@@ -107,6 +113,7 @@ const getMainProductCells = _ref => {
|
|
|
107
113
|
discountInputCell,
|
|
108
114
|
vehicleCodingInputCell,
|
|
109
115
|
isVehicleCodingProduct,
|
|
116
|
+
showCatalogPrice = false,
|
|
110
117
|
treatZeroPurchaseAsNvt = false
|
|
111
118
|
} = _ref;
|
|
112
119
|
const {
|
|
@@ -124,9 +131,11 @@ const getMainProductCells = _ref => {
|
|
|
124
131
|
const baseCells = [vehicleCodingInputCell, {}, {}];
|
|
125
132
|
switch (displayMode) {
|
|
126
133
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
127
|
-
return [...baseCells, priceCell(catalogPriceExcl), textCell(hasLocationTotal ? (0, _index.formatPrice)(margin) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(shouldShowPurchasePrice ? (0, _index.formatPrice)(purchasePrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(salesPrice > 0 ? (0, _index.formatPrice)(salesPrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)];
|
|
134
|
+
return [...baseCells, ...(showCatalogPrice ? [priceCell(catalogPriceExcl)] : []), textCell(hasLocationTotal ? (0, _index.formatPrice)(margin) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(shouldShowPurchasePrice ? (0, _index.formatPrice)(purchasePrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(salesPrice > 0 ? (0, _index.formatPrice)(salesPrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)];
|
|
128
135
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
129
|
-
|
|
136
|
+
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
137
|
+
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
138
|
+
return [...baseCells, textCell(shouldShowPurchasePrice ? (0, _index.formatPrice)(purchasePrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(hasLocationTotal ? (0, _index.formatPrice)(margin) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), ...(showCatalogPrice ? [priceCell(catalogPriceExcl)] : []), discountInputCell, priceCell(salesPrice)];
|
|
130
139
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
131
140
|
default:
|
|
132
141
|
{
|
|
@@ -142,6 +151,7 @@ const getMainProductCells = _ref => {
|
|
|
142
151
|
* @param {string} params.displayMode - Current display mode
|
|
143
152
|
* @param {Object} params.priceInfo - Price information for the product
|
|
144
153
|
* @param {Object} params.discountInputCell - Discount input cell (or empty)
|
|
154
|
+
* @param {boolean} params.showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
|
|
145
155
|
* @returns {Array} Array of cell configuration objects
|
|
146
156
|
*/
|
|
147
157
|
exports.getMainProductCells = getMainProductCells;
|
|
@@ -149,7 +159,8 @@ const getAccessoryProductCells = _ref2 => {
|
|
|
149
159
|
let {
|
|
150
160
|
displayMode,
|
|
151
161
|
priceInfo,
|
|
152
|
-
discountInputCell
|
|
162
|
+
discountInputCell,
|
|
163
|
+
showCatalogPrice = false
|
|
153
164
|
} = _ref2;
|
|
154
165
|
const {
|
|
155
166
|
purchasePrice,
|
|
@@ -166,9 +177,11 @@ const getAccessoryProductCells = _ref2 => {
|
|
|
166
177
|
const baseCells = [{}, {}, {}];
|
|
167
178
|
switch (displayMode) {
|
|
168
179
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
169
|
-
return [...baseCells, priceCell(catalogPriceExcl), textCell(hasLocationTotal ? (0, _index.formatPrice)(margin) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(shouldShowPurchasePrice ? (0, _index.formatPrice)(purchasePrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(salesPrice > 0 ? (0, _index.formatPrice)(salesPrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)];
|
|
180
|
+
return [...baseCells, ...(showCatalogPrice ? [priceCell(catalogPriceExcl)] : []), textCell(hasLocationTotal ? (0, _index.formatPrice)(margin) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(shouldShowPurchasePrice ? (0, _index.formatPrice)(purchasePrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(salesPrice > 0 ? (0, _index.formatPrice)(salesPrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)];
|
|
170
181
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
171
|
-
|
|
182
|
+
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
183
|
+
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
184
|
+
return [...baseCells, textCell(shouldShowPurchasePrice ? (0, _index.formatPrice)(purchasePrice) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), textCell(hasLocationTotal ? (0, _index.formatPrice)(margin) : 'N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS), ...(showCatalogPrice ? [priceCell(catalogPriceExcl)] : []), discountInputCell, priceCell(salesPrice)];
|
|
172
185
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
173
186
|
default:
|
|
174
187
|
{
|
|
@@ -186,11 +199,13 @@ const getAccessoryProductCells = _ref2 => {
|
|
|
186
199
|
* @param {Object} overrides - Optional overrides for discount/price cells
|
|
187
200
|
* @param {Object} overrides.discountCell - Override cell for discount column (toggled standard)
|
|
188
201
|
* @param {Object} overrides.priceCell - Override cell for price column
|
|
202
|
+
* @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
|
|
189
203
|
* @returns {Array} Array of cell configuration objects
|
|
190
204
|
*/
|
|
191
205
|
exports.getAccessoryProductCells = getAccessoryProductCells;
|
|
192
206
|
const getMontageCells = exports.getMontageCells = function getMontageCells(displayMode, montagePrice, montagePriceInclVat) {
|
|
193
207
|
let overrides = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
208
|
+
let showCatalogPrice = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
194
209
|
const {
|
|
195
210
|
discountCell: discountOverride,
|
|
196
211
|
priceCell: priceOverride
|
|
@@ -199,9 +214,13 @@ const getMontageCells = exports.getMontageCells = function getMontageCells(displ
|
|
|
199
214
|
const nvt = textCell('N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS);
|
|
200
215
|
switch (displayMode) {
|
|
201
216
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
202
|
-
|
|
217
|
+
// THC: Marge - Inkoopprijs - Verkoopprijs (no catalog price)
|
|
218
|
+
// Towmotive: Catalogprijs - Marge - Inkoopprijs - Verkoopprijs
|
|
219
|
+
return [...baseCells, ...(showCatalogPrice ? [nvt] : []), nvt, nvt, priceOverride || priceCell(montagePrice)];
|
|
203
220
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
204
|
-
|
|
221
|
+
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
222
|
+
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
223
|
+
return [...baseCells, nvt, nvt, ...(showCatalogPrice ? [nvt] : []), discountOverride || emptyCell(_cartTable.CART_TABLE_PRICE_CELL_CLASS), priceOverride || priceCell(montagePrice)];
|
|
205
224
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
206
225
|
default:
|
|
207
226
|
return [discountOverride || {}, {}, {}, {}, {}, priceOverride || priceCell(montagePriceInclVat)];
|
|
@@ -215,20 +234,26 @@ const getMontageCells = exports.getMontageCells = function getMontageCells(displ
|
|
|
215
234
|
* @param {number} values.purchaseExcl - Purchase price excl VAT
|
|
216
235
|
* @param {number} values.margin - Margin
|
|
217
236
|
* @param {number} values.salesExcl - Sales price excl VAT
|
|
237
|
+
* @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
|
|
218
238
|
* @returns {Array} Array of cell configuration objects
|
|
219
239
|
*/
|
|
220
|
-
const getMarketCorrectionCells = (displayMode, _ref3)
|
|
240
|
+
const getMarketCorrectionCells = exports.getMarketCorrectionCells = function getMarketCorrectionCells(displayMode, _ref3) {
|
|
221
241
|
let {
|
|
222
242
|
purchaseExcl,
|
|
223
243
|
margin,
|
|
224
244
|
salesExcl
|
|
225
245
|
} = _ref3;
|
|
246
|
+
let showCatalogPrice = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
226
247
|
const baseCells = [{}, {}, {}];
|
|
227
248
|
switch (displayMode) {
|
|
228
249
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
229
|
-
|
|
250
|
+
// THC: Marge - Inkoopprijs - Verkoopprijs (no catalog price)
|
|
251
|
+
// Towmotive: Catalogprijs - Marge - Inkoopprijs - Verkoopprijs
|
|
252
|
+
return [...baseCells, ...(showCatalogPrice ? [textCell('N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)] : []), priceCell(margin), priceCell(purchaseExcl), priceCell(salesExcl)];
|
|
230
253
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
231
|
-
|
|
254
|
+
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
255
|
+
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
256
|
+
return [...baseCells, priceCell(purchaseExcl), priceCell(margin), ...(showCatalogPrice ? [textCell('N.v.t.', _cartTable.CART_TABLE_PRICE_CELL_CLASS)] : []), emptyCell(_cartTable.CART_TABLE_PRICE_CELL_CLASS), priceCell(salesExcl)];
|
|
232
257
|
default:
|
|
233
258
|
return baseCells;
|
|
234
259
|
}
|
|
@@ -241,21 +266,26 @@ const getMarketCorrectionCells = (displayMode, _ref3) => {
|
|
|
241
266
|
* @param {Object} params.tmgSubtotals - TMG subtotals
|
|
242
267
|
* @param {Object} params.standardSubtotals - Standard subtotals
|
|
243
268
|
* @param {number} params.defaultSubtotal - Default subtotal
|
|
269
|
+
* @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
|
|
244
270
|
* @returns {Array} Array of cell configuration objects
|
|
245
271
|
*/
|
|
246
|
-
exports.
|
|
247
|
-
const getSectionTotalCells = (displayMode, _ref4) => {
|
|
272
|
+
const getSectionTotalCells = exports.getSectionTotalCells = function getSectionTotalCells(displayMode, _ref4) {
|
|
248
273
|
let {
|
|
249
274
|
tmgSubtotals,
|
|
250
275
|
standardSubtotals,
|
|
251
276
|
defaultSubtotal
|
|
252
277
|
} = _ref4;
|
|
278
|
+
let showCatalogPrice = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
253
279
|
const baseCells = [{}, {}];
|
|
254
280
|
switch (displayMode) {
|
|
255
281
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
256
|
-
|
|
282
|
+
// THC: Marge - Inkoopprijs - Verkoopprijs (no catalog price)
|
|
283
|
+
// Towmotive: Catalogprijs - Marge - Inkoopprijs - Verkoopprijs
|
|
284
|
+
return [...baseCells, {}, {}, ...(showCatalogPrice ? [priceCell(tmgSubtotals.catalog, _cartTable.CART_TABLE_BOLD_END_CLASS)] : []), priceCell(tmgSubtotals.margin, _cartTable.CART_TABLE_BOLD_END_CLASS), priceCell(tmgSubtotals.purchase, _cartTable.CART_TABLE_BOLD_END_CLASS), textCell((0, _index.formatPrice)(tmgSubtotals.sales), 'fw-bold text-end pb-2')];
|
|
257
285
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
258
|
-
|
|
286
|
+
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
287
|
+
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
288
|
+
return [...baseCells, emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Subtotaal inkoopprijs', _cartTable.CART_TABLE_BOLD_END_CLASS), ...(showCatalogPrice ? [emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS)] : []), emptyCell(_cartTable.CART_TABLE_BOLD_END_CLASS), textCell('Subtotaal (excl. btw)', 'fw-bold text-end pb-2'), textCell((0, _index.formatPrice)(standardSubtotals.purchase), 'fw-bold text-end pb-2'), textCell((0, _index.formatPrice)(standardSubtotals.sales), 'fw-bold text-end pb-2')];
|
|
259
289
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
260
290
|
default:
|
|
261
291
|
return [...baseCells, {}, {}, {}, textCell('Subtotaal (incl. btw)', 'fw-bold text-end pb-2'), textCell((0, _index.formatPrice)(defaultSubtotal), 'fw-bold text-end pb-2')];
|
|
@@ -270,22 +300,27 @@ const getSectionTotalCells = (displayMode, _ref4) => {
|
|
|
270
300
|
* @param {number} params.locationValue - Location price value
|
|
271
301
|
* @param {number} params.consumerValue - Consumer price value
|
|
272
302
|
* @param {string} params.className - CSS class for cells
|
|
303
|
+
* @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
|
|
273
304
|
* @returns {Array} Array of cell configuration objects
|
|
274
305
|
*/
|
|
275
|
-
exports.
|
|
276
|
-
const getTotalRowCells = (displayMode, _ref5) => {
|
|
306
|
+
const getTotalRowCells = exports.getTotalRowCells = function getTotalRowCells(displayMode, _ref5) {
|
|
277
307
|
let {
|
|
278
308
|
label,
|
|
279
309
|
locationValue,
|
|
280
310
|
consumerValue,
|
|
281
311
|
className = 'text-end'
|
|
282
312
|
} = _ref5;
|
|
313
|
+
let showCatalogPrice = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
283
314
|
const baseCells = [{}, {}, {}];
|
|
284
315
|
switch (displayMode) {
|
|
285
316
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
286
|
-
|
|
317
|
+
// THC: Marge - Inkoopprijs - Verkoopprijs (no catalog price)
|
|
318
|
+
// Towmotive: Catalogprijs - Marge - Inkoopprijs - Verkoopprijs
|
|
319
|
+
return [...baseCells, {}, ...(showCatalogPrice ? [emptyCell(className)] : []), textCell(label, className), textCell((0, _index.formatPrice)(locationValue), className), textCell((0, _index.formatPrice)(consumerValue), className)];
|
|
287
320
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
288
|
-
|
|
321
|
+
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
322
|
+
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
323
|
+
return [...baseCells, emptyCell(className), emptyCell(className), ...(showCatalogPrice ? [emptyCell(className)] : []), textCell(label, className), textCell((0, _index.formatPrice)(locationValue), className), textCell((0, _index.formatPrice)(consumerValue), className)];
|
|
289
324
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
290
325
|
default:
|
|
291
326
|
return [...baseCells, {}, {}, textCell(label, className), textCell((0, _index.formatPrice)(consumerValue), className)];
|
|
@@ -299,24 +334,28 @@ const getTotalRowCells = (displayMode, _ref5) => {
|
|
|
299
334
|
* @param {string} params.label - Row label
|
|
300
335
|
* @param {string} params.value - Formatted value string
|
|
301
336
|
* @param {string} params.className - CSS class for cells
|
|
337
|
+
* @param {boolean} showCatalogPrice - Whether to show the catalog price column (false for THC, true otherwise)
|
|
302
338
|
* @returns {Array} Array of cell configuration objects
|
|
303
339
|
*/
|
|
304
|
-
exports.
|
|
305
|
-
const getDiscountRowCells = (displayMode, _ref6) => {
|
|
340
|
+
const getDiscountRowCells = exports.getDiscountRowCells = function getDiscountRowCells(displayMode, _ref6) {
|
|
306
341
|
let {
|
|
307
342
|
label,
|
|
308
343
|
value,
|
|
309
344
|
className = 'text-end'
|
|
310
345
|
} = _ref6;
|
|
346
|
+
let showCatalogPrice = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
311
347
|
const baseCells = [{}, {}, {}];
|
|
312
348
|
switch (displayMode) {
|
|
313
349
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_TMG:
|
|
314
|
-
|
|
350
|
+
// THC: Marge - Inkoopprijs - Verkoopprijs (no catalog price)
|
|
351
|
+
// Towmotive: Catalogprijs - Marge - Inkoopprijs - Verkoopprijs
|
|
352
|
+
return [...baseCells, {}, ...(showCatalogPrice ? [emptyCell(className)] : []), emptyCell(className), textCell(label, className), textCell(value, className)];
|
|
315
353
|
case _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD:
|
|
316
|
-
|
|
354
|
+
// THC: Inkoopprijs - Marge - Korting% - Verkoopprijs
|
|
355
|
+
// Towmotive: Inkoopprijs - Marge - Catalogusprijs - Korting% - Verkoopprijs
|
|
356
|
+
return [...baseCells, emptyCell(className), emptyCell(className), ...(showCatalogPrice ? [emptyCell(className)] : []), emptyCell(className), textCell(label, className), textCell(value, className)];
|
|
317
357
|
case _cartTable.CART_TABLE_DISPLAY_MODES.DEFAULT:
|
|
318
358
|
default:
|
|
319
359
|
return [...baseCells, {}, {}, textCell(label, className), textCell(value, className)];
|
|
320
360
|
}
|
|
321
|
-
};
|
|
322
|
-
exports.getDiscountRowCells = getDiscountRowCells;
|
|
361
|
+
};
|