@extends('layouts.app') @section('title', __('Перенос данных ученика')) {{-- StudentRemovalController::transferForm() — the "two rows, one person" fix. First half picks the receiving student (search via /search_students.php, the same endpoint every other student picker on the site uses); once one is in the URL as target_id the second half shows StudentRecordsService::transferPlan() and the confirmation fields. Nothing is written until the POST, which re-checks the acknowledgement box and the typed surname server-side — the disabled submit button here is only a convenience. --}} @section('content')

{{ __('Перенос данных ученика') }}

{{ __('Все записи ученика') }} {{ $studentName }} {{ __('— платежи, начисления, посещаемость, группы, результаты, игровой профиль — будут перенесены другому ученику. Используйте это, когда один и тот же человек заведён дважды.') }}

{{-- Step 1: pick the receiving student --}}
{{ __('1. Кому перенести') }}
@if ($target)
{{ __('Получатель:') }} {{ $targetName }} (ID {{ $target->id }}@if ($target->class_name), {{ $target->class_name }}@endif @if ($target->status_name), {{ $target->status_name }}@endif) {{ __('открыть профиль') }}
{{ __('Выбрать другого') }}
@else
{{ __('Сам ученик (:studentname) в списке не показывается.', ['studentname' => $studentName]) }}
@endif
@if ($target) {{-- Step 2: what moves --}}
{{ __('2. Что будет перенесено') }}
@if ($plan === [])
{{ __('За учеником нет ни одной записи — переносить нечего. Его можно просто удалить со страницы профиля.') }}
@else
@foreach ($plan as $row) @endforeach
{{ __('Данные') }} {{ __('Будет перенесено') }} {{ __('Пропущено') }} {{ __('Сумма') }}
{{ $row['label'] }} @if ($row['note'])
{{ $row['note'] }}
@endif
{{ $row['count'] - $row['skipped'] }} {{ $row['skipped'] > 0 ? $row['skipped'] : '—' }} @if ($row['amount'] !== null) {{ number_format($row['amount'], 0, ',', ' ') }} ₸ @else — @endif
{{ __('Итого') }} {{ collect($plan)->sum('count') - collect($plan)->sum('skipped') }} {{ collect($plan)->sum('skipped') ?: '—' }}
@endif
{{-- Step 3: confirm --}}
@csrf
{{ __('3. Подтверждение') }}
{{ __('Перенос необратим: записи нельзя будет автоматически вернуть обратно. Пропущенные дубликаты (если есть) будут удалены — у получателя останется его версия.') }}
{{ __('Снимите флажок, если пустую карточку нужно оставить.') }}
{{ __('Отмена') }}
@else {{ __('Отмена') }} @endif
@endsection @push('scripts') @endpush