mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 21:15:41 +00:00
Implement consolidated booking handling and UI updates for shared wagons
This commit is contained in:
@@ -197,6 +197,15 @@ export function BookingPaymentPanel({
|
||||
: priceTotal(pricing);
|
||||
const items = priceLineItems(pricing);
|
||||
|
||||
// Consolidation: this shipment shares a wagon with a partner booking, and the
|
||||
// wagon is only scheduled once both partners have paid. Surface a note while
|
||||
// payment is still pending (pay-window open, or a deadline set and not paid).
|
||||
const showConsolidationNote =
|
||||
!paid &&
|
||||
Boolean(booking.consolidationPartnerId) &&
|
||||
(booking.status === "SELECTED_FOR_BATCH" ||
|
||||
Boolean(booking.paymentDeadline));
|
||||
|
||||
const { data: invoices = [] } = useQuery({
|
||||
queryKey: ["booking-invoices", booking.id],
|
||||
queryFn: () => invoicesService.listForSource("booking", booking.id),
|
||||
@@ -268,6 +277,12 @@ export function BookingPaymentPanel({
|
||||
onPay={onPay}
|
||||
paying={paying}
|
||||
/>
|
||||
{showConsolidationNote && (
|
||||
<Text mt={12} fz="12px" c="#9AA8B5" lh={1.5}>
|
||||
This shipment shares a wagon with a consolidation partner — both
|
||||
shipments must be paid for the wagon to be scheduled.
|
||||
</Text>
|
||||
)}
|
||||
<Divider />
|
||||
</Box>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user