tripstorekrabi-shared 1.13.43 → 1.13.45
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 +11 -3
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;
|
|
@@ -220,7 +220,15 @@ function getExtraPaymentPrice(item, options) {
|
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
export function
|
|
223
|
+
export function calculateTotalExtraPaymentsSellingPrice(booking) {
|
|
224
|
+
return calculateExtraPayments(booking, { mode: SELLING_MODE });
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export function calculateTotalExtraPaymentsOperatorPrice(booking) {
|
|
228
|
+
return calculateExtraPayments(booking, { mode: OPERATOR_MODE });
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function calculateExtraPayments(booking, options = { mode: SELLING_MODE }) {
|
|
224
232
|
let filter = options.filter ?? ((item) => !item.disabled);
|
|
225
233
|
let getPrice = options.getPrice ?? getExtraPaymentPrice;
|
|
226
234
|
|