tripstorekrabi-shared 1.6.2 → 1.6.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 +4 -4
- package/utils.js +0 -10
package/package.json
CHANGED
package/price.js
CHANGED
|
@@ -15,9 +15,9 @@ export function calculateProductPrice(booking, pricing, selling = true) {
|
|
|
15
15
|
} else {
|
|
16
16
|
let bookingType = getBookingType(booking.referenceNumber);
|
|
17
17
|
|
|
18
|
-
if (volume[bookingType]
|
|
18
|
+
if (volume[bookingType]) {
|
|
19
19
|
let customPricing = volume[bookingType];
|
|
20
|
-
total = booking.adults * (selling ? customPricing.adult.partnerNetPrice : customPricing.adult.operatorNetPrice) + (pricing.ageBands.child.active && volume.child && booking.children ? booking.children * (selling ? customPricing.child.partnerNetPrice : customPricing.child.operatorNetPrice) : 0);
|
|
20
|
+
total = booking.adults * (selling ? customPricing.adult.partnerNetPrice : customPricing.adult.operatorNetPrice ?? volume.adult.operatorNetPrice) + (pricing.ageBands.child.active && volume.child && booking.children ? booking.children * (selling ? customPricing.child.partnerNetPrice : customPricing.child.operatorNetPrice ?? volume.child.operatorNetPrice) : 0);
|
|
21
21
|
} else {
|
|
22
22
|
total = booking.adults * (selling ? volume.adult.sellingPrice : volume.adult.operatorNetPrice) + (pricing.ageBands.child.active && volume.child && booking.children ? booking.children * (selling ? volume.child.sellingPrice : volume.child.operatorNetPrice) : 0);
|
|
23
23
|
}
|
|
@@ -32,9 +32,9 @@ export function calculateProductPrice(booking, pricing, selling = true) {
|
|
|
32
32
|
} else {
|
|
33
33
|
let bookingType = getBookingType(booking.referenceNumber);
|
|
34
34
|
|
|
35
|
-
if (volume[bookingType]
|
|
35
|
+
if (volume[bookingType]) {
|
|
36
36
|
let customPricing = volume[bookingType];
|
|
37
|
-
total = selling ? customPricing.partnerNetPrice : customPricing.operatorNetPrice;
|
|
37
|
+
total = selling ? customPricing.partnerNetPrice : customPricing.operatorNetPrice ?? volume.operatorNetPrice;
|
|
38
38
|
} else {
|
|
39
39
|
total = (selling ? volume.sellingPrice : volume.operatorNetPrice);
|
|
40
40
|
}
|
package/utils.js
CHANGED
|
@@ -292,16 +292,6 @@ export function isNumeric(n) {
|
|
|
292
292
|
return !isNaN(parseFloat(n)) && isFinite(n);
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
export function validURL(str) {
|
|
296
|
-
var pattern = new RegExp('^(https?:\\/\\/)?' + // protocol
|
|
297
|
-
'((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name
|
|
298
|
-
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
|
|
299
|
-
'(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path
|
|
300
|
-
'(\\?[;&a-z\\d%_.~+=-]*)?' + // query string
|
|
301
|
-
'(\\#[-a-z\\d_]*)?$', 'i'); // fragment locator
|
|
302
|
-
return !!pattern.test(str);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
295
|
export function getBookingSummary(booking, options = {}) {
|
|
306
296
|
let summary = "";
|
|
307
297
|
if (!options.excludeReferenceNumber) {
|