tripstorekrabi-shared 1.13.47 → 1.13.48
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 -12
package/package.json
CHANGED
package/price.js
CHANGED
|
@@ -22,15 +22,15 @@ const PARTNER_MODE = 1;
|
|
|
22
22
|
const OPERATOR_MODE = 2;
|
|
23
23
|
|
|
24
24
|
export function calculateProductSellingPrice(booking, pricing) {
|
|
25
|
-
return calculateProductPrice(booking, pricing, { mode: SELLING_MODE });
|
|
25
|
+
return booking.customerPaymentStatus === "Refunded" ? 0 : calculateProductPrice(booking, pricing, { mode: SELLING_MODE });
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export function calculateProductPartnerNetPrice(booking, pricing) {
|
|
29
|
-
return calculateProductPrice(booking, pricing, { mode: PARTNER_MODE });
|
|
29
|
+
return booking.customerPaymentStatus === "Refunded" ? 0 : calculateProductPrice(booking, pricing, { mode: PARTNER_MODE });
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export function calculateProductOperatorPrice(booking, pricing) {
|
|
33
|
-
return calculateProductPrice(booking, pricing, { mode: OPERATOR_MODE });
|
|
33
|
+
return booking.operatorPaymentStatus === "No Charge" ? 0 : calculateProductPrice(booking, pricing, { mode: OPERATOR_MODE });
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
function calculateSellingPrice(commissionRate, price) {
|
|
@@ -139,15 +139,7 @@ export function countMaxPeople(pricing) {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
export function getTotalAmountToBeReceived(booking, options = {}) {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
if (booking.customerPaymentStatus === "Refunded") {
|
|
145
|
-
total = 0;
|
|
146
|
-
} else {
|
|
147
|
-
total = booking.partnerNetPrice + calculateExtraPayments(booking, { mode: SELLING_MODE, ...options });
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return total;
|
|
142
|
+
return booking.customerPaymentStatus === "Refunded" ? 0 : booking.partnerNetPrice + calculateExtraPayments(booking, { mode: SELLING_MODE, ...options })
|
|
151
143
|
}
|
|
152
144
|
|
|
153
145
|
export function calculatePartnerNetPrice(booking, product) {
|