@extends('layouts.app') @section('title', $pageTitle ?? __('Manual ADP Import')) @section('contents')
@if (session('status'))
{{ session('status') }}
@endif @if (session('warning'))
{{ session('warning') }}
@endif

{{ __('Manual ADP / Financial Year Import') }}

{{ __('Temporary tool for super admins. Upload the filled export workbook (.xlsx) or CSV to set ADP No. and Financial Year on') }} mec_reports, {{ __('report payload (cover / Part A), and saved publish letter HTML for reports whose visit plan is before FY July 2026–June 2027. Re-importing updates rows that already have ADP/FY. Reports on or after that FY are skipped (BMS snapshot).') }}

{{ __('Required columns (row 1):') }} Report ID, ADP No. (fill), Financial Year (fill). {{ __('Export a fresh list with') }} php artisan mec-reports:export-manual-adp-list --pending-only.

@csrf
@error('file')

{{ $message }}

@enderror
@if ($diagnosis) @php $summary = $diagnosis['summary'] ?? ['total' => 0, 'ready' => 0, 'skipped' => 0, 'errors' => 0]; $rows = $diagnosis['rows'] ?? []; @endphp

{{ __('Diagnosis') }}

{{ __(':ready ready · :skipped skipped · :errors errors · :total rows', [ 'ready' => $summary['ready'], 'skipped' => $summary['skipped'], 'errors' => $summary['errors'], 'total' => $summary['total'], ]) }}
@forelse ($rows as $row) @php $status = $row['status'] ?? 'error'; $badge = match ($status) { 'ready' => 'success', 'skipped' => 'secondary', default => 'danger', }; @endphp @empty @endforelse
{{ __('Row') }} {{ __('Report ID') }} {{ __('ADP (file)') }} {{ __('FY (file)') }} {{ __('Status') }} {{ __('Message') }}
{{ $row['excel_row'] ?? '' }} {{ $row['report_id'] ?? '' }} {{ $row['adp_raw'] ?? '' }} {{ $row['financial_year_raw'] ?? '' }} {{ $status }} {{ $row['message'] ?? '' }}
{{ __('No data rows in file.') }}
@if (($summary['ready'] ?? 0) > 0) @endif
@endif @if (! empty(session('import_apply_errors')))

{{ __('Apply errors') }}

    @foreach (session('import_apply_errors') as $line)
  • {{ $line }}
  • @endforeach
@endif
@endsection