{{-- Edit Cancellation — docs/wireframes-v12/edit-cancellation.html (the card at lines 76-239). ## Shape ONE `.card`, exactly as the create twin: a `.form-section` per heading with 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. ## The twin rule (recipe §9, CR-9 §0.6) This file and cancellations/create.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 create.blade.php in the same commit.** The one thing they share is cancellations/partials/document-verified.blade.php. ### What this screen has that its twin does not * it PUTs to `cancellations.update` and therefore carries a `_method` field, where the twin POSTs to `cancellations.store`; * all four Booking Reference fields are **disabled inputs with real values**. There is no select here at all: the booking of a cancellation can never change (CR-9 §6.3, decision D12), and CancellationRequest gives `booking_id` no rule on this route — so a PUT smuggling one cannot reach validated() and cannot retarget the row. The screen and the server agree by construction rather than by two checks agreeing; * every control is prefilled from the stored row, with `old()` still winning on a rejected submit — including the ticked stage card, its open panel and its ticked checklist boxes; * its footer submits "Update Cancellation". ## Authorised deviations from the wireframe (CR-9 §6.3, §9) * **The entire Approval section is dropped** (decision D7 / D3). The wireframe draws Approver, Approval Status, Approval Date and Approval Comments, and this application has no approval workflow: a cancellation takes effect the moment it is submitted. The footer's Reject and "Approve & Process Refund" buttons go with it, replaced by one primary "Update Cancellation" beside the outline Cancel link. * **Total Booking Value, Total Paid and Outstanding Balance are dropped** from Booking Reference, and the row keeps its `.form-row-4` grid with three empty `.form-group` divs holding the geometry. * **IFSC Code and Expected Refund Date are dropped** with their entire trailing `.form-row-3`. No refund tracking and no money columns exist. * **No inline `onchange=`** on the stage checkboxes — data-role hooks read by nrems-cancellation-form.js instead. Identical behaviour. ## What saving here does, and does not Attributes only (decision D12). The status stays `cancelled`, the unit stays where cancel() put it, the inquiry is untouched, `cancelled_by` keeps naming whoever actually cancelled the booking, and **no second email is sent**. Side effects fired once, at submit. BookingService::updateCancellation() is where that is enforced. ## No lang file (CR-9 §0.1) Every string on this screen is written here, on the client's instruction. --}} @extends('layouts.app') @section('title', 'Edit Cancellation - '.$booking->code) @section('breadcrumbs') @endsection @section('content') @php // The em-dash the rest of this module writes in a value with nothing in // it. A disabled input showing "—" reads as "there is nothing here" // rather than as a control that failed to load. $blank = '—'; $customer = $booking->mainCustomer; $projectUnit = array_values(array_filter([ $booking->project?->name, $booking->unit?->unit_number, ])); // The Document Verified section's state: old() first so a rejected // submit comes back with the same card ticked and the same boxes inside // it, the stored row second. $stageValue = old('stage', $booking->cancellation_stage?->value); $selectedStage = is_string($stageValue) ? \App\Enums\CancellationStage::tryFrom($stageValue) : null; $verifiedRaw = old('verified_docs', $booking->cancellation_verified_docs ?? []); $verified = is_array($verifiedRaw) ? array_values(array_map(intval(...), array_filter($verifiedRaw, is_numeric(...)))) : []; @endphp
{{-- ===== 1. Booking Reference ===== --}}
Booking Reference
{{-- Four display-only controls. Every one is disabled AND nameless: a disabled control does not submit, and one with no name could not be read even if somebody removed the attribute with devtools. The projects module's readonly Project Code input records the same pattern for the same reason. The asterisk on Booking ID is the wireframe's own — it marks the field as one the cancellation cannot exist without, which is true, rather than as one this form collects. --}}
{{-- Still a `.form-row-4`, with three empty cells — see the header on why the grid is kept after the three financial fields went. --}}
{{-- ===== 2. Cancellation Details ===== --}}
Cancellation Details
{{-- No placeholder and no asterisk — the create twin's note applies here unchanged. --}}
{{-- ===== 3. Document Verified ===== --}} @include('cancellations.partials.document-verified', [ 'selectedStage' => $selectedStage, 'verified' => $verified, ]) {{-- v12's card footer, with the approval pair replaced by one submit (decision D7). `.card-footer` is already the flex row. --}}
{{-- The stage and checklist rules are excluded from the client rule set — create.blade.php carries the same note. `booking_id` is not excluded here and does not need to be: rules() omits it entirely on this route, so there is no rule to render. --}} @endsection @push('scripts') {{-- The same module the create twin loads. On this screen it has no select to watch — the Booking Reference fields are disabled inputs — so only its stage half does anything, which is exactly what the missing data-role hook makes happen. --}} @endpush