@php $pciIiiAEdit = canField('pc-forms', 'project_brief_descriptions', 'edit'); $pciIiiRichSvc = app(\App\Services\PC\PcFormService::class); $pciIiiASrc = $pcForm ?? null; $pciIiiAFill = $pciCrudDraftFill ?? []; $pciIiiAVal = function (string $key, $default = '') use ($pciIiiASrc, $pciIiiAFill) { $old = old($key); if ($old !== null) { return $old; } if ($pciIiiASrc && isset($pciIiiASrc->{$key})) { return $pciIiiASrc->{$key}; } return $pciIiiAFill[$key] ?? $default; }; $pciIiiAAnnualRows = old('pc_iii_a_annual_work_plan'); if (! is_array($pciIiiAAnnualRows)) { $pciIiiAAnnualRows = $pciIiiASrc?->pc_iii_a_annual_work_plan ?? ($pciIiiAFill['pc_iii_a_annual_work_plan'] ?? []); if (! is_array($pciIiiAAnnualRows)) { $pciIiiAAnnualRows = []; } } if (count($pciIiiAAnnualRows) < 1) { $pciIiiAAnnualRows = [['item' => '', 'unit' => '', 'quantities' => '', 'achievements' => '', 'target' => '']]; } $pciIiiAQuarterlyRows = old('pc_iii_a_quarterly_work_plan'); if (! is_array($pciIiiAQuarterlyRows)) { $pciIiiAQuarterlyRows = $pciIiiASrc?->pc_iii_a_quarterly_work_plan ?? ($pciIiiAFill['pc_iii_a_quarterly_work_plan'] ?? []); if (! is_array($pciIiiAQuarterlyRows)) { $pciIiiAQuarterlyRows = []; } } if (count($pciIiiAQuarterlyRows) < 1) { $pciIiiAQuarterlyRows = [['item' => '', 'unit' => '', 'q1' => '', 'q2' => '', 'q3' => '', 'q4' => '']]; } $pciIiiACashPlan = old('pc_iii_a_cash_plan'); if (! is_array($pciIiiACashPlan)) { $pciIiiACashPlan = $pciIiiASrc?->pc_iii_a_cash_plan ?? ($pciIiiAFill['pc_iii_a_cash_plan'] ?? []); if (! is_array($pciIiiACashPlan)) { $pciIiiACashPlan = []; } } $pciIiiADisplayAmt = fn (mixed $raw): string => $pciIiiRichSvc->formatPcIiiMillionForFormDisplay($raw, $pciIiiAEdit); $pciIiiADisplayQty = fn (mixed $raw): string => $pciIiiRichSvc->formatPcIiiQtyForFormDisplay($raw, $pciIiiAEdit); $pciIiiACashPlanSum = 0.0; foreach (['q1', 'q2', 'q3', 'q4'] as $pciCashKey) { $pciCashVal = $pciIiiACashPlan[$pciCashKey] ?? ''; if ($pciCashVal !== '' && $pciCashVal !== null) { $plain = \App\Helpers\PC\AmountMillionHelper::normalizePlanProvisionAmountInput($pciCashVal); if ($plain !== null && is_numeric($plain)) { $pciIiiACashPlanSum += (float) $plain; } } } $pciIiiACashPlanTotal = $pciIiiADisplayAmt($pciIiiACashPlanSum > 0 ? (string) $pciIiiACashPlanSum : '0'); $pciIiiAOutputRows = old('pc_iii_a_output_indicators_rows'); if (! is_array($pciIiiAOutputRows)) { $pciIiiAOutputRows = $pciIiiASrc?->pc_iii_a_output_indicators_rows ?? ($pciIiiAFill['pc_iii_a_output_indicators_rows'] ?? []); if (! is_array($pciIiiAOutputRows)) { $pciIiiAOutputRows = []; } } if (count($pciIiiAOutputRows) < 1) { $pciIiiAOutputRows = [['indicator' => '', 'unit' => '', 'baseline' => '', 'target' => '']]; } $pciIiiAConsultantRows = old('pc_iii_a_consultant_contractors'); if (! is_array($pciIiiAConsultantRows)) { $pciIiiAConsultantRows = $pciIiiASrc?->pc_iii_a_consultant_contractors ?? ($pciIiiAFill['pc_iii_a_consultant_contractors'] ?? []); if (! is_array($pciIiiAConsultantRows)) { $pciIiiAConsultantRows = []; } } $pciIiiAConsultantRows = array_values($pciIiiAConsultantRows); $pciIiiAExecutingOfficerRows = old('pc_iii_a_executing_officers'); if (! is_array($pciIiiAExecutingOfficerRows)) { $pciIiiAExecutingOfficerRows = $pciIiiASrc?->pc_iii_a_executing_officers ?? ($pciIiiAFill['pc_iii_a_executing_officers'] ?? []); if (! is_array($pciIiiAExecutingOfficerRows)) { $pciIiiAExecutingOfficerRows = []; } } $pciIiiAExecutingOfficerRows = array_values($pciIiiAExecutingOfficerRows); if (count($pciIiiAExecutingOfficerRows) < 1) { $pciIiiAExecutingOfficerRows = [['name' => '', 'designation' => '', 'bps' => '', 'contact' => '', 'email' => '', 'charge_type' => '', 'date_of_posting' => '', 'relieved_date' => '', 'remarks' => '']]; } $pciIiiAMon = old('pc_iii_a_monitoring_evaluation'); if (! is_array($pciIiiAMon)) { $pciIiiAMon = $pciIiiASrc?->pc_iii_a_monitoring_evaluation ?? ($pciIiiAFill['pc_iii_a_monitoring_evaluation'] ?? []); if (! is_array($pciIiiAMon)) { $pciIiiAMon = []; } } $pciIiiAPlanRemarks = old('pc_iii_a_plan_remarks'); if (! is_array($pciIiiAPlanRemarks)) { $pciIiiAPlanRemarks = $pciIiiASrc?->pc_iii_a_plan_remarks ?? ($pciIiiAFill['pc_iii_a_plan_remarks'] ?? []); if (! is_array($pciIiiAPlanRemarks)) { $pciIiiAPlanRemarks = []; } } $pciIiiABase = (int) ($pciIiiAStartStep ?? $pciWizardStep); $pciIiiARichVal = function (string $key, $default = '') use ($pciIiiASrc, $pciIiiAFill, $pciIiiRichSvc) { $old = old($key); if ($old !== null) { return $old; } $raw = null; if ($pciIiiASrc && isset($pciIiiASrc->{$key})) { $raw = $pciIiiASrc->{$key}; } else { $raw = $pciIiiAFill[$key] ?? $default; } return $pciIiiRichSvc->extractPcIiiRichTextContent($raw); }; @endphp @once @push('stylesheets') @endpush @endonce {{-- Step 2: Location (display-only from Scheme/Project) --}}
@include('pc-forms.partials.pci-location-readonly-fields')
{{-- Step 3: Financial Position & PSDP (see pc-iii-a-financial.blade.php) --}} @include('pc-forms.partials.pc-iii-a-financial') {{-- Step 4: Revision History --}} @include('pc-forms.partials.pc-iii-a-revision-history') {{-- Step 5: Annual & Quarterly Work Plans --}}
@if($pciIiiAEdit)
@endif
@if($pciIiiAEdit)@endif @foreach($pciIiiAAnnualRows as $ai => $aRow) @if($pciIiiAEdit) @endif @endforeach
S.# Item / Component Unit As per PC-I Achievements upto last year Target current year
Quantities Quantities Quantities
{{ $ai + 1 }}

