@extends('layouts.admin') @section('title','Accounting Reports') @section('page-title','Accounting Reports') @section('content') @php $totalInc = collect($months)->sum('income'); $totalExp = collect($months)->sum('expenses'); $totalProf = collect($months)->sum('profit'); @endphp
Total Income {{ $year }}
₵{{ number_format($totalInc,2) }}
Total Expenses {{ $year }}
₵{{ number_format($totalExp,2) }}
Net Profit {{ $year }}
₵{{ number_format($totalProf,2) }}
Monthly Breakdown
@foreach($months as $m) @php $margin = $m['income'] > 0 ? round(($m['profit'] / $m['income']) * 100, 1) : 0; @endphp @endforeach
MonthIncomeExpensesProfit / LossMargin
{{ $m['month'] }} ₵{{ number_format($m['income'],2) }} ₵{{ number_format($m['expenses'],2) }} {{ $m['profit'] >= 0 ? '+' : '' }}₵{{ number_format($m['profit'],2) }} {{ $margin }}%
TOTAL ₵{{ number_format($totalInc,2) }} ₵{{ number_format($totalExp,2) }} ₵{{ number_format($totalProf,2) }}
Expenses by Category — {{ $year }}
@forelse($expByCategory as $cat) @php $pct = $totalExp > 0 ? round(($cat->expenses_sum_amount / $totalExp) * 100, 1) : 0; @endphp
{{ $cat->icon }} {{ $cat->name }} ₵{{ number_format($cat->expenses_sum_amount ?? 0,2) }} ({{ $pct }}%)
@empty

No expense data for {{ $year }}.

@endforelse
+ Income + Expense
@endsection