Merge pull request #659 from Tria-plc/freight_feature/usermanagement

enhance contract clearance and train scheduling logic; add filters fo…
This commit is contained in:
marshal
2026-07-14 09:54:00 +03:00
committed by GitHub
5 changed files with 45 additions and 7 deletions

View File

@@ -149,8 +149,12 @@ export function ExportClearanceStepper({
const entityId = contractId ?? bookingId ?? "";
// The booking that carries the post-booking steps (gate pass, T1, invoice).
const actionBookingId = clearance.linkedBookingId ?? bookingId ?? null;
// Per-booking GENERAL clearance runs on a bare instance that only becomes a
// real booking once GL completes it — the caller's bookingCreated prop carries
// that signal, so a booking-keyed view must NOT count as "created" by itself
// (it would lock GL Ethiopia out of the declaration step right after the RO).
const effectiveBookingCreated =
bookingCreated || Boolean(clearance.linkedBookingId) || isBooking;
bookingCreated || Boolean(clearance.linkedBookingId);
const activeStep = useMemo(
() => computeExportActiveStep(clearance, bookingMilestones, effectiveBookingCreated),