@php use App\Support\MecReportType; /** @var \App\Models\MecReport $report */ /** @var \App\Models\PC\Plan|null $plan */ /** @var \App\Models\Core\Project|null $project */ $submitted = $report->submitted_at ?? $report->created_at; $submittedLabel = $submitted instanceof \Illuminate\Support\Carbon ? $submitted->timezone(config('app.timezone'))->format('d M Y, H:i') : (string) $submitted; $published = $report->resolvedPublishedAt(); $publishedLabel = $published instanceof \DateTimeInterface ? \Carbon\Carbon::instance($published)->timezone(config('app.timezone'))->format('d M Y, H:i') : '—'; $periodLabel = $plan !== null ? \Carbon\Carbon::create()->month((int) $plan->month)->format('F').' '.$plan->year : '—'; $planMetaRegion = $plan !== null ? plan_region_label_for_plan($plan) : '—'; $reportTypeLabel = match (MecReportType::normalize((string) $report->report_type)) { MecReportType::RMR, MecReportType::CMR => __('Monitoring Report'), MecReportType::SAR => __('Short Assessment Report (SAR)'), MecReportType::DRR => __('Desk Review Report (DRR)'), MecReportType::SER => __('Summative Evaluation Report (SER)'), MecReportType::IER => __('Impact Evaluation Report (IER)'), MecReportType::TPR => __('Third Party Validation Report (TPR)'), MecReportType::PPR, MecReportType::PMR => __('Project Monitoring Report (PMR)'), default => (string) $report->report_type, }; $evaluationReportNoPreview = MecReportType::isSerIerTpr((string) $report->report_type); $erpLatestDownloadUrl = $evaluationReportNoPreview ? mec_report_erp_latest_document_download_url($report) : ''; $erpLatestFileName = trim((string) data_get(is_array($report->payload) ? $report->payload : [], 'erp_profile.attachment_word_original_name', '')); @endphp
{{ $reportTypeLabel }} {{ __('Report ID') }}: #{{ $report->id }}
{{ __('Monitoring report details') }}
{{ $periodLabel }}
@if (! $evaluationReportNoPreview && user_can_preview_mec_report($report)) {{ __('Preview') }} @endif @if ($erpLatestDownloadUrl !== '') {{ __('Download') }} @endif
{{ __('Submitted') }} {{ $submittedLabel }}
{{ __('Submitted by') }} {{ $report->user?->name ?? '—' }}
{{ __('Division') }} {{ $planMetaRegion }}
{{ __('Plan type') }} {{ $plan?->plan_type ?? '—' }}
{{ __('ADP #') }} {{ \App\Support\MecReportAdpFiscalYear::listingLabel($report ?? null) }}
{{ __('UID') }} {{ $project?->code ?? '—' }}
{{ __('Scheme') }} {{ $project?->name ?? '—' }}
{{ __('Published') }} {{ $publishedLabel }}
{{ __('Current status') }} @include('reports.partials.mec-listing-status-badges', ['report' => $report, 'showVerdict' => true])
@if (! empty($mecReportWorkflowHistory))
{{ __('Report history') }}
@include('reports.partials.workflow-history-timeline', [ 'workflowHistory' => $mecReportWorkflowHistory, ])
@endif

@if ($evaluationReportNoPreview && $erpLatestDownloadUrl !== '') {{ __('Download retrieves the latest Word evaluation report file attached to this submission.') }} @else {{ __('Review opens the printable report in a new tab (read-only).') }} @endif