@extends('layouts.plan-preview', [ 'planPreviewTitle' => __('Visit Plan :ref', ['ref' => plan_print_reference_id($plan)]), 'planPreviewBackUrl' => route('plan.index'), ]) @section('content') @php $visitFrequencyOrdinal = static function (int $n): string { if ($n <= 0) { return '—'; } if ($n % 100 >= 11 && $n % 100 <= 13) { return $n.'th'; } return match ($n % 10) { 1 => $n.'st', 2 => $n.'nd', 3 => $n.'rd', default => $n.'th', }; }; $normSchemeText = static function (?string $s): string { return trim(preg_replace('/\x{00A0}/u', ' ', (string) $s)); }; $periodMonth = strtoupper(\Carbon\Carbon::create()->month((int) $plan->month)->format('F')); $periodYear = (int) $plan->year; $schemes = $plan->latestVersion?->schemes ?? collect(); $planTypeShort = match ($plan->plan_type ?? '') { 'RVP' => __('Regular'), 'CVP' => __('Compliance'), 'SVP' => __('Special'), 'DRP' => __('Desk Review'), 'ERP' => __('Evaluation'), 'PMP' => __('Project Monitoring'), default => $plan->plan_type ?? '—', }; $status = (string) ($plan->status ?? ''); $watermark = match ($status) { 'approved' => null, 'draft' => 'DRAFT', 'rejected' => 'DECLINED', default => 'UNDER APPROVAL', }; $watermarkMod = match ($status) { 'rejected' => 'is-declined', 'draft' => 'is-draft', default => '', }; $submittedOn = $plan->submitted_at ?? $plan->created_at; $dist = $planPrintSummary['distribution'] ?? []; $districtRows = $planPrintSummary['district_rows'] ?? []; $moBreakdown = $planPrintSummary['mo_breakdown_rows'] ?? []; $moTotals = $planPrintSummary['mo_breakdown_totals'] ?? []; $districtTotal = array_sum(array_column($districtRows, 'count')); $planSignatoryDisplay = static function ($user): array { $name = trim((string) ($user?->name ?? '')); if ($name === '') { $name = trim((string) ($user?->user_name ?? '')); } return [ 'name' => $name !== '' ? $name : '—', 'designation' => plan_pc_user_designation_label($user), ]; }; $sigChecked = $planSignatoryDisplay($plan->checker); $sigVerified = $planSignatoryDisplay($plan->verifier); $sigApproved = $planSignatoryDisplay($plan->approver); $fmtSigDate = static function ($d) { return $d ? $d->format('d-M-Y') : '—'; }; @endphp
{{ __('M&E Cell') }} · {{ __('P&D Department') }} · {{ __('Government of Sindh') }}
| {{ __('S.#') }} | {{ __('UID / ADP#') }} | {{ __('Scheme Name') }} | {{ __('Location') }} | {{ __('Department') }} | {{ __('MEC Sub-Sector') }} | {{ __('Planned Visit Date') }} | {{ __('Reporting Officer') }} | {{ __('Visiting Team') }} | {{ __('Cost (M)') }} | {{ __('Cum. Expd.') }} |
|---|---|---|---|---|---|---|---|---|---|---|
| {{ __('No schemes on the latest version.') }} | ||||||||||
| {{ __('Reporting Officer') }} | {{ __('No. of') }} {{ __('Schemes') }} |
{{ __('Infrastructure') }} | {{ __('Social') }} | {{ __('Production') }} | ||||
|---|---|---|---|---|---|---|---|---|
| {{ __('Irrigation') }} | {{ __('Roads') }} | {{ __('Buildings') }} | {{ __('Total') }} | {{ __('Social') }} | {{ __('W&SD') }} | {{ __('Production') }} | ||
| {{ $row['mo_name'] }} | {{ $row['total'] }} | {{ $row['irrigation'] ?: '—' }} | {{ $row['roads'] ?: '—' }} | {{ $row['buildings'] ?: '—' }} | {{ $row['infra_total'] ?: '—' }} | {{ $row['social'] ?: '—' }} | {{ $row['wsd'] ?: '—' }} | {{ $row['production'] ?: '—' }} |
| {{ __('No reporting officer assignments.') }} | ||||||||
| {{ __('Total') }} ⇒ | {{ $moTotals['total'] ?? 0 }} | {{ $moTotals['irrigation'] ?? 0 }} | {{ $moTotals['roads'] ?? 0 }} | {{ $moTotals['buildings'] ?? 0 }} | {{ $moTotals['infra_total'] ?? 0 }} | {{ $moTotals['social'] ?? 0 }} | {{ $moTotals['wsd'] ?? 0 }} | {{ $moTotals['production'] ?? 0 }} |
| {{ __('District') }} | {{ __('No. of Schemes') }} |
|---|---|
| {{ $dRow['district'] }} | {{ $dRow['count'] }} |
| {{ __('No location data.') }} | |
| {{ __('Total') }}: | {{ $districtTotal }} |