التقرير المالي

@if($fromDate || $toDate) الفترة: {{ $fromDate ?? '—' }} إلى {{ $toDate ?? '—' }} @else جميع الفترات @endif — تاريخ التقرير: {{ now()->format('Y-m-d') }}

@php $curNames = ['EGP' => 'جنيه مصري', 'USD' => 'دولار أمريكي', 'TRY' => 'ليرة تركية']; @endphp {{-- Summary --}}
إجمالي الإيرادات
{{ number_format($totalIncome, 2) }}
إجمالي المصروفات
{{ number_format($totalExpenses, 2) }}
صافي الربح
{{ number_format($totalIncome - $totalExpenses, 2) }}
@if($incomeByCurrency->isNotEmpty() || $expensesByCurrency->isNotEmpty())

ملخص حسب العملة

@php $allCurrencies = array_unique(array_merge( $incomeByCurrency->pluck('currency')->toArray(), $expensesByCurrency->pluck('currency')->toArray() )); sort($allCurrencies); @endphp @foreach($allCurrencies as $cur) @php $inc = $incomeByCurrency->where('currency', $cur)->sum('total'); $exp = $expensesByCurrency->where('currency', $cur)->sum('total'); $net = $inc - $exp; @endphp @endforeach
العملة الإيرادات المصروفات صافي الربح
{{ $curNames[$cur] ?? $cur }} ({{ $cur }}) {{ number_format($inc, 2) }} {{ number_format($exp, 2) }} {{ number_format($net, 2) }}
@endif {{-- Monthly --}} @php $monthsIncome = $monthlyIncome->groupBy('currency'); $monthsExpenses = $monthlyExpenses->groupBy('currency'); @endphp @if($monthsIncome->isNotEmpty() || $monthsExpenses->isNotEmpty()) @php $monthCurrencies = array_unique(array_merge($monthsIncome->keys()->toArray(), $monthsExpenses->keys()->toArray())); @endphp

الإيرادات والمصروفات الشهرية

@foreach($monthCurrencies as $cur) @php $curInc = $monthsIncome->get($cur, collect()); $curExp = $monthsExpenses->get($cur, collect()); $months = $curInc->pluck('month')->merge($curExp->pluck('month'))->unique()->sort()->values(); @endphp

{{ $curNames[$cur] ?? $cur }} ({{ $cur }})

@foreach($months as $month) @php $inc = $curInc->where('month', $month)->first()->total ?? 0; $exp = $curExp->where('month', $month)->first()->total ?? 0; $net = $inc - $exp; @endphp @endforeach
الشهر الإيرادات المصروفات صافي الربح
{{ $month }} {{ number_format($inc, 2) }} {{ number_format($exp, 2) }} {{ number_format($net, 2) }}
@endforeach
@endif
{{-- Category analysis --}}

تحليل التصنيفات

@foreach($incomeByCategory->groupBy('currency') as $cur => $rows) @php $first = true; @endphp @foreach($rows as $row) @if($first) @php $first = false; @endphp @endif @endforeach @endforeach @foreach($expensesByCategory->groupBy('currency') as $cur => $rows) @php $first = true; @endphp @foreach($rows as $row) @if($first) @php $first = false; @endphp @endif @endforeach @endforeach
النوع التصنيف العملة الإجمالي
إيرادات{{ $row->payment_method ?? '—' }} {{ $cur }} {{ number_format($row->total, 2) }}
مصروفات{{ $row->category ?? '—' }} {{ $cur }} {{ number_format($row->total, 2) }}
{{-- Commissions --}}

العمولات

النوع مبيعات قبولات الإجمالي
معلق {{ number_format($salesCommissionsPending, 2) }} {{ number_format($admissionsCommissionsPending, 2) }} {{ number_format($totalCommissionsPending, 2) }}
مدفوع {{ number_format($salesCommissionsPaid, 2) }} {{ number_format($admissionsCommissionsPaid, 2) }} {{ number_format($totalCommissionsPaid, 2) }}
الإجمالي {{ number_format($salesCommissionsPaid + $salesCommissionsPending, 2) }} {{ number_format($admissionsCommissionsPaid + $admissionsCommissionsPending, 2) }} {{ number_format($totalCommissionsPaid + $totalCommissionsPending, 2) }}
{{-- Cashbox expenses --}} @if($expensesByCashbox->isNotEmpty())

المصروفات حسب الخزنة

@foreach($expensesByCashbox->groupBy('cashbox_name') as $name => $rows) @php $first = true; @endphp @foreach($rows as $row) @if($first) @php $first = false; @endphp @endif @endforeach @endforeach
الخزنة العملة إجمالي المصروفات
{{ $name }}{{ $row->currency }} {{ number_format($row->total, 2) }}
@endif {{-- Cashbox Movements Detail --}} @if(isset($cashboxMovements) && $cashboxMovements->isNotEmpty())

حركات الخزنة التفصيلية

{{ $cashboxMovements->count() }} حركة

@foreach($cashboxMovements as $m) @endforeach
التاريخ الخزنة النوع المبلغ العملة الوصف بواسطة
{{ $m->created_at ? \Carbon\Carbon::parse($m->created_at)->format('Y-m-d H:i') : '—' }} {{ $m->cashbox_name ?? '—' }} {{ $m->type === 'in' ? 'إيداع' : 'سحب' }} {{ $m->type === 'in' ? '+' : '-' }}{{ number_format($m->amount, 2) }} {{ $m->currency }} {{ $m->description ?? '—' }} {{ $m->creator_name ?? '—' }}
@endif