tripstorekrabi-shared 1.13.50 → 1.13.52
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 +9 -2
package/package.json
CHANGED
package/price.js
CHANGED
|
@@ -125,7 +125,13 @@ function calculateProductPrice(booking, pricing, options = { mode: SELLING_MODE
|
|
|
125
125
|
|
|
126
126
|
export function findVolume(people, pricing) {
|
|
127
127
|
let total = people.adults + people.children ?? 0;
|
|
128
|
-
return pricing.volumes.sort((v1, v2) => v1.max - v2.max).find((item) =>
|
|
128
|
+
return pricing.volumes.sort((v1, v2) => v1.max - v2.max).find((item, i) => {
|
|
129
|
+
if (total <= item.max) {
|
|
130
|
+
return true;
|
|
131
|
+
} else if (i === pricing.volumes.length - 1) {
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
129
135
|
}
|
|
130
136
|
|
|
131
137
|
export function countMinPeople(pricing) {
|
|
@@ -287,13 +293,14 @@ export function getExtraPaymentsPaidWithPartner(booking, product) {
|
|
|
287
293
|
(extraPayment) =>
|
|
288
294
|
extraPayment.category === item.category && !extraPayment.disabled
|
|
289
295
|
) == null
|
|
290
|
-
).
|
|
296
|
+
).map((item) => {
|
|
291
297
|
if (booking.customerPaymentStatus === "Refunded") {
|
|
292
298
|
item.price = 0;
|
|
293
299
|
}
|
|
294
300
|
if (booking.operatorPaymentStatus === "No Charge") {
|
|
295
301
|
item.operatorPrice = 0;
|
|
296
302
|
}
|
|
303
|
+
return item;
|
|
297
304
|
});
|
|
298
305
|
}
|
|
299
306
|
|