@extends('layouts.app') @php $_mwsAlDec = static fn ($v): string => mws_notice_decode_plain((string) ($v ?? '')); $_mwsAlDecHtml = static fn ($v): string => mws_notice_decode_inline_html((string) ($v ?? '')); $_mwsAlFormVal = static fn ($v): string => mws_notice_form_value((string) ($v ?? '')); $_mwsAlCostMillion = static function ($v): string { $t = trim(mws_notice_decode_plain((string) ($v ?? ''))); if ($t === '' || $t === '—') { return '—'; } $norm = str_replace(',', '', $t); if (! is_numeric($norm)) { return $t; } return number_format((float) $norm, 3, '.', ','); }; @endphp @section('title', 'Advice letter - '.$_mwsAlDec(trim((string) ($adviseLetter['letter_number'] ?? '')) !== '' ? $adviseLetter['letter_number'] : ($meeting->reference_id ?? 'PC Form'))) {{-- Self-contained advise letter (layout + forward/CC lists + scripts). No separate document partials. Unified workflow (aligned with meeting-notice-letter.blade.php): • Default: view / print — editors and row controls are hidden. • Edit: toggles .mws-al--editing — shows inline inputs and structural actions (add/remove rows). • Optional URL ?edit=1 (used by Generate on meeting show) opens edit mode once the page has loaded. • Save: PATCH JSON to data-mws-al-save-url, then redirect to meeting show (or reload if no return URL). • Cancel: navigate to meeting show when data-mws-al-meeting-show-url is set; otherwise reload. • Print: notice-print-toolbar + top Print trigger; beforeprint syncs textarea → view text when editing. • Organizer signature: Signature Pad + persist via letter_signature (same pattern as meeting notice). • Edit toolbar is omitted after the first successful save (same idea as the meeting notice once it leaves draft). --}} @push('styles') @if (! empty($adviseStandaloneCirculation)) {{-- Same Select2 CSS as PC-I Forward/Return. JS alone leaves results as an unstyled