mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 18:20:57 +00:00
Merge pull request #503 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
This commit is contained in:
@@ -90,11 +90,16 @@ export default function ContractClearanceDetailPage() {
|
||||
].includes(contract.status),
|
||||
);
|
||||
const linkedBookingId = useMemo(() => {
|
||||
// Prefer the clearance view's server-resolved linkedBookingId (same field the
|
||||
// GL Djibouti page uses). The contract's clearanceCycles[cycle].bookingId can
|
||||
// be null/stale for an export FCFS booking, which would disable
|
||||
// useBookingMilestones → empty milestones → the export "Payment & wagon
|
||||
// allocation" step reads FREIGHT_PAYMENT_SETTLED as not-done and stays stuck.
|
||||
const cycle = contract?.clearanceCycles?.find(
|
||||
(c) => c.cycleNumber === (contract?.clearanceCycleNumber ?? 1),
|
||||
);
|
||||
return cycle?.bookingId ?? undefined;
|
||||
}, [contract]);
|
||||
return clearance?.linkedBookingId ?? cycle?.bookingId ?? undefined;
|
||||
}, [clearance, contract]);
|
||||
const bookingAlreadyCreated = Boolean(linkedBookingId) || shipmentLocked;
|
||||
const canCreateBooking = ready && !bookingAlreadyCreated;
|
||||
const reviewReadOnly = shipmentLocked;
|
||||
|
||||
Reference in New Issue
Block a user