@php $pciIiiBEdit = canField('pc-forms', 'project_brief_descriptions', 'edit'); $pciIiiBSrc = $pcForm ?? null; $pciIiiBFill = $pciCrudDraftFill ?? []; $pciIiiBVal = function (string $key, $default = '') use ($pciIiiBSrc, $pciIiiBFill) { $old = old($key); if ($old !== null) { return $old; } if ($pciIiiBSrc && isset($pciIiiBSrc->{$key})) { return $pciIiiBSrc->{$key}; } return $pciIiiBFill[$key] ?? $default; }; $pciIiiBFinancial = old('pc_iii_b_financial_status'); $pciIiiBFinHadOld = is_array($pciIiiBFinancial); if (! is_array($pciIiiBFinancial)) { $pciIiiBFinancial = $pciIiiBSrc?->pc_iii_b_financial_status ?? ($pciIiiBFill['pc_iii_b_financial_status'] ?? []); if (! is_array($pciIiiBFinancial)) { $pciIiiBFinancial = []; } } $pciIiiBFinBpmsKeys = [ 'approved_cost', 'expenditure_last_fy', 'adp_allocations_current_year', 'fpa', 'total_release_current_year', 'total_expenditure_current_year', ]; $pciIiiBFinFromBpms = []; $pciIiiBFinBpmsYearLabel = ''; $pciIiiBProjectForFin = (int) ($pciIiiBSrc?->project_id ?? ($pciSeedProjectId ?? 0) ?: 0); if ($pciIiiBProjectForFin > 0 && ! $pciIiiBFinHadOld) { $pciIiiBBpmsFin = app(\App\Services\PC\PcFormPcIiiBLandingService::class) ->bpmsFinancialStatusForProject($pciIiiBProjectForFin); $pciIiiBFinBpmsYearLabel = (string) ($pciIiiBBpmsFin['meta']['current_year_label'] ?? ''); foreach ($pciIiiBFinBpmsKeys as $finKey) { $bpmsRow = is_array($pciIiiBBpmsFin[$finKey] ?? null) ? $pciIiiBBpmsFin[$finKey] : []; $pciIiiBFinancial[$finKey] = [ 'capital' => (float) ($bpmsRow['capital'] ?? 0), 'revenue' => (float) ($bpmsRow['revenue'] ?? 0), ]; $pciIiiBFinFromBpms[$finKey] = true; } } elseif ($pciIiiBProjectForFin > 0) { $pciIiiBFinBpmsYearLabel = (string) (app(\App\Services\PC\PcFormPcIiiBLandingService::class) ->lastLockedAnnounceBudget()['year'] ?? ''); foreach ($pciIiiBFinBpmsKeys as $finKey) { $pciIiiBFinFromBpms[$finKey] = true; } } $pciIiiBPhysicalRaw = old('pc_iii_b_physical_status'); if (! is_array($pciIiiBPhysicalRaw)) { $pciIiiBPhysicalRaw = $pciIiiBSrc?->pc_iii_b_physical_status ?? ($pciIiiBFill['pc_iii_b_physical_status'] ?? []); if (! is_array($pciIiiBPhysicalRaw)) { $pciIiiBPhysicalRaw = []; } } $pciIiiBPeriodForPhys = old('pc_iii_b_reporting_period'); if (! is_array($pciIiiBPeriodForPhys)) { $pciIiiBPeriodForPhys = $pciIiiBSrc?->pc_iii_b_reporting_period ?? ($pciIiiBFill['pc_iii_b_reporting_period'] ?? []); if (! is_array($pciIiiBPeriodForPhys)) { $pciIiiBPeriodForPhys = []; } } $pciIiiBLocBlocksForPhys = app(\App\Services\PC\PcFormPcIiiBLandingService::class) ->normalizeDistrictsPayload($pciIiiBPeriodForPhys['districts'] ?? []); $pciIiiBPhysicalSections = app(\App\Services\PC\PcFormService::class) ->mergePcIiiBPhysicalSectionsFromLocation($pciIiiBLocBlocksForPhys, $pciIiiBPhysicalRaw); $pciIiiBPhysicalRows = $pciIiiBPhysicalSections; $pciIiiBBottlenecks = old('pc_iii_b_bottlenecks'); if (! is_array($pciIiiBBottlenecks)) { $pciIiiBBottlenecks = $pciIiiBSrc?->pc_iii_b_bottlenecks ?? ($pciIiiBFill['pc_iii_b_bottlenecks'] ?? []); if (! is_array($pciIiiBBottlenecks)) { $pciIiiBBottlenecks = []; } } $pciIiiBSelectedBn = $pciIiiBBottlenecks['selected'] ?? []; if (! is_array($pciIiiBSelectedBn)) { $pciIiiBSelectedBn = []; } $pciIiiBOutputRows = old('pc_iii_b_output_indicators'); if (! is_array($pciIiiBOutputRows)) { $pciIiiBOutputRows = $pciIiiBSrc?->pc_iii_b_output_indicators ?? ($pciIiiBFill['pc_iii_b_output_indicators'] ?? []); if (! is_array($pciIiiBOutputRows)) { $pciIiiBOutputRows = []; } } $pciIiiRichSvc = app(\App\Services\PC\PcFormService::class); $pciIiiBUnexpectedProblemsVal = old('pc_iii_b_bottlenecks.unexpected_problems'); if ($pciIiiBUnexpectedProblemsVal === null) { $pciIiiBUnexpectedProblemsVal = $pciIiiRichSvc->extractPcIiiRichTextContent($pciIiiBBottlenecks['unexpected_problems'] ?? null); } $pciIiiBPeriod = old('pc_iii_b_reporting_period'); if (! is_array($pciIiiBPeriod)) { $pciIiiBPeriod = $pciIiiBSrc?->pc_iii_b_reporting_period ?? ($pciIiiBFill['pc_iii_b_reporting_period'] ?? []); if (! is_array($pciIiiBPeriod)) { $pciIiiBPeriod = []; } } $pciIiiBBase = (int) ($pciIiiBStartStep ?? $pciWizardStep); @endphp {{-- Step 2: Location (display-only from Scheme/Project) --}}
@include('pc-forms.partials.pci-location-pc-iii-b-fields')
{{-- Step 3: Monthly Financial Status --}}
@include('pc-forms.partials.pc-iii-b-financial')
@include('pc-forms.partials.pc-iii-b-physical') @include('pc-forms.partials.pc-iii-b-output') {{-- Step 6: Implementation Bottlenecks --}}

Select all applicable issues that caused delays or problems this month.

@include('pc-forms.partials.pc-iii-b-bottlenecks-checklist')
@include('pc-forms.partials.pci-pc-iii-rich-text-block', [ 'fieldName' => 'pc_iii_b_bottlenecks[unexpected_problems]', 'value' => $pciIiiBUnexpectedProblemsVal, 'filesEdit' => $pciIiiBEdit, 'attFieldName' => 'pc_iii_b_bottlenecks_unexpected_problems_attachments[]', 'annFieldName' => 'pc_iii_b_bottlenecks_unexpected_problems_annexures[]', 'uid' => 'pci-pc-iii-b-bn-unexpected', 'existingAttachmentsMap' => $existingAttachmentsMap ?? [], 'pcForm' => $pcForm ?? null, 'placeholder' => 'Elaborate on specific bottlenecks or unexpected issues...', 'rows' => 4, 'readonly' => ! $pciIiiBEdit, ])
@include('pc-forms.partials.pc-iii-b-attachments') @include('pc-forms.partials.pc-iii-b-report-submission')