@extends('layouts.app') @section('title', 'Plan Details') @section('contents')

Plan #{{ $plan->id }}

Plan Type
{{ $plan->plan_type }}
Period
{{ \Carbon\Carbon::create()->month((int) $plan->month)->format('F') }} {{ $plan->year }}
Status
{{ plan_status_display_label($plan) }}
Current Version
{{ $plan->current_version }}
@php $planRemarksLegacy = $plan->draft_payload['remarks'] ?? null; $schemesForRemarks = $plan->latestVersion?->schemes ?? collect(); $schemeIdsRm = $schemesForRemarks->pluck('scheme_id')->filter()->unique()->values()->all(); $remarkLabelMap = $schemeIdsRm !== [] ? \App\Models\Core\Project::whereIn('project_id', $schemeIdsRm)->pluck('code', 'project_id') : collect(); @endphp @if($schemesForRemarks->filter(fn ($s) => filled(trim((string) ($s->remarks ?? ''))))->isNotEmpty())
Scheme remarks
@foreach($schemesForRemarks as $ps) @if(filled(trim((string) ($ps->remarks ?? ''))))
{{ $remarkLabelMap[$ps->scheme_id] ?? ('UID '.$ps->scheme_id) }}
{!! nl2br(e(trim((string) $ps->remarks))) !!}
@endif @endforeach
@elseif(filled($planRemarksLegacy))
Remarks (legacy)
{!! nl2br(e($planRemarksLegacy)) !!}
@endif
@endsection