tripstorekrabi-shared 1.13.8 → 1.13.10
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/package.json +2 -2
- package/price.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tripstorekrabi-shared",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.10",
|
|
4
4
|
"description": "Shared library for Trip Store Krabi",
|
|
5
5
|
"author": "Stefan Sommer <tonprince@gmail.com>",
|
|
6
6
|
"repository": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"./product": "./product.js"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"dayjs": "^1.11.
|
|
18
|
+
"dayjs": "^1.11.8"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
21
|
"deploy": "npm publish"
|
package/price.js
CHANGED
|
@@ -124,7 +124,7 @@ export function calculateTotalPrice(booking, product, mode = "retail") {
|
|
|
124
124
|
total += calculateStartEndPointPrice(booking, findStartingPoint(product, booking.startingPointId, false), mode === "retail" || mode === "partner");
|
|
125
125
|
total += calculateStartEndPointPrice(booking, findEndPoint(product, booking.endPointId, false), mode === "retail" || mode === "partner");
|
|
126
126
|
total += calculateNationalParkFee(booking, product);
|
|
127
|
-
total += calculateExtraPayments(
|
|
127
|
+
total += calculateExtraPayments(booking, mode === "retail" || mode === "partner", true);
|
|
128
128
|
total += calculateAddOnsPrice(booking, product, mode === "retail" || mode === "partner");
|
|
129
129
|
return total;
|
|
130
130
|
}
|
|
@@ -136,7 +136,7 @@ export function calculateNationalParkFee(booking, product) {
|
|
|
136
136
|
export function calculateExtraPayments(booking, selling = true, excludePaymentsWithCategory = false) {
|
|
137
137
|
let total = 0;
|
|
138
138
|
if (booking.extraPayments) {
|
|
139
|
-
for (const extraPayment of Object.values(booking.extraPayments).filter((item) => !item.disabled && item.paymentMethod !== PAY_ON_TOUR && (!excludePaymentsWithCategory ||
|
|
139
|
+
for (const extraPayment of Object.values(booking.extraPayments).filter((item) => !item.disabled && item.paymentMethod !== PAY_ON_TOUR && (!excludePaymentsWithCategory || item.category === "Other"))) {
|
|
140
140
|
total += selling ? (extraPayment.receivedAmount ? extraPayment.receivedAmount : extraPayment.price) : extraPayment.operatorPrice;
|
|
141
141
|
}
|
|
142
142
|
}
|