tripstorekrabi-shared 1.13.14 → 1.13.15
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 +8 -8
package/package.json
CHANGED
package/price.js
CHANGED
|
@@ -151,27 +151,27 @@ export function calculateNationalParkFee(booking, product) {
|
|
|
151
151
|
|
|
152
152
|
export function calculateExtraPayments(booking, selling = true, calculationMode = false) {
|
|
153
153
|
let total = 0;
|
|
154
|
-
for (const
|
|
154
|
+
for (const item of Object.values(booking.extraPayments ?? {}).filter((item) => !item.disabled)) {
|
|
155
155
|
if (selling) {
|
|
156
|
-
if (
|
|
156
|
+
if (item.paymentMethod === PAY_ON_TOUR) {
|
|
157
157
|
if (calculationMode && item.category !== "OTHER") {
|
|
158
|
-
total -=
|
|
158
|
+
total -= item.price;
|
|
159
159
|
}
|
|
160
160
|
} else if (!calculationMode || item.category === "OTHER") {
|
|
161
|
-
total +=
|
|
161
|
+
total += item.receivedAmount ? item.receivedAmount : item.price;
|
|
162
162
|
}
|
|
163
163
|
} else {
|
|
164
|
-
if (
|
|
164
|
+
if (item.paymentMethod === PAY_ON_TOUR) {
|
|
165
165
|
if (calculationMode && item.category !== "OTHER") {
|
|
166
|
-
total -=
|
|
166
|
+
total -= item.operatorPrice;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
let ourCommission =
|
|
169
|
+
let ourCommission = item.price - item.operatorPrice;
|
|
170
170
|
if (ourCommission > 0) {
|
|
171
171
|
total -= ourCommission;
|
|
172
172
|
}
|
|
173
173
|
} else if (!calculationMode || item.category === "OTHER") {
|
|
174
|
-
total +=
|
|
174
|
+
total += item.operatorPrice;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
}
|