tripstorekrabi-shared 1.14.4 → 1.14.6

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 +2 -2
  2. package/price.js +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tripstorekrabi-shared",
3
- "version": "1.14.4",
3
+ "version": "1.14.6",
4
4
  "description": "Shared library for Trip Store Krabi",
5
5
  "author": "Stefan Sommer <tonprince@gmail.com>",
6
6
  "repository": {
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "dayjs": "^1.11.10",
19
- "nanoid": "^5.0.3"
19
+ "nanoid": "^5.0.4"
20
20
  },
21
21
  "scripts": {
22
22
  "deploy": "npm publish"
package/price.js CHANGED
@@ -330,6 +330,8 @@ export function getExtraPaymentsOperatorPrice(extraPayments) {
330
330
  let ourCommission = item.price - item.operatorPrice;
331
331
  if (ourCommission > 0) {
332
332
  price = -ourCommission;
333
+ } else {
334
+ price = 0;
333
335
  }
334
336
  } else {
335
337
  price = item.operatorPrice;
@@ -406,7 +408,7 @@ export function calculatePhayunPrices(booking, product) {
406
408
  let cashOnTourAmount = 0;
407
409
  let activeExtraPayments = getActiveExtraPayments(Object.entries(booking.extraPayments));
408
410
  let bookingType = getBookingType(booking.referenceNumber);
409
-
411
+
410
412
  if (
411
413
  product.operator.default.invoicing?.operator?.create &&
412
414
  product.operator.default.invoicing?.operator?.partners?.[