thm-p3-configurator 0.0.127 → 0.0.129

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.
@@ -124,7 +124,7 @@ function _toPrimitive(t, r) {
124
124
  return ("string" === r ? String : Number)(t);
125
125
  }
126
126
  const ProductCartTable = () => {
127
- var _marketCorrection$con, _marketCorrection$con2;
127
+ var _marketCorrection$con;
128
128
  const formula = (0, _FormulaContext.useFormula)();
129
129
  const [isToggled, setIsToggled] = (0, _react.useState)(false);
130
130
  const [{
@@ -219,12 +219,10 @@ const ProductCartTable = () => {
219
219
  salesPrice = (product === null || product === void 0 ? void 0 : product.price) || 0;
220
220
  }
221
221
  const margin = salesPrice - purchasePrice;
222
- const marginPercentage = purchasePrice ? margin / purchasePrice * 100 : 0;
223
222
  return {
224
223
  purchasePrice,
225
224
  salesPrice,
226
- margin,
227
- marginPercentage: Math.round(marginPercentage * 100) / 100
225
+ margin
228
226
  };
229
227
  };
230
228
  if (products) {
@@ -308,7 +306,7 @@ const ProductCartTable = () => {
308
306
  imageId: (_product$images2 = product.images) === null || _product$images2 === void 0 ? void 0 : _product$images2[0]
309
307
  }) : _logoPrimary.default,
310
308
  extraCells: [{}, {}, {}, ...(isToggled ? [{
311
- text: "".concat((0, _helpers__.formatPrice)(margin), " (").concat(marginPercentage, "%)"),
309
+ text: (0, _helpers__.formatPrice)(margin),
312
310
  className: 'cart__table-price text-end'
313
311
  }, {
314
312
  text: (0, _helpers__.formatPrice)(purchasePrice),
@@ -341,7 +339,7 @@ const ProductCartTable = () => {
341
339
  productTitle: 'Marktcorrectie',
342
340
  productImage: _montagePlaceholder.default,
343
341
  extraCells: [{}, {}, {}, ...(isToggled ? [{
344
- text: (marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.locationTotal) > 0 ? "".concat((0, _helpers__.formatPrice)(((_marketCorrection$con = marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.consumerTotal) !== null && _marketCorrection$con !== void 0 ? _marketCorrection$con : 0) / 1.21 - marketCorrection.locationTotal), " (").concat(Math.round((((_marketCorrection$con2 = marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.consumerTotal) !== null && _marketCorrection$con2 !== void 0 ? _marketCorrection$con2 : 0) / 1.21 - marketCorrection.locationTotal) / marketCorrection.locationTotal * 10000) / 100, "%)") : 'N.v.t.',
342
+ text: (marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.locationTotal) > 0 ? (0, _helpers__.formatPrice)(((_marketCorrection$con = marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.consumerTotal) !== null && _marketCorrection$con !== void 0 ? _marketCorrection$con : 0) / 1.21 - marketCorrection.locationTotal) : 'N.v.t.',
345
343
  className: 'cart__table-price text-end'
346
344
  }, {
347
345
  text: (marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.locationTotal) > 0 ? (0, _helpers__.formatPrice)(marketCorrection === null || marketCorrection === void 0 ? void 0 : marketCorrection.locationTotal) : 'N.v.t.',
@@ -397,7 +395,7 @@ const ProductCartTable = () => {
397
395
  imageId: (_product$images4 = product.images) === null || _product$images4 === void 0 ? void 0 : _product$images4[0]
398
396
  }) : _logoPrimary.default,
399
397
  extraCells: [{}, {}, {}, ...(isToggled ? [{
400
- text: "".concat((0, _helpers__.formatPrice)(margin), " (").concat(marginPercentage, "%)"),
398
+ text: (0, _helpers__.formatPrice)(margin),
401
399
  className: 'cart__table-price text-end'
402
400
  }, {
403
401
  text: (0, _helpers__.formatPrice)(purchasePrice),
@@ -67,7 +67,7 @@ function _toPrimitive(t, r) {
67
67
  * @description Covnerts an existing hyper dossier object into a local order session
68
68
  */
69
69
  const parseDossierToOrderSession = exports.parseDossierToOrderSession = function parseDossierToOrderSession() {
70
- var _dossier$kanaal, _dossier$kanaalPartne, _dossier$kanaalHoofka, _dossier$statusDossie, _dossier$statusDossie2, _dossier$vestiging, _dossier$typeEigendom, _Date, _dossier$klant, _dossier$klant2, _dossier$klant3, _dossier$klant4, _dossier$klant5, _dossier$klant$postal, _dossier$klant6, _dossier$klant$city, _dossier$klant7, _dossier$klant$street, _dossier$klant8, _dossier$klant$huisnu, _dossier$klant9, _dossier$anwbId;
70
+ var _dossier$kanaal, _dossier$kanaalPartne, _dossier$kanaalHoofka, _dossier$statusDossie, _dossier$statusDossie2, _dossier$vestiging, _dossier$typeEigendom, _Date, _dossier$klant, _dossier$klant2, _dossier$klant3, _dossier$klant4, _dossier$klant5, _dossier$klant$postal, _dossier$klant6, _dossier$klant$city, _dossier$klant7, _dossier$klant$street, _dossier$klant8, _dossier$klant$huisnu, _dossier$klant9, _dossier$anwbId, _dossier$bedrijfsnaam, _dossier$kvkNummer, _dossier$btwNummer;
71
71
  let dossier = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
72
72
  return {
73
73
  licensePlate: dossier === null || dossier === void 0 ? void 0 : dossier.kenteken,
@@ -125,7 +125,10 @@ const parseDossierToOrderSession = exports.parseDossierToOrderSession = function
125
125
  city: (_dossier$klant$city = dossier === null || dossier === void 0 || (_dossier$klant7 = dossier.klant) === null || _dossier$klant7 === void 0 ? void 0 : _dossier$klant7.city) !== null && _dossier$klant$city !== void 0 ? _dossier$klant$city : undefined,
126
126
  streetName: (_dossier$klant$street = dossier === null || dossier === void 0 || (_dossier$klant8 = dossier.klant) === null || _dossier$klant8 === void 0 ? void 0 : _dossier$klant8.street) !== null && _dossier$klant$street !== void 0 ? _dossier$klant$street : undefined,
127
127
  houseNumber: (_dossier$klant$huisnu = dossier === null || dossier === void 0 || (_dossier$klant9 = dossier.klant) === null || _dossier$klant9 === void 0 ? void 0 : _dossier$klant9.huisnummer) !== null && _dossier$klant$huisnu !== void 0 ? _dossier$klant$huisnu : undefined,
128
- anwbId: (_dossier$anwbId = dossier === null || dossier === void 0 ? void 0 : dossier.anwbId) !== null && _dossier$anwbId !== void 0 ? _dossier$anwbId : undefined
128
+ anwbId: (_dossier$anwbId = dossier === null || dossier === void 0 ? void 0 : dossier.anwbId) !== null && _dossier$anwbId !== void 0 ? _dossier$anwbId : undefined,
129
+ companyName: (_dossier$bedrijfsnaam = dossier === null || dossier === void 0 ? void 0 : dossier.bedrijfsnaam) !== null && _dossier$bedrijfsnaam !== void 0 ? _dossier$bedrijfsnaam : undefined,
130
+ kvkNumber: (_dossier$kvkNummer = dossier === null || dossier === void 0 ? void 0 : dossier.kvkNummer) !== null && _dossier$kvkNummer !== void 0 ? _dossier$kvkNummer : undefined,
131
+ vatNumber: (_dossier$btwNummer = dossier === null || dossier === void 0 ? void 0 : dossier.btwNummer) !== null && _dossier$btwNummer !== void 0 ? _dossier$btwNummer : undefined
129
132
  }
130
133
  };
131
134
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.127",
3
+ "version": "0.0.129",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",