tripstorekrabi-shared 1.13.10 → 1.13.12
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 +1 -1
- package/price.js +10 -2
package/package.json
CHANGED
package/price.js
CHANGED
|
@@ -136,8 +136,16 @@ 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 || item.category === "
|
|
140
|
-
|
|
139
|
+
for (const extraPayment of Object.values(booking.extraPayments).filter((item) => !item.disabled && item.paymentMethod !== PAY_ON_TOUR && (!excludePaymentsWithCategory || item.category === "OTHER"))) {
|
|
140
|
+
if (!selling) {
|
|
141
|
+
if (extraPayment.paymentMethod === PAY_ON_TOUR) {
|
|
142
|
+
total -= extraPayment.price - extraPayment.operatorPrice;
|
|
143
|
+
} else {
|
|
144
|
+
total += extraPayment.operatorPrice;
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
total += extraPayment.receivedAmount ? extraPayment.receivedAmount : extraPayment.price
|
|
148
|
+
}
|
|
141
149
|
}
|
|
142
150
|
}
|
|
143
151
|
return total;
|