{{-- Initiate Cancellation — docs/wireframes-v12/add-cancellation.html (the card at lines 76-214: three form sections and the footer). ## Shape ONE `.card`. Inside it, a `.form-section` per heading — each with its `.form-section-title` and the wireframe's own icon — and a `.card-footer` at the bottom. Fields are laid out by v12's `.form-row.form-row-3` / `-4` grids, not by Bootstrap columns, which is why no field carries a `group-class`: the row owns the columns and `.form-group` owns its own margin. ## The twin rule (recipe §9, CR-9 §0.6) This file and cancellations/edit.blade.php are twins. Every field is written out in both, and neither includes a shared form partial for its own fields. **A field added, removed or renamed here must be mirrored in edit.blade.php in the same commit.** The one thing they share is cancellations/partials/document-verified.blade.php, and that partial's header says why a checklist generated from an enum is the exception. ### What this screen has that its twin does not * it posts to `cancellations.store` as a POST, where the twin PUTs to `cancellations.update` and therefore carries a `_method` field; * Booking ID is a real ` @if ($chosen !== null) @endif {{-- Display-only, and deliberately NAMELESS as well as disabled: a disabled control does not submit, and a control with no name could not be read even if somebody removed the attribute with devtools. The three values are the booking's own and are re-read from the row on every save. The projects module's readonly Project Code input records the same pattern. --}}
{{-- Still a `.form-row-4`, with three empty cells. The wireframe put Booking Date first and three financial fields beside it; the client removed those three, and keeping the grid is what keeps Booking Date the same width it is on the wireframe rather than stretching it across the card. --}}
{{-- ===== 2. Cancellation Details ===== --}}
Cancellation Details
{{-- No placeholder and no asterisk: the wireframe's select opens on Customer, has no blank option and carries no `*` — so the field can never be empty and the star would be a mark the wireframe does not draw. It is still `required` on the server (CR-9 §5), which is where a hand-rolled post omitting it is refused. --}} {{-- Prefilled with today (client instruction). old() still wins, through the component's own form_old(). --}}
{{-- ===== 3. Document Verified ===== --}} @include('cancellations.partials.document-verified', [ 'selectedStage' => $selectedStage, 'verified' => $verified, ]) {{-- v12's card footer: Cancel as the outline button, then the submit. `.card-footer` is already the flex row, so no wrapper of its own. The label is decision D6 — the wireframe's "Submit for Approval" names a workflow that does not exist, and this button cancels the booking outright. --}} {{-- The stage and checklist rules are excluded from the client rule set: `stage` is two checkboxes sharing one name, which jQuery Validate reads as a group and reports against whichever box it bound first, and the checklist's valid range depends on which card is ticked — a cross-field bound proengsoft has no vocabulary for. The server validates both on every submit. See CancellationRequest::clientRuleExclusions(). --}} @endsection @push('scripts') {{-- The cancellation form client (CR-9 §6.2, CR-19 §S4). ES5, no build step, and it does nothing at all on a page without #nrems_cancellation_form_module. It composes no text of its own — its sentences come from `data-strings` above and the three values it writes are scalars the search endpoint built — and it reaches the DOM through `.value` and the `hidden` / `disabled` properties, never innerHTML. Its one dependency is optional: jQuery and select2 (both already in plugins.bundle.js, which layouts.app loads before this) turn the Booking ID select into the remote search. Without them the module still runs and the screen still works, with the server-rendered selection and no search. --}} @endpush