{{-- View Inquiry — docs/wireframes-v12/view-inquiry.html, rebuilt on the wireframe's own markup. v12's layout, top to bottom: 1. a header row: the status pill and the "code · date" line on the left, Edit Inquiry and Proceed to Booking on the right; 2. a `.grid-2` — the detail card on the left, the Follow Up History card on the right, top-aligned; 3. a Back to Inquiries button under both. The detail card is six `.detail-section`s, each a title strip over a `.detail-grid` of label/value pairs. Its page-local CSS is in partials/styles.blade.php, which records rule by rule what was copied and the five places the copy is deliberate rather than literal. ## Deliberate differences from the wireframe * **"Budget Range" and "City" are not rendered** (CR-6 §5.5). v12's Inquiry Details grid draws both, and neither is a field the inquiry form collects or a column the table has. A detail row cannot show data that was never captured, and inventing the columns to fill them would be inventing a requirement — so the rows are dropped and the omission is written down here, which is what recipe §0 asks for. * **"Proceed to Booking" is live as of CR-8 §3.5.** It was an inert disabled button while the Booking module was a non-goal (CR-6 §1); it now links to the New Booking form prefilled from this inquiry, and falls back to the disabled button when the user cannot create bookings or when this inquiry already holds one. The three states and their reasoning are in inquiries/partials/proceed-to-booking.blade.php. * **The Follow Up History is real data, not the wireframe's four mock entries**, and it shares partials/history.blade.php with the follow-up page (CR-6 §5.5). That partial's header explains the one entry that is not a `follow_ups` row: the pinned Tentative Booking, which v12 draws and which the hold columns are the only possible source for. ## Escaping Every value on this page is user-supplied text and every one goes out through `{{ }}`. There is no `{!! !!}` in this file, and nothing here reaches a script. Since CR-10 the page does push one script — nrems-pending-tasks.js, through partials/complete-task-modal.blade.php, for the ✓ on a pending activity task in the timeline. Everything that script can put on screen still arrives as data: a JSON `data-task` attribute per button, json_encode()'d inside `{{ }}` — the house payload-attribute chain, and the one CR-20 put back after Js::from() had rendered it unparseable — and one lang string on the module root. --}} @extends('layouts.app') @section('title', __('inquiries.show_title')) @section('breadcrumbs') @endsection @section('content') @php // Rendered as a dash rather than an empty cell, so an unanswered row // still reads as a row — the projects detail screen's own idiom. $blank = '—'; $dateFormat = config('nrems.date_format'); // "Source Reference" holds whichever of the two conditional source // blocks the inquiry actually used, and a dash for the four sources // that have neither. $sourceReference = match ($inquiry->source) { \App\Enums\InquirySource::Reference => $inquiry->reference_by, \App\Enums\InquirySource::Broker => $inquiry->broker?->name, default => null, }; // One success pill per DISTINCT type recorded, in the enum's own order // rather than the journey's: the strip is "what has been done about // this inquiry", and three brochures are one answer to that. $recordedTypes = $inquiry->followUps ->map(static fn (\App\Models\FollowUp $entry): \App\Enums\FollowUpType => $entry->type) ->unique() ->sortBy(static fn (\App\Enums\FollowUpType $type): int => $type->value); // The wireframe's detail strip under the pills names ONE entry: the // latest dated one. Undated entries are skipped rather than sorted to // the top — the strip prints a date, and an entry with none has nothing // to print. $latest = $inquiry->followUps->filter(static fn (\App\Models\FollowUp $entry): bool => $entry->date !== null) ->sortByDesc(static fn (\App\Models\FollowUp $entry): string => (string) $entry->date?->format('Y-m-d')) ->first(); @endphp
{{ $inquiry->code }}  ·  {{ $inquiry->inquiry_date->format($dateFormat) }}
{{-- CR-6.2 item K2: the listing is not the only door. A booking-confirmed inquiry offers no Edit here either, for every viewer including a Super Admin — the same status predicate the row actions and InquiryController::edit() use, so a screen and its server cannot disagree. Cancelling the booking reverts the status (CR-9) and the button comes back. --}} @can('update', $inquiry) @unless ($inquiry->isLockedByBooking()) {{ __('inquiries.actions.edit_inquiry') }} @endunless @endcan @include('inquiries.partials.proceed-to-booking', ['inquiry' => $inquiry])
{{-- A bare `.card`, not : the wireframe's detail card has no header and no `.card-body` — each `.detail-section` carries its own 24px padding, which is what the component would have doubled. --}}
{{ __('inquiries.sections.customer_information') }}
{{ __('inquiries.fields.full_name') }} {{ $inquiry->full_name }}
{{ __('inquiries.fields.phone_number') }} {{ $inquiry->whatsapp_number }}
{{ __('inquiries.fields.email') }} {{ $inquiry->email ?: $blank }}
{{ __('inquiries.fields.alternate_phone') }} {{ $inquiry->alternate_phone ?: $blank }}
{{ __('inquiries.sections.inquiry_details') }}
{{-- v12's only three-column grid on the page. See the styles partial on why this is a `.detail-grid-3` modifier rather than an override of the shared `.detail-grid`. --}}
{{ __('inquiries.fields.inquiry_date') }} {{ $inquiry->inquiry_date->format($dateFormat) }}
{{ __('inquiries.fields.source_short') }} {{ $inquiry->source->label() }}
{{ __('inquiries.fields.status') }}
{{ __('inquiries.fields.project_id') }} {{ $inquiry->project?->name ?? $blank }}
{{ __('inquiries.fields.property_type') }} {{ $inquiry->property_type?->label() ?? $blank }}
{{ __('inquiries.fields.preferred_unit_id') }} {{ $inquiry->preferredUnit?->unit_number ?? $blank }}
{{ __('inquiries.fields.trans_type_short') }} {{ $inquiry->trans_type?->label() ?? $blank }}
{{-- v12 has "Budget Range" and "City" here. Neither is captured by the form or held by the table, so neither is rendered — see the header block. --}}
{{ __('inquiries.sections.assignment_detail') }}
{{ __('inquiries.fields.assigned_to') }} {{ $inquiry->assignee?->name ?? $blank }}
{{ __('inquiries.fields.source_reference') }} {{ $sourceReference ?: $blank }}
{{ __('inquiries.sections.tentative') }}
{{ __('inquiries.fields.tentative_unit_id') }} {{ $inquiry->tentativeUnit?->unit_number ?? $blank }}
{{ __('inquiries.fields.hold_until') }} {{ $inquiry->hold_until?->format($dateFormat) ?? $blank }}
{{ __('inquiries.sections.occupation_address') }}
{{ __('inquiries.fields.occupation') }} {{ $inquiry->occupation?->label() ?? $blank }}
{{ __('inquiries.fields.current_address') }} {{ $inquiry->current_address ?: $blank }}
{{-- v12 puts Remarks on a row of its own below the grid, at full width. `.detail-item-wide` is the app-additions class for exactly that (recipe §9). --}}
{{ __('inquiries.fields.remarks') }} {{ $inquiry->remarks ?: $blank }}
{{ __('inquiries.sections.conclusion') }}
@if ($recordedTypes->isEmpty())

{{ __('inquiries.history.empty') }}

@else
@foreach ($recordedTypes as $type) {{ $type->label() }} @endforeach
@if ($latest !== null)
{{ $latest->type->label() }}: {{ $latest->date?->format($dateFormat) }}@if ($latest->timeLabel() !== null) {{ __('inquiries.history.at') }} {{ $latest->timeLabel() }}@endif
@endif @endif
{{ __('inquiries.history.title') }}
{{-- The third door, and the same lock (CR-6.2 item K2): the Follow Up page is a record action, and InquiryActionController::followUp() refuses a locked inquiry, so offering the link would be offering a 403. --}} @can('update', $inquiry) @unless ($inquiry->isLockedByBooking()) {{ __('inquiries.actions.add_follow_up') }} @endunless @endcan
@include('inquiries.partials.complete-task-alert') @include('inquiries.partials.history', ['entries' => $inquiry->followUps])
{{ __('inquiries.actions.back') }}
{{-- The shared conclusion dialog and the document tasks' hoisted forms (CR-10 §6.3). Last, and outside every card: the stack inside it renders what the timeline above has pushed. --}} @include('inquiries.partials.complete-task-modal') @endsection @push('styles') @include('inquiries.partials.styles') @endpush