Based on Annual Work Plan

@if($pciIiiAEdit)
@endif
@if($pciIiiAEdit)@endif @foreach($pciIiiAQuarterlyRows as $qi => $qRow) @if($pciIiiAEdit) @endif @endforeach
S.# Item / Component Unit Quarter 1 Quarter 2 Quarter 3 Quarter 4
Target Target Target Target
{{ $qi + 1 }}
{{-- Step 6: Quarterly Cash Plan --}}

Indicate the finances required to achieve the quarterly work plan targets (Rs Millions).

@foreach(['q1', 'q2', 'q3', 'q4'] as $cq) @endforeach
Quarter 1 (Rs. in Million) Quarter 2 (Rs. in Million) Quarter 3 (Rs. in Million) Quarter 4 (Rs. in Million) Total (Rs. in Million)
{{-- Step 7: Output Indicators --}}

To be determined by project director on the basis of indicators given in the PC-I. Indicate quantifiable outcome of the projects for the current year.

@if($pciIiiAEdit)
@endif
@if($pciIiiAEdit)@endif @foreach($pciIiiAOutputRows as $oi => $oRow) @if($pciIiiAEdit) @endif @endforeach
S.# Output Indicator Unit Baseline Target
{{ $oi + 1 }}
@include('pc-forms.partials.pc-iii-a-consultant-contractor') @include('pc-forms.partials.pc-iii-a-executing-officer') {{-- Step 10: Adaptation & Mitigation Review --}}

Monitoring and Evaluation of Adaptation and Mitigation Options