@extends('layouts.app') @section('title', __('Начисления')) {{-- Ports app/Views/payment/charges.php (legacy, 247 lines) — see the Phase 15 plan. Read-only, no forms need CSRF (both tabs are GET filter forms). The predict tab's simulation never writes to the DB, matching the legacy explanatory text below. --}} @section('content')

{{ __('Начисления') }}

@if ($tab === 'actual')
{{ number_format($actualTotal, 0, ',', ' ') }} ₸
{{ __('Всего начислено за период • :actualchargescount начислений, :actualcharges учеников', ['actualchargescount' => $actualChargesCount, 'actualcharges' => count($actualCharges)]) }}
@if ($actualCharges->isNotEmpty())
@foreach ($actualCharges as $c) @endforeach
{{ __('Ученик') }} {{ __('Группа') }} {{ __('Тариф') }} {{ __('Начислений') }} {{ __('Сумма') }}
@foreach ($c->charges as $charge) @endforeach
{{ __('Дата') }} {{ __('Группа') }} {{ __('Тариф') }} {{ __('Сумма') }}
{{ date('d.m.Y', strtotime($charge->charged_date)) }} {{ $charge->group_name ?? '—' }} {{ preg_replace('/^\[manual\]\s*/', '', $charge->tariff_name ?? '—') }} {{ number_format((float) $charge->amount, 2, ',', ' ') }} ₸
{{ __('Итого') }} {{ number_format($actualTotal, 0, ',', ' ') }} ₸
@else
{{ __('Начислений за выбранный период не найдено.') }}
@endif @else

{{ __('Прогноз симулирует расписание и тарифы (индивидуальный > общий > групповой) за выбранный период, учитывая заморозки и окончание индивидуальных пакетов уроков. В базу данных ничего не записывается.') }}

@if ($predictError)
{{ $predictError }}
@elseif ($prediction !== null)
{{ number_format($prediction['total'], 0, ',', ' ') }} ₸
{{ __('Прогноз начислений за период • :lessons_count уроков', ['lessons_count' => $prediction['lessons_count']]) }}
@if (!empty($prediction['missing_tariff_warnings']))
{{ __('Нет тарифа (уроки не будут начислены):') }}
@endif
{{ __('По группам') }}
@if (empty($prediction['by_group'])) @else @foreach ($prediction['by_group'] as $g) @endforeach @endif
{{ __('Группа') }} {{ __('Уроков') }} {{ __('Сумма') }}
{{ __('Нет данных') }}
{{ $g['group_name'] }} {{ $g['lessons'] }} {{ number_format($g['amount'], 0, ',', ' ') }} ₸
{{ __('По дням') }}
@if (empty($prediction['by_day'])) @else @foreach ($prediction['by_day'] as $row) @endforeach @endif
{{ __('Дата') }} {{ __('Сумма') }}
{{ __('Нет данных') }}
{{ date('d.m.Y', strtotime($row['date'])) }} {{ number_format($row['amount'], 0, ',', ' ') }} ₸
@endif @endif
@endsection