@extends('layouts.app') @section('title', __('Финансы по группам')) {{-- GroupFinanceController::index() — how full each group is and what it earns for the month. The controller's docblock says how every figure is counted; the «?» hints in the table header repeat that for the reader. --}} @section('content') @php $money = static fn ($v) => number_format((float) $v, 0, ',', ' '); $monthNames = [__('Январь'),__('Февраль'),__('Март'),__('Апрель'),__('Май'),__('Июнь'), __('Июль'),__('Август'),__('Сентябрь'),__('Октябрь'),__('Ноябрь'),__('Декабрь')]; // Fill bars are scaled to the biggest group on the page — there's no // per-group capacity in the schema to measure against. $maxStudents = max([1, ...array_column($rows, 'students')]); $query = static fn (array $over) => '?'.http_build_query(array_merge( ['year' => $year, 'month' => $month, 'type' => $type, 'teacher_id' => $teacherId], $over)); @endphp

{{ __('Финансы по группам') }}

{{ __('Состав групп на :date, деньги — за :month :year', ['date' => \Carbon\Carbon::parse($asOf)->format('d.m.Y'), 'month' => mb_strtolower($monthNames[$month - 1]), 'year' => $year]) }}
← →
{{ $totals['students'] }}
{{ __('Студентов в :groups группах • +:joined / −:left за месяц', ['groups' => $totals['groups'], 'joined' => $totals['joined'], 'left' => $totals['left']]) }}
{{ number_format($totals['avg_group_size'], 1, ',', ' ') }}
{{ __('Средний размер группы (без «Индив»)') }}
{{ $money($totals['paid']) }} ₸
{{ __('Оплачено из :money начисленных', ['money' => $money($totals['charged'])]) }}
{{ $money($totals['debt']) }} ₸
{{ __('Не оплачено за месяц') }}
{{ $money($totals['profit']) }} ₸
{{ __('Прибыль групп') }} @if ($totals['margin'] !== null) • {{ __('маржа :pct%', ['pct' => $totals['margin']]) }} @endif @if ($totals['unprofitable'] > 0) • {{ __('в минусе: :n', ['n' => $totals['unprofitable']]) }} @endif
{{ __('Группы') }}
@forelse ($rows as $r) @empty @endforelse @if ($rows !== []) @endif
{{ __('Группа') }} {{ __('Преподаватель') }} {{ __('Студенты') }} {{ __('Уроков') }} {{ __('Начислено') }} {{ __('Оплачено') }} {{ __('Долг') }} {{ __('Учитель') }} {{ __('Аренда') }} {{ __('Прибыль') }} {{ __('Маржа') }} {{ __('На студента') }}
{{ $r['group_name'] }}
{{ $r['type'] === 'MiniGroup' ? __('Индив') : __('Группа') }}@if ($r['discipline_name']) • {{ $r['discipline_name'] }}@endif @if (! $r['is_active']) {{ __('неактивна') }}@endif
{{ $r['teacher_name'] ?? '—' }}
{{ $r['students'] }}
@if ($r['joined'] || $r['left'])
@if ($r['joined'])+{{ $r['joined'] }}@endif @if ($r['left'])−{{ $r['left'] }}@endif
@endif
{{ $r['lessons'] }} {{ $money($r['charged']) }} {{ $money($r['paid']) }} {{ $money($r['debt']) }} {{ $money($r['teacher_cost']) }} {{ $money($r['rent']) }} {{ $money($r['profit']) }} @if ($r['margin'] !== null) {{ $r['margin'] }}% @else — @endif {{ $r['per_student'] !== null ? $money($r['per_student']) : '—' }}
{{ __('Нет групп за этот период') }}
{{ __('Итого') }} {{ $totals['students'] }} {{ $totals['lessons'] }} {{ $money($totals['charged']) }} {{ $money($totals['paid']) }} {{ $money($totals['debt']) }} {{ $money($totals['teacher_cost']) }} {{ $money($totals['rent']) }} {{ $money($totals['profit']) }} {{ $totals['margin'] !== null ? $totals['margin'].'%' : '—' }}

{{ __('Деньги считаются кассовым методом, как на странице «Финансы»: прибыль — от оплаченной части начислений. Нажмите на заголовок столбца, чтобы отсортировать.') }}

@endsection @push('scripts') @endpush