thm-p3-configurator 0.0.265 → 0.0.267

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.
@@ -602,7 +602,8 @@ const ProductCartTable = () => {
602
602
  var _product$consumerDisc, _product$images, _product$images2;
603
603
  const isVehicleCodingProduct = (product === null || product === void 0 ? void 0 : product.subgroupName) === _constants__.VEHICLE_CODING_SUBGROUP_NAME || (product === null || product === void 0 ? void 0 : product.groupName) === _constants__.VEHICLE_CODING_SUBGROUP_NAME;
604
604
  const lineDiscountValue = (_product$consumerDisc = product === null || product === void 0 ? void 0 : product.consumerDiscountPercentage) !== null && _product$consumerDisc !== void 0 ? _product$consumerDisc : isVehicleCodingProduct ? vehicleCodingDiscountPercentage : 0;
605
- const discountInputCell = displayMode === _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD ? {
605
+ const allowLineDiscountMain = displayMode === _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD && (isTowmotive || isTowFormula);
606
+ const discountInputCellMain = allowLineDiscountMain ? {
606
607
  text: renderDiscountInput(product.articleNumber, lineDiscountValue, v => handleLineDiscountChange(product.articleNumber, v, {
607
608
  isVehicleCoding: isVehicleCodingProduct
608
609
  })),
@@ -621,7 +622,7 @@ const ProductCartTable = () => {
621
622
  extraCells: (0, _cartTable2.getMainProductCells)({
622
623
  displayMode,
623
624
  priceInfo: product.priceInfo,
624
- discountInputCell,
625
+ discountInputCell: discountInputCellMain,
625
626
  vehicleCodingInputCell,
626
627
  isVehicleCodingProduct
627
628
  })
@@ -652,7 +653,8 @@ const ProductCartTable = () => {
652
653
  }, accessoireProducts.map(product => {
653
654
  var _product$consumerDisc2, _product$images3, _product$images4;
654
655
  const lineDiscountValue = (_product$consumerDisc2 = product === null || product === void 0 ? void 0 : product.consumerDiscountPercentage) !== null && _product$consumerDisc2 !== void 0 ? _product$consumerDisc2 : null;
655
- const discountInputCell = displayMode === _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD ? {
656
+ const allowLineDiscountAccessory = displayMode === _cartTable.CART_TABLE_DISPLAY_MODES.TOGGLED_STANDARD && (isTowmotive || isTowFormula);
657
+ const discountInputCellAccessory = allowLineDiscountAccessory ? {
656
658
  text: renderDiscountInput(product.articleNumber, lineDiscountValue, v => handleLineDiscountChange(product.articleNumber, v)),
657
659
  className: _cartTable.CART_TABLE_PRICE_CELL_CLASS
658
660
  } : {};
@@ -670,7 +672,7 @@ const ProductCartTable = () => {
670
672
  extraCells: (0, _cartTable2.getAccessoryProductCells)({
671
673
  displayMode,
672
674
  priceInfo: product.priceInfo,
673
- discountInputCell
675
+ discountInputCell: discountInputCellAccessory
674
676
  }),
675
677
  productAmount: selectedExtras[product.articleNumber],
676
678
  onEdit: value => {
@@ -328,6 +328,7 @@ const ProductsOverview = () => {
328
328
  imageId: product === null || product === void 0 || (_product$images2 = product.images) === null || _product$images2 === void 0 ? void 0 : _product$images2[0]
329
329
  }) : _logoPrimary.default;
330
330
  if (productCategory === _constants__.PRODUCT_CATEGORIES.BOARD_COMPUTER && selectedCableset) {
331
+ var _product$consumerPric;
331
332
  return /*#__PURE__*/_react.default.createElement(_BoardComputerCard.default, {
332
333
  defaultSelected: selectedBoardComputer === product.articleNumber,
333
334
  onSelect: _ref3 => {
@@ -345,7 +346,7 @@ const ProductsOverview = () => {
345
346
  id: product.articleNumber,
346
347
  description: (0, _product.formatHyperDescription)(product === null || product === void 0 ? void 0 : product.description),
347
348
  title: product === null || product === void 0 ? void 0 : product.subgroupName,
348
- price: product === null || product === void 0 ? void 0 : product.price,
349
+ price: product === null || product === void 0 || (_product$consumerPric = product.consumerPrices) === null || _product$consumerPric === void 0 ? void 0 : _product$consumerPric.priceInclVat,
349
350
  productImage: productImageUrl
350
351
  });
351
352
  }
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.array.includes.js");
3
4
  require("core-js/modules/es.number.parse-float.js");
4
5
  require("core-js/modules/es.promise.js");
5
6
  require("core-js/modules/es.regexp.exec.js");
6
7
  require("core-js/modules/es.regexp.to-string.js");
8
+ require("core-js/modules/es.string.includes.js");
7
9
  require("core-js/modules/es.string.replace.js");
8
10
  require("core-js/modules/es.weak-map.js");
9
11
  require("core-js/modules/esnext.iterator.constructor.js");
@@ -18,10 +20,12 @@ Object.defineProperty(exports, "__esModule", {
18
20
  value: true
19
21
  });
20
22
  exports.default = void 0;
23
+ require("core-js/modules/es.array.includes.js");
21
24
  require("core-js/modules/es.number.parse-float.js");
22
25
  require("core-js/modules/es.promise.js");
23
26
  require("core-js/modules/es.regexp.exec.js");
24
27
  require("core-js/modules/es.regexp.to-string.js");
28
+ require("core-js/modules/es.string.includes.js");
25
29
  require("core-js/modules/es.string.replace.js");
26
30
  require("core-js/modules/esnext.iterator.constructor.js");
27
31
  require("core-js/modules/esnext.iterator.find.js");
@@ -293,6 +297,7 @@ const InternalAppointmentForm = _ref => {
293
297
  } = (0, _queries.useBranchByIdOrWidgetId)(selectedBranch);
294
298
  const history = (0, _reactRouter.useHistory)();
295
299
  const formula = (0, _FormulaContext.useFormula)();
300
+ const showBranchAutofillLink = [_constants__.CONFIGURATOR_FORMULAS.TOW, _constants__.CONFIGURATOR_FORMULAS.TMG, _constants__.CONFIGURATOR_FORMULAS.TowMotive].includes(formula);
296
301
  const isTowmotive = (0, _useIsTowmotive.useIsTowmotive)();
297
302
  (0, _react.useEffect)(() => {
298
303
  (0, _ui.scrollToFirstErrorMessage)();
@@ -453,6 +458,7 @@ const InternalAppointmentForm = _ref => {
453
458
  * @description Autofills the customer form with the current branch data where applicable
454
459
  */
455
460
  const handleAutofillButtonClicked = () => {
461
+ var _branchById$kvkNumber, _branchById$vatNumber;
456
462
  dispatch({
457
463
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
458
464
  payload: {
@@ -489,18 +495,24 @@ const InternalAppointmentForm = _ref => {
489
495
  city: branchById === null || branchById === void 0 ? void 0 : branchById.city
490
496
  }
491
497
  });
492
- dispatch({
493
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_KVK_NUMBER,
494
- payload: {
495
- kvkNumber: branchById === null || branchById === void 0 ? void 0 : branchById.kvkNummer
496
- }
497
- });
498
- dispatch({
499
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_VAT_NUMBER,
500
- payload: {
501
- vatNumber: branchById === null || branchById === void 0 ? void 0 : branchById.vatNumber
502
- }
503
- });
498
+ const kvkNumber = (_branchById$kvkNumber = branchById === null || branchById === void 0 ? void 0 : branchById.kvkNumber) !== null && _branchById$kvkNumber !== void 0 ? _branchById$kvkNumber : branchById === null || branchById === void 0 ? void 0 : branchById.kvkNummer;
499
+ if (kvkNumber) {
500
+ dispatch({
501
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_KVK_NUMBER,
502
+ payload: {
503
+ kvkNumber
504
+ }
505
+ });
506
+ }
507
+ const vatNumber = (_branchById$vatNumber = branchById === null || branchById === void 0 ? void 0 : branchById.vatNumber) !== null && _branchById$vatNumber !== void 0 ? _branchById$vatNumber : branchById === null || branchById === void 0 ? void 0 : branchById.btwNummer;
508
+ if (vatNumber) {
509
+ dispatch({
510
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_VAT_NUMBER,
511
+ payload: {
512
+ vatNumber
513
+ }
514
+ });
515
+ }
504
516
  dispatch({
505
517
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_HOUSE_NUMBER,
506
518
  payload: {
@@ -664,7 +676,7 @@ const InternalAppointmentForm = _ref => {
664
676
  className: (0, _helpers__.withStyle)('row')
665
677
  }, /*#__PURE__*/_react.default.createElement("h6", {
666
678
  className: (0, _helpers__.withStyle)('modal-title col-12 mb-2')
667
- }, "Gegevens van de klant ", /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement(_LinkButton.default, {
679
+ }, "Gegevens van de klant ", /*#__PURE__*/_react.default.createElement("br", null), showBranchAutofillLink && /*#__PURE__*/_react.default.createElement(_LinkButton.default, {
668
680
  label: 'Vestiginggegevens invullen?',
669
681
  onClick: handleAutofillButtonClicked,
670
682
  isDisabled: !branchById
@@ -772,6 +784,7 @@ const InternalAppointmentForm = _ref => {
772
784
  cursor: 'pointer'
773
785
  },
774
786
  onMouseDown: e => {
787
+ var _branch$vatNumber, _branch$kvkNumber;
775
788
  e.preventDefault();
776
789
  dispatch({
777
790
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
@@ -811,19 +824,21 @@ const InternalAppointmentForm = _ref => {
811
824
  }
812
825
  });
813
826
  }
814
- if (branch.vatNumber) {
827
+ const vatNumber = (_branch$vatNumber = branch.vatNumber) !== null && _branch$vatNumber !== void 0 ? _branch$vatNumber : branch.btwNummer;
828
+ if (vatNumber) {
815
829
  dispatch({
816
830
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_VAT_NUMBER,
817
831
  payload: {
818
- vatNumber: branch.vatNumber
832
+ vatNumber
819
833
  }
820
834
  });
821
835
  }
822
- if (branch.kvkNumber) {
836
+ const kvkNumber = (_branch$kvkNumber = branch.kvkNumber) !== null && _branch$kvkNumber !== void 0 ? _branch$kvkNumber : branch.kvkNummer;
837
+ if (kvkNumber) {
823
838
  dispatch({
824
839
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_KVK_NUMBER,
825
840
  payload: {
826
- kvkNumber: branch.kvkNumber
841
+ kvkNumber
827
842
  }
828
843
  });
829
844
  }
@@ -1141,6 +1156,7 @@ const InternalAppointmentForm = _ref => {
1141
1156
  cursor: 'pointer'
1142
1157
  },
1143
1158
  onMouseDown: e => {
1159
+ var _branch$vatNumber2, _branch$kvkNumber2;
1144
1160
  e.preventDefault();
1145
1161
  dispatch({
1146
1162
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
@@ -1180,19 +1196,21 @@ const InternalAppointmentForm = _ref => {
1180
1196
  }
1181
1197
  });
1182
1198
  }
1183
- if (branch.vatNumber) {
1199
+ const vatNumber = (_branch$vatNumber2 = branch.vatNumber) !== null && _branch$vatNumber2 !== void 0 ? _branch$vatNumber2 : branch.btwNummer;
1200
+ if (vatNumber) {
1184
1201
  dispatch({
1185
1202
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_VAT_NUMBER,
1186
1203
  payload: {
1187
- vatNumber: branch.vatNumber
1204
+ vatNumber
1188
1205
  }
1189
1206
  });
1190
1207
  }
1191
- if (branch.kvkNumber) {
1208
+ const kvkNumber = (_branch$kvkNumber2 = branch.kvkNumber) !== null && _branch$kvkNumber2 !== void 0 ? _branch$kvkNumber2 : branch.kvkNummer;
1209
+ if (kvkNumber) {
1192
1210
  dispatch({
1193
1211
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_KVK_NUMBER,
1194
1212
  payload: {
1195
- kvkNumber: branch.kvkNumber
1213
+ kvkNumber
1196
1214
  }
1197
1215
  });
1198
1216
  }
@@ -630,6 +630,7 @@ const InternalQuotationForm = _ref => {
630
630
  cursor: 'pointer'
631
631
  },
632
632
  onMouseDown: e => {
633
+ var _branch$vatNumber, _branch$kvkNumber;
633
634
  e.preventDefault();
634
635
  dispatch({
635
636
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
@@ -669,19 +670,21 @@ const InternalQuotationForm = _ref => {
669
670
  }
670
671
  });
671
672
  }
672
- if (branch.vatNumber) {
673
+ const vatNumber = (_branch$vatNumber = branch.vatNumber) !== null && _branch$vatNumber !== void 0 ? _branch$vatNumber : branch.btwNummer;
674
+ if (vatNumber) {
673
675
  dispatch({
674
676
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_VAT_NUMBER,
675
677
  payload: {
676
- vatNumber: branch.vatNumber
678
+ vatNumber
677
679
  }
678
680
  });
679
681
  }
680
- if (branch.kvkNumber) {
682
+ const kvkNumber = (_branch$kvkNumber = branch.kvkNumber) !== null && _branch$kvkNumber !== void 0 ? _branch$kvkNumber : branch.kvkNummer;
683
+ if (kvkNumber) {
681
684
  dispatch({
682
685
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_KVK_NUMBER,
683
686
  payload: {
684
- kvkNumber: branch.kvkNumber
687
+ kvkNumber
685
688
  }
686
689
  });
687
690
  }
@@ -818,6 +821,7 @@ const InternalQuotationForm = _ref => {
818
821
  cursor: 'pointer'
819
822
  },
820
823
  onMouseDown: e => {
824
+ var _branch$vatNumber2, _branch$kvkNumber2;
821
825
  e.preventDefault();
822
826
  dispatch({
823
827
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
@@ -857,19 +861,21 @@ const InternalQuotationForm = _ref => {
857
861
  }
858
862
  });
859
863
  }
860
- if (branch.vatNumber) {
864
+ const vatNumber = (_branch$vatNumber2 = branch.vatNumber) !== null && _branch$vatNumber2 !== void 0 ? _branch$vatNumber2 : branch.btwNummer;
865
+ if (vatNumber) {
861
866
  dispatch({
862
867
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_VAT_NUMBER,
863
868
  payload: {
864
- vatNumber: branch.vatNumber
869
+ vatNumber
865
870
  }
866
871
  });
867
872
  }
868
- if (branch.kvkNumber) {
873
+ const kvkNumber = (_branch$kvkNumber2 = branch.kvkNumber) !== null && _branch$kvkNumber2 !== void 0 ? _branch$kvkNumber2 : branch.kvkNummer;
874
+ if (kvkNumber) {
869
875
  dispatch({
870
876
  type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_KVK_NUMBER,
871
877
  payload: {
872
- kvkNumber: branch.kvkNumber
878
+ kvkNumber
873
879
  }
874
880
  });
875
881
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.265",
3
+ "version": "0.0.267",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",