@php use App\Services\PC\PcFormPcIiiBLandingService; $pciIiiBEditGi = canField('pc-forms', 'project_brief_descriptions', 'edit'); $pciIiiBPeriodGi = old('pc_iii_b_reporting_period'); if (! is_array($pciIiiBPeriodGi)) { $pciIiiBPeriodGi = $pcForm?->pc_iii_b_reporting_period ?? ($pciCrudDraftFill['pc_iii_b_reporting_period'] ?? []); if (! is_array($pciIiiBPeriodGi)) { $pciIiiBPeriodGi = []; } } $pciIiiBYearOptions = app(PcFormPcIiiBLandingService::class)->announceBudgetCalendarYearOptions(); if ($pciIiiBYearOptions === []) { $pciIiiBYearOptions = [(int) date('Y')]; } $pciIiiBCurrentYear = (int) ($pciIiiBYearOptions[0] ?? date('Y')); $pciIiiBSelectedYear = (int) ($pciIiiBPeriodGi['year'] ?? $pciIiiBCurrentYear); if (! in_array($pciIiiBSelectedYear, $pciIiiBYearOptions, true)) { $pciIiiBSelectedYear = $pciIiiBCurrentYear; } $pciIiiBMonths = ['January','February','March','April','May','June','July','August','September','October','November','December']; $pciIiiBSubmittedMonths = []; $pciIiiBProjectForMonths = (int) ($pcForm?->project_id ?? $pciSeedProjectId ?: 0); if ($pciIiiBProjectForMonths > 0) { $pciIiiBSubmittedMonths = app(\App\Services\PC\PcFormService::class) ->pcIiiBSubmittedMonthsForProject( $pciIiiBProjectForMonths, $pciIiiBSelectedYear, $pcForm?->id ? (int) $pcForm->id : null ); } $pciIiiBSelectedMonth = (string) ($pciIiiBPeriodGi['month'] ?? ''); $pciIiiBAdminDept = trim((string) ($pciIiiBPeriodGi['administrative_department'] ?? '')); if ($pciIiiBAdminDept === '' || $pciIiiBAdminDept === '—') { $seedPid = (int) ($pcForm?->project_id ?? $pciSeedProjectId ?: 0); $seedDetails = $initialProjectDetails ?? ($projects ?? []); if ($seedPid > 0 && is_array($seedDetails)) { $seedDetail = $seedDetails[$seedPid] ?? $seedDetails[(string) $seedPid] ?? null; if (is_array($seedDetail)) { $fromScheme = trim((string) ($seedDetail['administrative_department'] ?? '')); if ($fromScheme === '' || $fromScheme === '—') { // Fallback: department name if exposed separately $fromScheme = trim((string) ($seedDetail['department_name'] ?? $seedDetail['department'] ?? '')); } if ($fromScheme !== '' && $fromScheme !== '—') { $pciIiiBAdminDept = $fromScheme; } } } } $pciIiiBExecAgency = trim((string) ($pciIiiBPeriodGi['executing_agency'] ?? '')); $pciIiiBAgencyOptions = app(PcFormPcIiiBLandingService::class)->executingAgencyOptions(); if ($pciIiiBExecAgency !== '' && ! array_key_exists($pciIiiBExecAgency, $pciIiiBAgencyOptions)) { $pciIiiBAgencyOptions = [$pciIiiBExecAgency => $pciIiiBExecAgency] + $pciIiiBAgencyOptions; } @endphp @once @push('stylesheets') @endpush @endonce
Reporting period
@if(! $pciIiiBEditGi && $pciIiiBSelectedMonth !== '') @endif Only months without a submitted MPR for the selected year are enabled. Previous calendar month must already be submitted (except the scheme’s first MPR).
@if(! $pciIiiBEditGi) @endif
Department & executing agency
Filled from the scheme’s department.
@if(! $pciIiiBEditGi && $pciIiiBExecAgency !== '') @endif Select an existing agency or type a new name to save it for future use.
@once @push('scripts') @endpush @endonce