tripstorekrabi-shared 1.13.48 → 1.13.50
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 +13 -6
package/package.json
CHANGED
package/price.js
CHANGED
|
@@ -156,15 +156,15 @@ export function calculatePartnerNetPrice(booking, product) {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
export function calculateTotalSellingPrice(booking, product) {
|
|
159
|
-
return calculateTotalPrice(booking, product, { mode: SELLING_MODE });
|
|
159
|
+
return booking.customerPaymentStatus === "Refunded" ? 0 : calculateTotalPrice(booking, product, { mode: SELLING_MODE });
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
export function
|
|
163
|
-
return calculateTotalPrice(booking, product, { mode:
|
|
162
|
+
export function calculateTotalPartnerNetPrice(booking, product) {
|
|
163
|
+
return booking.customerPaymentStatus === "Refunded" ? 0 : calculateTotalPrice(booking, product, { mode: PARTNER_MODE });
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
export function
|
|
167
|
-
return calculateTotalPrice(booking, product, { mode:
|
|
166
|
+
export function calculateTotalOperatorPrice(booking, product) {
|
|
167
|
+
return booking.operatorPaymentStatus === "No Charge" ? 0 : calculateTotalPrice(booking, product, { mode: OPERATOR_MODE });
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
function calculateTotalPrice(booking, product, options = { mode: SELLING_MODE }) {
|
|
@@ -287,7 +287,14 @@ export function getExtraPaymentsPaidWithPartner(booking, product) {
|
|
|
287
287
|
(extraPayment) =>
|
|
288
288
|
extraPayment.category === item.category && !extraPayment.disabled
|
|
289
289
|
) == null
|
|
290
|
-
)
|
|
290
|
+
).forEach((item) => {
|
|
291
|
+
if (booking.customerPaymentStatus === "Refunded") {
|
|
292
|
+
item.price = 0;
|
|
293
|
+
}
|
|
294
|
+
if (booking.operatorPaymentStatus === "No Charge") {
|
|
295
|
+
item.operatorPrice = 0;
|
|
296
|
+
}
|
|
297
|
+
});
|
|
291
298
|
}
|
|
292
299
|
|
|
293
300
|
export function calculateAddOnsPrice(booking, product, options = { mode: SELLING_MODE }) {
|