tripstorekrabi-shared 1.13.22 → 1.13.23
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 +14 -0
package/package.json
CHANGED
package/price.js
CHANGED
|
@@ -134,6 +134,20 @@ export function getTotalAmountToBeReceived(booking) {
|
|
|
134
134
|
return total;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
export function calculatePartnerNetPrice(booking, product) {
|
|
138
|
+
return getExtraPaymentsPaidWithPartner(
|
|
139
|
+
booking,
|
|
140
|
+
product
|
|
141
|
+
).reduce(
|
|
142
|
+
(prev, curr) => prev + curr.price,
|
|
143
|
+
calculateProductPrice(
|
|
144
|
+
booking,
|
|
145
|
+
product.pricing,
|
|
146
|
+
'partner'
|
|
147
|
+
)
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
137
151
|
export function calculateTotalPrice(booking, product, mode = "retail") {
|
|
138
152
|
let total = calculateProductPrice(booking, product.pricing, mode);
|
|
139
153
|
total += calculateStartEndPointPrice(booking, findStartingPoint(product, booking.startingPointId, false), mode === "retail" || mode === "partner");
|