Monthly Summary

Monthly Summary

Last 12 months performance overview
← Reports
@php $totalRev = $monthlyData->sum('revenue'); $totalSales = $monthlyData->sum('sales_count'); $bestMonth = $monthlyData->sortByDesc('revenue')->first(); $avgMonthly = $monthlyData->count() > 0 ? round($totalRev / $monthlyData->count(), 2) : 0; @endphp
12-Month Revenue
KSh {{ number_format($totalRev, 0) }}
Total earned
Total Sales
{{ $totalSales }}
Transactions
Avg Monthly
KSh {{ number_format($avgMonthly, 0) }}
Per month
Best Month
{{ $bestMonth ? \Carbon\Carbon::createFromFormat('Y-m', $bestMonth->month)->format('M Y') : '—' }}
{{ $bestMonth ? 'KSh ' . number_format($bestMonth->revenue, 0) : '' }}
{{-- Revenue trend chart --}}
Revenue & Sales Trend (Last 12 Months)
{{-- Monthly table --}}
Month-by-Month Breakdown
@forelse($monthlyData as $i => $month) @php $prev = $monthlyData[$i - 1] ?? null; $change = $prev && $prev->revenue > 0 ? round(($month->revenue - $prev->revenue) / $prev->revenue * 100, 1) : null; $avgSale = $month->sales_count > 0 ? round($month->revenue / $month->sales_count, 2) : 0; @endphp @empty @endforelse @if($monthlyData->isNotEmpty()) @endif
Month Sales Revenue Avg per Sale vs Prev Month
{{ \Carbon\Carbon::createFromFormat('Y-m', $month->month)->format('F Y') }} {{ $month->sales_count }} KSh {{ number_format($month->revenue, 2) }} KSh {{ number_format($avgSale, 2) }} @if($change !== null) {{ $change > 0 ? '↑' : ($change < 0 ? '↓' : '→') }} {{ abs($change) }}% @else @endif
No monthly data available.
Total {{ $totalSales }} KSh {{ number_format($totalRev, 2) }} KSh {{ number_format($avgMonthly, 2) }}
@push('scripts') @endpush