@extends('layouts.app') @php use App\Support\MecReportType; $reportType = $reportType ?? request()->query('report_type'); $reportWizardPlanType = $reportWizardPlanType ?? ''; $mecSidWizard = isset($mecSectorId) ? (int) $mecSectorId : null; $rtNorm = MecReportType::normalize((string) $reportType); $isErpEvaluationReport = strtoupper(trim((string) $reportWizardPlanType)) === 'ERP' && MecReportType::isSerIerTpr((string) $reportType); $isDrpDrrReport = strtoupper(trim((string) $reportWizardPlanType)) === 'DRP' && MecReportType::isDrr((string) $reportType); $isSar = MecReportType::isSar((string) $reportType); $isSocialPlanStyle = MecReportType::isRmrOrCmr((string) $reportType) ? false : MecReportType::usesSocialSectorSheetLayout((string) $reportType, $mecSidWizard); $isProductionSectorTheme = MecReportType::isRmrOrCmr((string) $reportType) ? false : (MecReportType::usesProductionSectorSheetLayout((string) $reportType, $mecSidWizard) && ! MecReportType::isDrr((string) $reportType)); $isPmrWizard = MecReportType::isPmr((string) $reportType); $isRmrOrCmrWizard = MecReportType::isRmrOrCmr((string) $reportType); $partBWizardSections = ($isRmrOrCmrWizard || $isPmrWizard) ? MecReportType::partBWizardSections((string) $reportType, $mecSidWizard) : []; // DRP desk review (DRR) uses its own wizard — exclude from RMR-line panel set. $rmrLineReportTypes = MecReportType::rmrLineWizardReportTypes(); // Logical panel ids (content); inclusion is conditional per report type. // CMR includes Part F (panel 6); RMR-line reports skip it. Social/Production RMR: RMR-line + Part B revenue. // ERP evaluation (SER / IER / TPR): single fixed profile step only. $wizardPanels = $isErpEvaluationReport ? [1] : ($isDrpDrrReport ? [1, 2, 3] : ($isSar ? [1, 2, 3, 4] : match (true) { MecReportType::isCmr((string) $reportType) => [1, 2, 3, 4, 5, 6, 7], $isPmrWizard => [1, 2, 3, 4, 5, 7], in_array($rtNorm, $rmrLineReportTypes, true) => [1, 2, 3, 4, 5, 7], default => [1, 2, 3, 4, 5, 6, 7], })); // Titles only — Part letters (A, B, C, …) are assigned by visible order in $wizardPanels (no gaps). $reportWizardStepMeta = $isErpEvaluationReport ? [1 => ['title' => 'EVALUATION REPORT PROFILE']] : ($isDrpDrrReport ? [ 1 => ['title' => __('PROJECT PROFILE')], 2 => ['title' => __('PROJECT PROGRESS')], 3 => ['title' => __('DESK REVIEW ANALYSIS/ASSESSMENTS')], ] : ($isSar ? [ 1 => ['title' => 'PROJECT PROFILE'], 2 => ['title' => 'PROJECT PROGRESS'], 3 => ['title' => 'MONITORING ANALYSIS'], 4 => ['title' => 'PICTORIAL OBSERVATIONS'], ] : ($isPmrWizard ? [ 1 => ['title' => 'PROJECT PROFILE'], 2 => ['title' => 'SCHEME ANALYSIS'], 3 => ['title' => 'PROJECT QUALITY MANAGEMENT'], 4 => ['title' => 'PROJECT DOCUMENTS'], 5 => ['title' => 'PROJECT HEALTH ANALYSIS'], 7 => ['title' => 'PICTORIAL/GIS OBSERVATIONS / EVIDENCE'], ] : [ 1 => ['title' => 'SCHEME PROFILE'], 2 => ['title' => 'SCHEME ANALYSIS'], 3 => ['title' => 'QUALITY MANAGEMENT'], 4 => ['title' => 'DOCUMENTS'], 5 => ['title' => 'MONITORING ANALYSIS/ASSESSMENTS'], 6 => ['title' => 'COMPLIANCE OBSERVATIONS'], 7 => ['title' => 'PICTORIAL OBSERVATIONS'], ]))); $pageTitle = $reportWizardPageTitle ?? 'Generate Report'; if ($isErpEvaluationReport) { $pageTitle = match ($rtNorm) { MecReportType::SER => 'Summative Evaluation Report (SER)', MecReportType::IER => 'Impact Evaluation Report (IER)', MecReportType::TPR => 'Third Party Validation Report (TPR)', default => 'Evaluation report', }; } elseif ($isDrpDrrReport) { $pageTitle = __('Desk Review Report (DRR)'); } elseif ($isPmrWizard) { $pageTitle = __('Project Monitoring Report (PMR)'); } @endphp @prepend('scripts') @endprepend @section('title', $pageTitle) @push('stylesheets') @endpush @push('stylesheets') @endpush @section('contents')
@if ($errors->any() && empty($mecReportWorkflowMode ?? null)) @endif @if (! empty($mecReportWorkflowId))
@endif @if (! empty($mecReportWorkflowMode ?? null))
@if (in_array($mecReportWorkflowMode, ['rd', 'sdm', 'dg'], true)) {{ __('Workflow review') }}. @if ($mecReportWorkflowMode === 'rd') @if (! empty($mecReportWorkflowReturnRemarks ?? '')) @endif @if ($isSar) {{ __('Only the RD sections in Part C (observations and final assessment) are editable. On the last step, Forward to SDM saves your comments and sends the report to SDM. Use Decline to send the report back to the monitoring officer—you must enter a reason.') }} @else {{ __('Only the RD sections in Part E (risk matrix and final assessment) are editable. On the last step, Forward to SDM saves your comments and sends the report to SDM. Use Decline to send the report back to the monitoring officer—you must enter a reason.') }} @endif @elseif ($mecReportWorkflowMode === 'sdm') @if (! empty($mecReportWorkflowReturnRemarks ?? '')) @endif @if ($isSar) {{ __('Short Assessment Reports have no SDM assessment fields. Review all parts (Part C is read-only for SDM). On the last step, Forward to DG sends the report to the DG. Use Decline to return the report to the Regional Director—you must enter a reason.') }} @elseif (! empty($mecReportWorkflowFinalizesAtSdm)) {{ __('Only the SDM sections in Part E (risk matrix and final assessment) are editable. On the last step, Approve saves your comments and publishes the report. Use Decline to return the report to the Regional Director—you must enter a reason.') }} @else {{ __('Only the SDM sections in Part E (risk matrix and final assessment) are editable. On the last step, Forward to DG saves your comments and sends the report to DG. Use Decline to return the report to the Regional Director—you must enter a reason.') }} @endif @else {{ __('All sections are read-only. On the last step, Approve opens a final assessment choice (Satisfactory or Un-Satisfactory), then publishes the report to Published reports. Use Decline to return the report to the SDM for revision—you must enter a reason.') }} @endif @elseif ($mecReportWorkflowMode === 'meo_resubmit') {{ __('Report declined') }}. @if (! empty($mecReportWorkflowDeclineRemarks ?? '')) {{ __('Reason') }}: {{ $mecReportWorkflowDeclineRemarks }} @endif {{ __('Revise the report as needed, then resubmit for review.') }} @elseif ($mecReportWorkflowMode === 'initiator_resubmit') {{ __('Report returned for revision') }}. @if (! empty($mecReportWorkflowReturnRemarks ?? '')) {{ __('Returned by :role', ['role' => $mecReportWorkflowReturnedByLabel ?: __('Reviewer')]) }}: {{ $mecReportWorkflowReturnRemarks }} @endif {{ __('Revise the report as needed, then resubmit for review.') }} @endif
@elseif (! empty($mecReportAuthorOfficerKey ?? null) && in_array($mecReportAuthorOfficerKey, ['rd', 'sdm'], true)) @elseif (!empty($reportWizardSuppressPcProjectPrefill))
Draft. This form is restored from your saved draft. Scheme identity fields from PC-I stay locked; other sections use your saved values.
@endif @if (! empty($reportWizardAllowSectorEdit)) @include('reports.partials.wizard-sector-setup') @endif
@endsection @push('scripts') @endpush