tripstorekrabi-shared 1.22.4 → 1.22.5
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 +3 -3
package/package.json
CHANGED
package/price.js
CHANGED
|
@@ -47,7 +47,7 @@ function calculateSellingPrice(commissionRate = 0, price) {
|
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
function
|
|
50
|
+
export function caluclateInflatedSellingPrice(price, config) {
|
|
51
51
|
if (!config || !config.inflatedPrices) {
|
|
52
52
|
return price;
|
|
53
53
|
}
|
|
@@ -96,13 +96,13 @@ function calculateProductPrice(booking, pricing, options = { mode: SELLING_MODE
|
|
|
96
96
|
const commissionRate = pricing.commissionRates?.[bookingSourceKey];
|
|
97
97
|
const baseNetPriceAdult = customPricing.adult.partnerNetPrice;
|
|
98
98
|
const baseRetailPriceAdult = calculateSellingPrice(commissionRate, baseNetPriceAdult);
|
|
99
|
-
const finalPriceAdult =
|
|
99
|
+
const finalPriceAdult = caluclateInflatedSellingPrice(baseRetailPriceAdult, customPricing);
|
|
100
100
|
|
|
101
101
|
let finalPriceChild = 0;
|
|
102
102
|
if (pricing.ageBands.child.active && volume.child && booking.children) {
|
|
103
103
|
const baseNetPriceChild = customPricing.child.partnerNetPrice;
|
|
104
104
|
const baseRetailPriceChild = calculateSellingPrice(commissionRate, baseNetPriceChild);
|
|
105
|
-
finalPriceChild =
|
|
105
|
+
finalPriceChild = caluclateInflatedSellingPrice(baseRetailPriceChild, customPricing);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
total = booking.adults * finalPriceAdult + (booking.children ? booking.children * finalPriceChild : 0);
|