@extends('layouts.app') @php $dec = static fn ($v): string => mws_notice_decode_plain((string) ($v ?? '')); $decHtml = static fn ($v): string => mws_notice_decode_inline_html((string) ($v ?? '')); $formVal = static fn ($v): string => mws_notice_form_value((string) ($v ?? '')); $formValHtml = static fn ($v): string => mws_notice_decode_inline_html((string) ($v ?? '')); $schemeLabel = trim($dec($letter['scheme_name'] ?? '')); if ($schemeLabel === '') { $schemeLabel = 'PC Form #'.(int) ($pcForm->id ?? 0); } $sigCode = (string) ($letter['sig_code'] ?? 'DEPT'); $workflowMeta = is_array($workflowMeta ?? null) ? $workflowMeta : []; $bodyParagraphs = $letter['body_paragraphs'] ?? []; if (! is_array($bodyParagraphs) || $bodyParagraphs === []) { $bodyParagraphs = [ 'It is, therefore, requested that the aforesaid Administrative Approval may kindly be authenticated and returned to this Department.', ]; } $ccLines = $letter['cc_lines'] ?? []; $editBodyParagraphs = $editDefaults['body_paragraphs'] ?? $bodyParagraphs; if (! is_array($editBodyParagraphs)) { $editBodyParagraphs = $bodyParagraphs; } $sigState = is_array($letterSignature ?? null) ? $letterSignature : []; $sigEffective = trim((string) ($sigState['effective_url'] ?? ($letter['letter_signature_url'] ?? ''))); $sigDrawn = trim((string) ($sigState['drawn_url'] ?? '')); $sigUploaded = trim((string) ($sigState['uploaded_url'] ?? '')); $aaBackLabel = str_contains((string) ($returnUrl ?? ''), 'meeting-workspace') ? '← Back to workspace' : '← Back to PC Forms'; $aaBodyParaHtml = static function ($para) use ($decHtml): string { $raw = preg_replace('/^[ \t\r\n]+|[ \t\r\n]+$/u', '', $decHtml($para)) ?? ''; if ($raw === '') { return ''; } $raw = str_replace(["\t", "\u{00A0}"], [str_repeat(' ', 4), ' '], $raw); if (preg_match('/<[a-z][\s\S]*>/i', $raw) || str_contains($raw, ' ')) { return nl2br($raw, false); } return nl2br(e($raw)); }; @endphp @section('title', 'AA (Administrative Approval) — '.$schemeLabel) @push('styles') @endpush @section('contents')
{{ $aaBackLabel }} @if (!empty($workflowMeta['can_edit_cover']) || !empty($workflowMeta['can_generate']) || !empty($workflowMeta['can_da_approve']) || !empty($workflowMeta['can_forward_fd']) || !empty($workflowMeta['can_fd_act']) || !empty($isForwarded) || !empty($canEdit)) Cover letter @endif @if ($canEdit) @endif @if (!empty($workflowMeta['can_submit_to_da'])) @endif @if (!empty($workflowMeta['can_da_approve'])) @endif @if (!empty($workflowMeta['can_forward_fd'])) @endif @if (!empty($workflowMeta['can_fd_act'])) @endif @if (!empty($workflowMeta['label'])) {{ $workflowMeta['label'] }} @endif
{{ $dec($letter['reference_no'] ?? '') }}
Government of Sindh
{{ $dec($letter['department_upper'] ?? '') }}
Karachi dated the {{ $dec($letter['letter_date_long'] ?? '') }}
ADMINISTRATIVE APPROVAL
@if ($canEdit) @endif
@foreach ($bodyParagraphs as $idx => $para)

{!! $aaBodyParaHtml($para) !!}

@if ($canEdit) @endif
@endforeach
@if ($canEdit) @endif
@if (!empty($letter['da_letter_signature_url']))
@else @endif
({{ $dec($letter['da_approver_name'] ?: '________________') }})
{{ $dec($letter['da_approver_designation'] ?? 'Secretary to Government of Sindh') }}
{{ $dec($letter['da_approver_department'] ?? '') }}
{{ $dec($letter['fd_ref_no'] ?? 'NO.FD.SO (DEV- )') }}
Karachi, dated the {{ $dec($letter['letter_date_long'] ?? '________ 2026') }}
A copy is forwarded to the Accountant General, Sindh, Karachi for information & necessary action.
@if (!empty($letter['fd_auth_signature_url']))
@else @endif
Section Officer (Dev- )
Finance Department
@if (!empty($letter['fd_auth_name']))
({{ $dec($letter['fd_auth_name']) }})
@endif
{{ $dec($letter['reference_no'] ?? '') }}
Karachi, dated the {{ $dec($letter['letter_date_long'] ?? '') }}
A copy is forwarded for information to:=
    @foreach ($ccLines as $ccLine)
  • {{ $dec($ccLine) }}
  • @endforeach
@if ($canEdit) @endif
{{-- Forward-to-FD modal reused by workflow toolbar --}}
@endsection @push('styles_after_adminlte') {{-- A4 print overrides: loaded after AdminLTE to beat @page size:a3 and body min-width. --}} @endpush @push('scripts') @if (! empty($canEdit) && ! empty($canEditSignature)) @else @endif @endpush