@extends('layout.layout') @section('content')
💰 Expense Management
Add New Expense
{{-- Alert Messages (Keep the existing auto-close logic) --}} @if(session('success')) @endif @if(session('error')) @endif {{-- Search/Filter Form ENHANCED --}}

{{-- Row 2: Date Filters & Actions --}}
{{-- Action Buttons --}}
@if(request()->has('search') || request()->has('status') || request()->has('recurring') || request()->has('start_date') || request()->has('end_date')) Clear Filters @endif
{{-- Expenses Table Card (rest of the table remains the same) --}}
{{-- ... (Table content remains the same) ... --}}
All Recorded Expenses
@forelse($expenses as $expense) @empty @endforelse
#ID Payment Number Amount Item Payment Date Mode Status Recurring Vendors Actions
{{ $expense->id }} {{ $expense->payment_number }} ${{ number_format($expense->amount, 2) }} {{ $expense->item_name }} {{ $expense->payment_date->format('M d, Y') }} {{ ucfirst(str_replace('_', ' ', $expense->payment_mode)) }} {{-- Status Badge --}} @php $statusClass = match($expense->status) { 'paid' => 'success', 'pending_approval' => 'warning', 'open' => 'danger', default => 'secondary', }; @endphp {{ ucfirst(str_replace('_', ' ', $expense->status)) }} {{-- Recurring Badge --}} @php $recurringClass = ($expense->recurring === 'yes') ? 'info' : 'secondary'; @endphp {{ ucfirst($expense->recurring) }} @foreach(array_map('trim', explode(',', $expense->vendors)) as $vendor) {{ $vendor }} @endforeach
@csrf @method('DELETE')
No expenses found. Click 'Add New Expense' to get started.
@endsection