@php /** * PDWP Working Paper Form (Word-like). * Expects: $data (array) */ $data = \App\Support\WorkingPaperRichTextHtml::decodePayloadStrings(is_array($data ?? null) ? $data : []); $m = function (string $key) use ($data): string { $raw = data_get($data ?? [], $key, ''); if ($raw === null || $raw === '') { return ''; } return \App\Helpers\PC\AmountMillionHelper::amountToMillion($raw); }; $v = function (string $key, $default = '') use ($data) { $raw = data_get($data ?? [], $key, $default); if (is_string($raw)) { return \App\Support\HtmlDisplay::decodeEntities($raw, 8); } if (is_array($raw)) { return \App\Support\WorkingPaperRichTextHtml::decodePayloadStrings($raw); } return $raw; }; $rbmRows = data_get($data ?? [], 'rbm', []); $rbmCount = max(1, is_array($rbmRows) ? count($rbmRows) : 0); $rbmMinRows = 1; $revisionRows = data_get($data ?? [], 'revision_compare', []); $revisionCount = max(3, is_array($revisionRows) ? count($revisionRows) : 0); $overallRows = data_get($data ?? [], 'overall_comments', []); $overallCount = max(3, is_array($overallRows) ? count($overallRows) : 0); $pcLinkedKeys = is_array($pcLinkedKeys ?? null) ? $pcLinkedKeys : []; $canEditBody = (bool) ($canEditWorkingPaperBody ?? true); $ro = function (string $key) use ($pcLinkedKeys, $canEditBody): string { if (in_array($key, ['rbm', 'cost', 'operation_maintenance', 'location'], true) && $canEditBody) { return ''; } return in_array($key, $pcLinkedKeys, true) ? 'readonly' : ''; }; $defaultCostSourceLabel = function (string $k): string { if ($k === 'original') { return 'Original'; } if ($k === 'revised') { return 'Revised'; } if ($k === 'revised2') { return '2nd Revised'; } if (preg_match('/^revised(\d+)$/', $k, $m)) { $n = (int) $m[1]; $suffix = ($n % 100 >= 11 && $n % 100 <= 13) ? 'th' : (match ($n % 10) { 1 => 'st', 2 => 'nd', 3 => 'rd', default => 'th' }); return $n.$suffix.' Revised'; } return $k; }; $costSourceValue = fn (string $k): string => trim((string) $v("cost.$k.source", '')) !== '' ? trim((string) $v("cost.$k.source", '')) : $defaultCostSourceLabel($k); $ce = is_array($ceProjectCostBreakdown ?? null) ? $ceProjectCostBreakdown : []; $ceHasCostBreakdown = ! empty($ce['has_lines']); @endphp @push('stylesheets') @endpush

GOVERNMENT OF SINDH

PLANNING AND DEVELOPMENT DEPARTMENT

WORKING PAPER FOR PDWP

