@ticketboothapp/booking 1.2.84 → 1.2.85
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
CHANGED
|
@@ -3872,6 +3872,31 @@ export function AdminChangeBookingFlow({
|
|
|
3872
3872
|
effectivePromoDiscountAmount,
|
|
3873
3873
|
]);
|
|
3874
3874
|
|
|
3875
|
+
/** Stripe modal / admin pay modal must use the same ticket row amounts as PriceSummary; unreconciled catalog lines caused ADULT € vs total mismatch (tax-included). PI `buildCheckoutBreakdown` stays on catalog ticket rows. */
|
|
3876
|
+
const checkoutModalTicketLinesDisplay = useMemo((): CheckoutModalLineItem[] => {
|
|
3877
|
+
return taxIncludedReconciledCheckoutPriceSummaryLines
|
|
3878
|
+
.filter((l): l is Extract<PriceSummaryLine, { kind: 'ticket' }> => l.kind === 'ticket')
|
|
3879
|
+
.map((line) => {
|
|
3880
|
+
const rate = pricing.find((r) => r.category === line.category);
|
|
3881
|
+
const breakdown = getPriceBreakdown(
|
|
3882
|
+
line.category,
|
|
3883
|
+
rate?.priceCAD ?? 0,
|
|
3884
|
+
rate?.baseInDisplayCurrency,
|
|
3885
|
+
rate?.appliedAdjustments ?? [],
|
|
3886
|
+
);
|
|
3887
|
+
const qty = Math.max(0, line.qty);
|
|
3888
|
+
return {
|
|
3889
|
+
line: {
|
|
3890
|
+
category: line.category,
|
|
3891
|
+
qty,
|
|
3892
|
+
itemTotal: line.itemTotal,
|
|
3893
|
+
pricePerUnit: qty > 0 ? roundMoney(line.itemTotal / qty) : 0,
|
|
3894
|
+
},
|
|
3895
|
+
breakdown,
|
|
3896
|
+
};
|
|
3897
|
+
});
|
|
3898
|
+
}, [taxIncludedReconciledCheckoutPriceSummaryLines, pricing, getPriceBreakdown]);
|
|
3899
|
+
|
|
3875
3900
|
const adminFeAuthoritativeReceipt = useMemo((): AdminFeAuthoritativeReceipt => {
|
|
3876
3901
|
const hasTaxLine = taxIncludedReconciledCheckoutPriceSummaryLines.some(
|
|
3877
3902
|
(line) => line.kind === 'line' && String(line.type ?? '').toUpperCase() === 'TAX'
|
|
@@ -5207,16 +5232,7 @@ export function AdminChangeBookingFlow({
|
|
|
5207
5232
|
availabilityProductOptionId,
|
|
5208
5233
|
itineraryDisplay: itineraryDisplay ?? undefined,
|
|
5209
5234
|
clientSecret: paymentIntent.clientSecret ?? '',
|
|
5210
|
-
ticketLinesForModal:
|
|
5211
|
-
const rate = pricing.find((r) => r.category === line.category);
|
|
5212
|
-
const breakdown = getPriceBreakdown(
|
|
5213
|
-
line.category,
|
|
5214
|
-
rate?.priceCAD ?? 0,
|
|
5215
|
-
rate?.baseInDisplayCurrency,
|
|
5216
|
-
rate?.appliedAdjustments ?? []
|
|
5217
|
-
);
|
|
5218
|
-
return { line, breakdown };
|
|
5219
|
-
}),
|
|
5235
|
+
ticketLinesForModal: checkoutModalTicketLinesDisplay,
|
|
5220
5236
|
feeLineItems: feeLineItemsWithAddOns,
|
|
5221
5237
|
returnPriceAdjustment: checkoutReturnLineAmount,
|
|
5222
5238
|
cancellationPolicyFee,
|
|
@@ -5234,17 +5250,6 @@ export function AdminChangeBookingFlow({
|
|
|
5234
5250
|
return;
|
|
5235
5251
|
}
|
|
5236
5252
|
|
|
5237
|
-
const ticketLinesForModal: CheckoutModalLineItem[] = ticketLineItemsForChangeFlowDisplay.map((line) => {
|
|
5238
|
-
const rate = pricing.find((r) => r.category === line.category);
|
|
5239
|
-
const breakdown = getPriceBreakdown(
|
|
5240
|
-
line.category,
|
|
5241
|
-
rate?.priceCAD ?? 0,
|
|
5242
|
-
rate?.baseInDisplayCurrency,
|
|
5243
|
-
rate?.appliedAdjustments ?? []
|
|
5244
|
-
);
|
|
5245
|
-
return { line, breakdown };
|
|
5246
|
-
});
|
|
5247
|
-
|
|
5248
5253
|
setCheckoutClientSecret(paymentIntent.clientSecret ?? '');
|
|
5249
5254
|
setCheckoutModalData({
|
|
5250
5255
|
reservationReference: changeBookingReferenceForPaidFlow ?? '',
|
|
@@ -5277,7 +5282,7 @@ export function AdminChangeBookingFlow({
|
|
|
5277
5282
|
return `${origin}/manage-booking?ref=${ref}&lastName=${ln}&${fromQ}${intentQ}`;
|
|
5278
5283
|
})()
|
|
5279
5284
|
: undefined,
|
|
5280
|
-
ticketLines:
|
|
5285
|
+
ticketLines: checkoutModalTicketLinesDisplay,
|
|
5281
5286
|
feeLineItems: feeLineItemsWithAddOns,
|
|
5282
5287
|
returnPriceAdjustment: checkoutReturnLineAmount,
|
|
5283
5288
|
cancellationPolicyFee,
|
|
@@ -3564,6 +3564,30 @@ export function ChangeBookingFlow({
|
|
|
3564
3564
|
effectivePromoDiscountAmount,
|
|
3565
3565
|
]);
|
|
3566
3566
|
|
|
3567
|
+
const checkoutModalTicketLinesDisplay = useMemo((): CheckoutModalLineItem[] => {
|
|
3568
|
+
return taxIncludedSelfServeReconciledPriceSummaryLines
|
|
3569
|
+
.filter((l): l is Extract<PriceSummaryLine, { kind: 'ticket' }> => l.kind === 'ticket')
|
|
3570
|
+
.map((line) => {
|
|
3571
|
+
const rate = pricing.find((r) => r.category === line.category);
|
|
3572
|
+
const breakdown = getPriceBreakdown(
|
|
3573
|
+
line.category,
|
|
3574
|
+
rate?.priceCAD ?? 0,
|
|
3575
|
+
rate?.baseInDisplayCurrency,
|
|
3576
|
+
rate?.appliedAdjustments ?? [],
|
|
3577
|
+
);
|
|
3578
|
+
const qty = Math.max(0, line.qty);
|
|
3579
|
+
return {
|
|
3580
|
+
line: {
|
|
3581
|
+
category: line.category,
|
|
3582
|
+
qty,
|
|
3583
|
+
itemTotal: line.itemTotal,
|
|
3584
|
+
pricePerUnit: qty > 0 ? roundMoney(line.itemTotal / qty) : 0,
|
|
3585
|
+
},
|
|
3586
|
+
breakdown,
|
|
3587
|
+
};
|
|
3588
|
+
});
|
|
3589
|
+
}, [taxIncludedSelfServeReconciledPriceSummaryLines, pricing, getPriceBreakdown]);
|
|
3590
|
+
|
|
3567
3591
|
const changeFlowClientEstimateDue = (() => {
|
|
3568
3592
|
if (!originalReceipt) return totalPrice;
|
|
3569
3593
|
// Customer self-serve: amount due comes from POST .../change/quote (`amountDueCents` / priceDiff), not FE delta math.
|
|
@@ -4552,17 +4576,6 @@ export function ChangeBookingFlow({
|
|
|
4552
4576
|
})()
|
|
4553
4577
|
);
|
|
4554
4578
|
|
|
4555
|
-
const ticketLinesForModal: CheckoutModalLineItem[] = ticketLineItemsForChangeFlowDisplay.map((line) => {
|
|
4556
|
-
const rate = pricing.find((r) => r.category === line.category);
|
|
4557
|
-
const breakdown = getPriceBreakdown(
|
|
4558
|
-
line.category,
|
|
4559
|
-
rate?.priceCAD ?? 0,
|
|
4560
|
-
rate?.baseInDisplayCurrency,
|
|
4561
|
-
rate?.appliedAdjustments ?? []
|
|
4562
|
-
);
|
|
4563
|
-
return { line, breakdown };
|
|
4564
|
-
});
|
|
4565
|
-
|
|
4566
4579
|
setCheckoutClientSecret(paymentIntent.clientSecret ?? '');
|
|
4567
4580
|
setCheckoutModalData({
|
|
4568
4581
|
reservationReference: changeBookingReferenceForPaidFlow ?? '',
|
|
@@ -4586,7 +4599,7 @@ export function ChangeBookingFlow({
|
|
|
4586
4599
|
return `${origin}/manage-booking?ref=${ref}&lastName=${ln}&${fromQ}${intentQ}`;
|
|
4587
4600
|
})()
|
|
4588
4601
|
: undefined,
|
|
4589
|
-
ticketLines:
|
|
4602
|
+
ticketLines: checkoutModalTicketLinesDisplay,
|
|
4590
4603
|
feeLineItems: feeLineItemsWithAddOns,
|
|
4591
4604
|
returnPriceAdjustment: checkoutReturnLineAmount,
|
|
4592
4605
|
cancellationPolicyFee,
|