tripstorekrabi-shared 1.13.58 → 1.13.60
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/booking.js +13 -7
- package/package.json +1 -1
package/booking.js
CHANGED
|
@@ -2,7 +2,7 @@ import dayjs from "dayjs";
|
|
|
2
2
|
import advancedFormat from 'dayjs/plugin/advancedFormat.js';
|
|
3
3
|
import utc from "dayjs/plugin/utc.js";
|
|
4
4
|
import timezone from "dayjs/plugin/timezone.js";
|
|
5
|
-
import { calculateTotalOperatorPrice } from './price.js';
|
|
5
|
+
import { PAY_ON_TOUR, calculateTotalOperatorPrice } from './price.js';
|
|
6
6
|
|
|
7
7
|
dayjs.extend(advancedFormat);
|
|
8
8
|
dayjs.extend(utc);
|
|
@@ -225,16 +225,17 @@ export function getStartingPointMessage(booking, product) {
|
|
|
225
225
|
booking.specialRequirements.toUpperCase();
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
|
|
229
|
-
|
|
228
|
+
let payOnTour = [];
|
|
229
|
+
if (booking.nationalParkFee == PAY_ON_TOUR) {
|
|
230
|
+
let item = 'As stated on the website, there is an entrance fee';
|
|
230
231
|
|
|
231
232
|
if (product?.nationalPark) {
|
|
232
|
-
|
|
233
|
+
item += ' to ' + product?.nationalPark.title;
|
|
233
234
|
}
|
|
234
235
|
|
|
235
236
|
if (product?.nationalPark?.pricing
|
|
236
237
|
) {
|
|
237
|
-
|
|
238
|
+
item +=
|
|
238
239
|
' of ' +
|
|
239
240
|
product.nationalPark.pricing.adult +
|
|
240
241
|
' THB per adult and ' +
|
|
@@ -242,8 +243,13 @@ export function getStartingPointMessage(booking, product) {
|
|
|
242
243
|
' THB per child';
|
|
243
244
|
}
|
|
244
245
|
|
|
245
|
-
|
|
246
|
-
|
|
246
|
+
payOnTour.push(` • ${item}`);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
let extraPayments = Object.values(booking.extraPayments).filter((item) => !item.disabled && item.paymentMethod === PAY_ON_TOUR).map((item) => ` • ${item.description}: ${item.price} THB`);
|
|
250
|
+
payOnTour = [...payOnTour, ...extraPayments];
|
|
251
|
+
if (payOnTour.length > 0) {
|
|
252
|
+
text += '\n\nTO BE PAID ON TOUR:\n' + payOnTour.join("\n");
|
|
247
253
|
}
|
|
248
254
|
|
|
249
255
|
return text;
|