@extends('layouts.app') @section('title', __('Финансы')) {{-- Ports app/Views/admin/finances/index.php (legacy) — see the Phase 48 plan. The add/edit-expense form uses Laravel's own $errors/old() — confirmed safe since the legacy view genuinely repopulates old input here (unlike several other controllers this migration found where it doesn't). editExpense's old()-first-then-DB-value fallback is preserved exactly: a failed edit-resubmission shows the attempted value, not the original DB row. --}} @section('content')

{{ __('Финансы') }}

{{ __('По группам') }}
←
@php $monthNames = [__('Январь'),__('Февраль'),__('Март'),__('Апрель'),__('Май'),__('Июнь'), __('Июль'),__('Август'),__('Сентябрь'),__('Октябрь'),__('Ноябрь'),__('Декабрь')]; @endphp
→
{{ number_format($totalRevenue, 0, ',', ' ') }} ₸
{{ __('Начислено студентам') }}
{{ number_format($totalPayments, 0, ',', ' ') }} ₸
{{ __('Оплачено (поступления)') }}
{{ number_format($teacherSalary, 0, ',', ' ') }} ₸
{{ __('Зарплата учителям') }}
{{ number_format($totalRent + $manualExpenses, 0, ',', ' ') }} ₸
{{ __('Аренда + прочее • аренда :totalrent + расходы', ['totalrent' => number_format($totalRent, 0, ',', ' ')]) }} {{ number_format($manualExpenses, 0, ',', ' ') }}
{{ number_format($totalProfit, 0, ',', ' ') }} ₸
{{ __('Прибыль') }} @if ($totalRevenue > 0) • {{ __('маржа :pct%', ['pct' => round(($totalProfit / $totalRevenue) * 100, 1)]) }} @endif
{{ __('Поступления от студентов') }} {{ number_format($totalPayments, 0, ',', ' ') }} ₸
@if (! empty($paymentRows)) @foreach ($paymentRows as $p) @endforeach
{{ __('Дата') }} {{ __('Студент') }} {{ __('Описание') }} {{ __('Сумма') }}
{{ $p['payment_date'] }} {{ $p['first_name'].' '.$p['last_name'] }} {{ $p['description'] ?? '—' }} {{ number_format($p['amount'], 0, ',', ' ') }} ₸
@else

{{ __('Нет поступлений за этот период.') }}

@endif
@include('admin.finances._expense_card', [ 'year' => $year, 'month' => $month, 'editExpense' => $editExpense, 'expenseCategories' => $expenseCategories, 'expenseRows' => $expenseRows, 'manualExpenses' => $manualExpenses, ])
@endsection @push('scripts') @endpush