@extends('layouts.app') @section('title', 'Expense Report') @section('breadcrumb') @endsection @section('content') {{-- Date Filter --}}
{{-- Summary Stats --}}
Rs. {{ number_format($totalExpenses, 0) }}
Total Expenses
{{ $expenses->count() }}
Total Records
Rs. {{ number_format($expenses->count() > 0 ? $totalExpenses / $expenses->count() : 0, 0) }}
Avg. Expense
{{-- Expenses by Category --}}
By Category
@forelse($byCategory as $category => $data)
{{ $category }} {{ $data['count'] }} records
Rs. {{ number_format($data['amount'], 0) }}
@empty
No expense data
@endforelse
{{-- Expenses by Payment Method --}}
By Payment Method
@php $paymentIcons = [ 'cash' => 'bi-cash', 'card' => 'bi-credit-card', 'bank_transfer' => 'bi-bank', ]; @endphp @forelse($byPaymentMethod as $method => $amount)
{{ ucfirst(str_replace('_', ' ', $method)) }}
Rs. {{ number_format($amount, 0) }}
@empty
No data
@endforelse
{{-- Monthly Comparison --}}
Monthly Trend
@php $maxMonthly = max($monthlyComparison) ?: 1; @endphp
@foreach($monthlyComparison as $month => $amount)
@if($amount > 0) {{ number_format($amount / 1000, 0) }}K @endif
{{ $month }}
@endforeach
{{-- Expense Records --}}
All Expenses
{{ $expenses->count() }} records
@forelse($expenses->take(30) as $expense) @empty @endforelse
Date Title Category Payment Amount
{{ $expense->expense_date?->format('M d, Y') }}
{{ $expense->title }}
@if($expense->notes) {{ Str::limit($expense->notes, 50) }} @endif
@if($expense->category) {{ $expense->category->name }} @else - @endif {{ ucfirst(str_replace('_', ' ', $expense->payment_method ?? 'cash')) }} Rs. {{ number_format($expense->amount, 2) }}

No expenses recorded

@push('styles') @endpush @endsection