@php($months = __('smgv.monthsShort'))
@if ($flash)
{{ $flash }}
@endif @if ($error)@endif
{{ __('smgv.history.scope') }}

{{ __('smgv.import.upload') }}

@error('file')

{{ $message }}

@enderror

{{ __('smgv.history.uploadHint') }}

{{ __('smgv.import.history') }}

@if ($history->isEmpty())

{{ __('smgv.none') }}

@else
@foreach ($history as $b) @endforeach
{{ $b->original_name }}
#{{ $b->id }} · {{ substr($b->sha256, 0, 12) }}… · {{ $b->pages }} {{ __('smgv.import.pages') }}@if ($b->employees) · {{ $b->employees }} {{ __('smgv.employees') }}@endif
{{ __('smgv.history.status.'.$b->status) }}
{{ $b->committed_at?->format('d.m.Y H:i') ?? $b->created_at?->format('d.m.Y H:i') }}
@endif
@if ($batch && $batch->kind === 'historical_full' && $plan) @php($passed = collect($recon)->sum('passed')) @php($checks = collect($recon)->sum('checks')) @php($disc = collect($recon)->sum(fn ($r) => count($r['discrepancies'] ?? []))) @php($firstM = collect($plan)->pluck('first_month')->filter()->min()) @php($lastM = collect($plan)->pluck('last_month')->filter()->max())
{{ __('smgv.history.source') }}
{{ substr($batch->sha256, 0, 16) }}…
{{ $batch->pages }} {{ __('smgv.import.pages') }}
{{ __('smgv.employees') }}
{{ $stats['employees'] ?? count($plan) }}
{{ __('smgv.year') }} {{ $stats['year'] ?? '—' }} · {{ $firstM ? $months[$firstM] : '—' }}–{{ $lastM ? $months[$lastM] : '—' }}
{{ __('smgv.history.records') }}
{{ __('smgv.history.daily') }} {{ $stats['daily_records'] ?? 0 }} · {{ __('smgv.history.weekly') }} {{ $stats['weekly_records'] ?? 0 }}
{{ __('smgv.history.monthly') }} {{ $stats['monthly_records'] ?? 0 }} · {{ __('smgv.history.annual') }} {{ $stats['annual_records'] ?? 0 }}
{{ __('smgv.history.reconciliation') }}
{{ $passed }}/{{ $checks }}
{{ __('smgv.history.discrepancies', ['count' => $disc]) }}
{{ __('smgv.status') }}
{{ __('smgv.history.status.'.$batch->status) }}
{{ $batch->committed_at?->format('d.m.Y H:i') }}

{{ __('smgv.history.employeesTitle') }}

{{ __('smgv.history.accountsNote') }}
@if ($batch->status === 'parsed')@endif @foreach ($plan as $i => $p) @php($r = $recon[$i] ?? []) @if ($batch->status === 'parsed')@endif @if ($detail === $i) @endif @endforeach
{{ __('smgv.import.apply') }}{{ __('smgv.employee') }} (PDF){{ __('smgv.history.nameOrder') }}{{ __('smgv.security.username') }} {{ __('smgv.history.firstLast') }}{{ __('smgv.history.access') }}{{ __('smgv.history.checks') }}{{ __('smgv.history.missing') }}
{{ $p['display'] }}
{{ $p['printed_name'] }} · {{ __('smgv.import.pages') }} {{ $p['pages'][0] }}–{{ $p['pages'][1] }}
@if ($batch->status === 'parsed') @else {{ __('smgv.history.orders.'.str_replace(':', '', $p['order'])) }}@endif {{ $p['username'] }}@if ($p['existing_user_id'])
{{ __('smgv.history.existing') }}
@endif
{{ $p['first_month'] ? $months[$p['first_month']] : '—' }} – {{ $p['last_month'] ? $months[$p['last_month']] : '—' }} {{ __('smgv.history.accessStates.'.$p['access']) }}
{{ $p['entry_date'] ? \Carbon\Carbon::parse($p['entry_date'])->format('d.m.Y') : '—' }} – {{ $p['exit_date'] ? \Carbon\Carbon::parse($p['exit_date'])->format('d.m.Y') : '—' }}
count($r['discrepancies'] ?? []) > 0])>{{ $r['passed'] ?? 0 }}/{{ $r['checks'] ?? 0 }} @if (isset($r['calculated']))
{{ __('smgv.history.calcDiff', ['count' => $r['calculated']['differences']]) }}
@endif
{{ collect($p['missing_fields'])->map(fn ($f) => __('smgv.history.fields.'.$f))->implode(', ') ?: '—' }}
@forelse ($r['discrepancies'] ?? [] as $d)
{{ $d['check'] }} · {{ isset($d['month']) ? $months[$d['month']] : '' }}{{ isset($d['day']) ? ' '.$d['day'].'.' : '' }}{{ isset($d['week']) ? ' KW '.$d['week'] : '' }} · {{ __('smgv.history.expected') }} {{ $d['expected'] ?? '' }} · {{ __('smgv.history.reported') }} {{ $d['reported'] ?? '' }}{{ isset($d['page']) ? ' · S. '.$d['page'] : '' }}
@empty
{{ __('smgv.history.noDiscrepancies') }}
@endforelse @foreach (collect($r['info'] ?? [])->groupBy('kind') as $kind => $items)
{{ __('smgv.history.info.'.$kind) }}: {{ $items->count() }}
@endforeach @foreach ($r['calculated']['rows'] ?? [] as $c)
{{ $months[$c['month']] }} · {{ $c['value'] }}: {{ __('smgv.history.calculated') }} {{ $c['calculated'] }} / {{ __('smgv.history.reported') }} {{ $c['reported'] }} ({{ __('smgv.history.info.'.$c['kind']) }})
@endforeach
@if ($batch->status === 'parsed')
@endif
@if ($result || ($mapping['written'] ?? null)) @php($res = $result ?? $mapping)

{{ __('smgv.history.resultTitle') }}

@foreach ($res['written'] ?? [] as $k => $v){{ __('smgv.history.written.'.$k) }}: {{ $v }}@if (! $loop->last) · @endif @endforeach

@forelse ($res['conflicts'] ?? [] as $c)
{{ $c['employee'] ?? '' }} · {{ $c['code'] }}{{ isset($c['date']) ? ' · '.$c['date'] : '' }}
@empty

{{ __('smgv.history.noConflicts') }}

@endforelse
@endif @elseif ($batch)

{{ __('smgv.history.legacyBatch') }}

@endif