tripstorekrabi-shared 1.13.41 → 1.13.43

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/price.js +5 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.13.41",
3
+ "version": "1.13.43",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
package/price.js CHANGED
@@ -163,15 +163,15 @@ export function calculatePartnerNetPrice(booking, product) {
163
163
  }
164
164
 
165
165
  export function calculateTotalSellingPrice(booking, product) {
166
- return calculateTotalPrice(booking, product, options = { mode: SELLING_MODE });
166
+ return calculateTotalPrice(booking, product, { mode: SELLING_MODE });
167
167
  }
168
168
 
169
169
  export function calculateTotalOperatorPrice(booking, product) {
170
- return calculateTotalPrice(booking, product, options = { mode: OPERATOR_MODE });
170
+ return calculateTotalPrice(booking, product, { mode: OPERATOR_MODE });
171
171
  }
172
172
 
173
173
  export function calculateTotalPartnerNetPrice(booking, product) {
174
- return calculateTotalPrice(booking, product, options = { mode: PARTNER_MODE });
174
+ return calculateTotalPrice(booking, product, { mode: PARTNER_MODE });
175
175
  }
176
176
 
177
177
  function calculateTotalPrice(booking, product, options = { mode: SELLING_MODE }) {
@@ -181,7 +181,6 @@ function calculateTotalPrice(booking, product, options = { mode: SELLING_MODE })
181
181
  total += calculateNationalParkFee(booking, product);
182
182
  total += calculateExtraPayments(booking, {
183
183
  ...options,
184
- calculationMode: true,
185
184
  filter: (item) => {
186
185
  if (item.disabled === true) {
187
186
  return false;
@@ -217,7 +216,7 @@ function getExtraPaymentPrice(item, options) {
217
216
  case PARTNER_MODE:
218
217
  return item.receivedAmount ? item.receivedAmount : item.price;
219
218
  case OPERATOR_MODE:
220
- return item.operatoPrice;
219
+ return item.operatorPrice;
221
220
  }
222
221
  }
223
222
 
@@ -282,7 +281,7 @@ export function getExtraPaymentsPaidWithPartner(booking, product) {
282
281
  ...addOns
283
282
  ].filter(
284
283
  (item) =>
285
- (item.price > 0 || item.operatoPrice > 0) &&
284
+ (item.price > 0 || item.operatorPrice > 0) &&
286
285
  Object.values(booking.extraPayments).find(
287
286
  (extraPayment) =>
288
287
  extraPayment.category === item.category && !extraPayment.disabled