{{-- resources/views/expenses/index.blade.php --}} @extends('layouts.app') @section('title', 'Expenses') @section('page_title', 'Expenses') @section('page_subtitle', 'Track and manage property expenses') @section('content') {{-- Stats --}}
${{ number_format($stats['total_this_month'], 0) }}
This Month
{{ $stats['pending_approval'] }}
Pending Approval
${{ number_format($stats['total_unpaid'], 0) }}
Approved & Unpaid
{{-- Filters --}}
@if(request()->hasAny(['search','category','status','date_from','date_to'])) Clear @endif
{{-- Table --}}
Expenses {{ $expenses->total() }} total
@if($expenses->isEmpty())

No expenses found

Add First Expense
@else
@foreach($expenses as $expense) @php $sc = [ 'pending' => ['bg'=>'#fef3c7','color'=>'#92400e'], 'approved' => ['bg'=>'#dbeafe','color'=>'#1e40af'], 'rejected' => ['bg'=>'#fee2e2','color'=>'#991b1b'], 'paid' => ['bg'=>'#d1fae5','color'=>'#065f46'], ][$expense->status] ?? ['bg'=>'#f1f5f9','color'=>'#475569']; @endphp @endforeach
Reference Title Category Vendor Date Amount Status
{{ $expense->reference }}
{{ $expense->title }}
@if($expense->description)
{{ Str::limit($expense->description, 50) }}
@endif
@if($expense->category) @if($expense->category->color) @endif {{ $expense->category->name }} @else @endif {{ $expense->vendor ?? '—' }} {{ $expense->expense_date->format('d M Y') }} {{ $expense->currency }} {{ number_format($expense->amount, 2) }} {{ ucfirst($expense->status) }} View →
@if($expenses->hasPages())
{{ $expenses->links() }}
@endif @endif
@endsection