@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. --}} @push('styles') @endpush @section('content')

Финансы

@php $monthNames = ['Январь','Февраль','Март','Апрель','Май','Июнь', 'Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь']; @endphp
Начислено студентам
{{ number_format($totalRevenue, 0, ',', ' ') }} ₸
Оплачено (поступления)
{{ number_format($totalPayments, 0, ',', ' ') }} ₸
Зарплата учителям
{{ number_format($teacherSalary, 0, ',', ' ') }} ₸
Аренда + прочее
{{ number_format($totalRent + $manualExpenses, 0, ',', ' ') }} ₸
аренда {{ number_format($totalRent, 0, ',', ' ') }} + расходы {{ number_format($manualExpenses, 0, ',', ' ') }}
Прибыль
{{ number_format($totalProfit, 0, ',', ' ') }} ₸
@if ($totalRevenue > 0)
маржа {{ 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