tripstorekrabi-shared 1.13.42 → 1.13.44
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 +4 -5
package/package.json
CHANGED
package/price.js
CHANGED
|
@@ -137,13 +137,13 @@ export function countMaxPeople(pricing) {
|
|
|
137
137
|
return volume ? volume.reduce((p, v) => p > v ? p : v) : MAX_PAX;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
export function getTotalAmountToBeReceived(booking) {
|
|
140
|
+
export function getTotalAmountToBeReceived(booking, options = {}) {
|
|
141
141
|
let total;
|
|
142
142
|
|
|
143
143
|
if (booking.customerPaymentStatus === "Refunded") {
|
|
144
144
|
total = 0;
|
|
145
145
|
} else {
|
|
146
|
-
total = booking.partnerNetPrice + calculateExtraPayments(booking);
|
|
146
|
+
total = booking.partnerNetPrice + calculateExtraPayments(booking, { mode: SELLING_MODE, ...options });
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
return total;
|
|
@@ -181,7 +181,6 @@ function calculateTotalPrice(booking, product, options = { mode: SELLING_MODE })
|
|
|
181
181
|
total += calculateNationalParkFee(booking, product);
|
|
182
182
|
total += calculateExtraPayments(booking, {
|
|
183
183
|
...options,
|
|
184
|
-
calculationMode: true,
|
|
185
184
|
filter: (item) => {
|
|
186
185
|
if (item.disabled === true) {
|
|
187
186
|
return false;
|
|
@@ -217,7 +216,7 @@ function getExtraPaymentPrice(item, options) {
|
|
|
217
216
|
case PARTNER_MODE:
|
|
218
217
|
return item.receivedAmount ? item.receivedAmount : item.price;
|
|
219
218
|
case OPERATOR_MODE:
|
|
220
|
-
return item.
|
|
219
|
+
return item.operatorPrice;
|
|
221
220
|
}
|
|
222
221
|
}
|
|
223
222
|
|
|
@@ -282,7 +281,7 @@ export function getExtraPaymentsPaidWithPartner(booking, product) {
|
|
|
282
281
|
...addOns
|
|
283
282
|
].filter(
|
|
284
283
|
(item) =>
|
|
285
|
-
(item.price > 0 || item.
|
|
284
|
+
(item.price > 0 || item.operatorPrice > 0) &&
|
|
286
285
|
Object.values(booking.extraPayments).find(
|
|
287
286
|
(extraPayment) =>
|
|
288
287
|
extraPayment.category === item.category && !extraPayment.disabled
|