@include('working-papers.partials.scheme-meta-header', [ 'v' => $v, 'inputClass' => 'pdwpwp-input', 'textareaClass' => 'pdwpwp-textarea', 'fontSize' => '11pt', ])
1. Project Title:
2. Location:
3. Authorities Responsible for;
(i) Sponsoring Agency
(ii) Executing Agency
(iii) Operation & Maintenance
4. Date of Receipt in P&D:
@php $cost = data_get($data ?? [], 'cost', []); $cost = is_array($cost) ? $cost : []; $revisionKeys = array_values(array_filter(array_keys($cost), fn ($k) => $k !== 'original')); usort($revisionKeys, function ($a, $b) { $idx = function ($k) { if ($k === 'revised') return 1; if ($k === 'revised2') return 2; if (preg_match('/^revised(\d+)$/', (string) $k, $m)) return (int) $m[1]; return 9999; }; return $idx($a) <=> $idx($b); }); $costRowKeys = array_merge(['original'], $revisionKeys); $revLabel = function (string $k) { if ($k === 'original') { return 'Original'; } if ($k === 'revised') return 'Revised'; if ($k === 'revised2') return '2nd Revised'; if (preg_match('/^revised(\d+)$/', $k, $m)) { $n = (int) $m[1]; $suffix = ($n % 100 >= 11 && $n % 100 <= 13) ? 'th' : (match ($n % 10) { 1 => 'st', 2 => 'nd', 3 => 'rd', default => 'th' }); return $n.''.$suffix.' Revised'; } return e($k); }; $costMinRows = 1; @endphp {{-- 5. Cost of Project --}} @foreach($costRowKeys as $costKey) @endforeach @if ($canEditBody) @endif {{-- 6. Expenditure Incurred (if any) --}} {{-- 7. Period of Implementation --}} {{-- 8. Plan Framework (inline input added) --}} {{-- 9. Objectives & Brief Description --}} {{-- 10. Status of Pre-PDWP Meeting --}}
5. Cost of Project:
(Rs in Million)
Source Local FPA Total FEC
GoP GoS
6. Expenditure Incurred (if any)
7. Period of Implementation
8. Plan Framework:
(i) ADP Allocation (CFY):
(ii) Sector Strategy:
(iii) Sector issues with relationship of the project:
9. Project’s Objectives and Brief Description:
@include('working-papers.partials.objectives-brief-field', [ 'v' => $v, 'textareaClass' => 'pdwpwp-textarea', 'fieldIdPrefix' => 'pdwpwp-objectives-brief', 'canEditWorkingPaperBody' => $canEditWorkingPaperBody ?? true, 'wpPreviewOnly' => $wpPreviewOnly ?? false, ])
10. Status of Pre-PDWP Meeting:
(a) Date of Pre-PDWP
(b) Date of Receipt of Modified PC-I (if required):
@php $decisionsRows = $v('decisions'); $decisionsRows = is_array($decisionsRows) ? $decisionsRows : []; if (empty($decisionsRows)) { $decisionsRows = [['decision' => '', 'compliance' => '']]; } $decisionsRows = array_values($decisionsRows); $decisionsMinRows = 1; @endphp @foreach($decisionsRows as $i => $row) @endforeach
S # Decisions Compliance
{{ $i + 1 }}
Comments of Technical Section on status of compliance
11. Result Based Monitoring (RBM) Indicators
@for ($idx = 0; $idx < $rbmCount; $idx++) @endfor
Input/
Activity
Output Outcome Targeted
Impact
Baseline Indicator Target after completion
{{ $v("rbm.$idx.input") }}
{{ $v("rbm.$idx.output") }}
{{ $v("rbm.$idx.baseline") }}
{{ $v("rbm.$idx.target") }}
{{ $v("rbm.$idx.impact") }}
12. Major Financial / Economical / Environmental Indicators:
@php $indRows = $v('indicators_rows'); $indRows = is_array($indRows) ? $indRows : []; if (empty($indRows)) { $indRows = [['bcr' => '', 'firr' => '', 'eirr' => '', 'eia' => '']]; } $indRows = array_values($indRows); $indMinRows = 1; @endphp @foreach($indRows as $i => $row) @endforeach
BCR FIRR EIRR EIA
@if ($ceHasCostBreakdown) @include('working-papers.partials.ce-project-cost-breakdown', ['ce' => $ce, 'variant' => 'pd']) @else
13. Capital Cost (Summary of the Project Cost): (Rs. In Million)
A. Capital Cost component
i
ii
Sub-Total Capital
B. Revenue Component
i
ii
Sub-Total Revenue
Total (Capital + Revenue)
@endif
14. In case of Revised Project;
(i) Comparison of cost estimates of the last sanctioned and revised project
(This information may be attached as Annexure-I)
@for ($r = 0; $r < $revisionCount; $r++) @endfor
Item # Last Sanction Project Revised Proposal Total
UnitRateTotal Work DoneTo be Done UnitRateTotal
(ii) Comments of Technical Section on reasons for revision
15. Overall Comments of Technical Section(s):
@for ($idx = 0; $idx < $overallCount; $idx++) @endfor
S. no. Comments of Technical Section Response of Sponsor Remarks
16. Conclusion / Recommendations:
@include('working-papers.partials.comments-inline', ['variant' => 'pdwp']) @include('working-papers.partials.attachments', ['variant' => 'pdwp'])
@push('scripts') @endpush