mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 01:48:12 +00:00
enhance contract clearance and train scheduling logic; add filters for clearance documents and improve booking validation
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -248,6 +248,7 @@ export default function DocumentClearanceDetailPage() {
|
||||
// stepper's "Create booking" step must read as NOT-yet-created
|
||||
// so it never claims the booking is done before GL completes it.
|
||||
bookingCreated={Number(booking?.totalAmount ?? 0) > 0}
|
||||
bookingMilestones={bookingMilestones ?? []}
|
||||
onChanged={() => void refetch()}
|
||||
onViewFile={view}
|
||||
onDownloadFile={(f) => void downloadBookingFile(f.id, f.name)}
|
||||
|
||||
Reference in New Issue
Block a user