@php $topTotal = $topItems->sum('total_amount'); $topPct = $grandTotal > 0 ? round($topTotal / $grandTotal * 100, 1) : 0; $maxAmt = $topItems->max('total_amount'); @endphp {{-- Stat cards --}}
| Rank | Expense Item | Occurrences | Total Amount | % of Total | Amount Bar |
|---|---|---|---|---|---|
| @if($i === 0) #1 @elseif($i === 1) #2 @elseif($i === 2) #3 @else #{{ $i + 1 }} @endif | {{ $row->expense_item_name }} | {{ number_format($row->occurrence_count) }} | {{ number_format($row->total_amount, 2) }} | {{ $row->percentage }}% |
|