@extends('layouts.app') @section('title', 'PC-III B (MMR Report)') @section('page-header') @endsection @push('stylesheets') @endpush @section('contents') @php $scheme = $landing['scheme'] ?? []; $statuses = $landing['document_statuses'] ?? []; $past = $landing['past_reports'] ?? []; $gate = $landing['create_gate'] ?? ['allowed' => false, 'reason' => null]; $projectId = (int) ($scheme['project_id'] ?? $projectId ?? 0); $createUrl = route('pc-forms.create-pc-iii-b', ['project_id' => $projectId, 'wizard' => 1]); $yearOptions = $landing['year_options'] ?? []; $selectedYearKey = (string) ($past['selected_year_key'] ?? ($yearOptions[0]['value'] ?? '')); @endphp
@if($projectId <= 0)
Open PC-III B from a scheme (Generate PC) so scheme details can load.
@endif

PC-III B (MMR Report)

Scheme overview and district-based monthly reports. Wizard opens only when you create a report.

Scheme information
@php $ltbcVal = (string) ($scheme['ltbc'] ?? '—'); $approvalVal = (string) ($scheme['approval_type'] ?? '—'); $schemeTypeVal = (string) ($scheme['scheme_type'] ?? '—'); $underRevVal = (string) ($scheme['under_revision'] ?? 'No'); $toMillion = static function ($n): string { $n = (float) $n; $m = abs($n) >= 1000 ? ($n / 1e6) : $n; return number_format($m, 3, '.', ','); }; $cap = $toMillion($scheme['approved_cost_capital'] ?? 0); $rev = $toMillion($scheme['approved_cost_revenue'] ?? 0); $tot = $toMillion($scheme['approved_cost_total'] ?? 0); @endphp
Scheme name {{ $scheme['scheme_name'] ?? '—' }}
UID {{ $scheme['uid'] ?? '—' }}
ADP # {{ $scheme['adp_number'] ?? '—' }}
Department {{ $scheme['department'] ?? '—' }}
Sector {{ $scheme['sector'] ?? '—' }}
Under Revision @if($underRevVal === 'Yes') Yes @else No @endif
Department {{ $scheme['department'] ?? ($scheme['administrative_department'] ?? '—') }}
Scheme Start Date {{ $scheme['scheme_start_date'] ?? '—' }}
Scheme Completion Date {{ $scheme['scheme_completion_date'] ?? '—' }}
MEC Scheme Type {{ $scheme['mec_scheme_type'] ?? '—' }}
LTBC @if($ltbcVal === 'Yes') Yes @elseif($ltbcVal === 'No') No @else {{ $ltbcVal }} @endif
Scheme Type {{ $schemeTypeVal }}
Approval Type @if($approvalVal === 'Approved') Approved @else {{ $approvalVal }} @endif
Approved Cost of Scheme Capital {{ $cap }} + Revenue {{ $rev }} = Total {{ $tot }} (Rs. M)
PC / PCN status
@if(empty($statuses))

No PC-I, Modified/Revised PC-I, PC-II, or PCN found for this scheme.

@else
@foreach($statuses as $row) @endforeach
Document Status Moving Status
{{ $row['label'] }} @php $st = (string) ($row['state'] ?? '—'); @endphp {{ $st }} {{ $row['moving_status'] ?? '—' }}
@endif
General information — Create / View reports
@if(!empty($gate['allowed'])) Create Report @else @if(!empty($gate['reason']))

{{ $gate['reason'] }}

@endif @endif All reports are district-based. One PC-III B can include multiple districts for a month.
{{ $past['fy_label'] ?? '' }} Report View past district × month reports
@if(empty($past['rows']))

No submitted PC-III B reports for {{ $past['fy_label'] ?? $selectedYearKey }} yet.

@else @foreach(($past['months'] ?? []) as $m) @endforeach @foreach($past['rows'] as $row) @foreach(($past['months'] ?? []) as $m) @php $cell = $row['cells'][$m] ?? null; @endphp @endforeach @endforeach
S No District{{ substr($m, 0, 3) }}
{{ $row['sno'] }} {{ $row['district'] }} @if(is_array($cell) && !empty($cell['url'])) View @else N A @endif
@endif
@endsection