@php($canCreateExpense = \App\Support\AdminAccess::canAction('expenses', 'create')) @php($canEditExpense = \App\Support\AdminAccess::canAction('expenses', 'edit')) @php($canDeleteExpense = \App\Support\AdminAccess::canAction('expenses', 'delete')) @php($canCreateExpenseCategory = \App\Support\AdminAccess::canAction('categories', 'create'))

{{ __('Expenses Management') }}

{{ __('Track paid and pending expenses with linked categories and accounts.') }}

@if($canCreateExpense) @endif
@forelse($expenses as $expense)
{{ $expense->title }}
{{ $expense->category?->display_name ?? $expense->category?->name ?? __('No category') }}
{{ $expense->payment_status === 'paid' ? __('Paid') : __('Pending') }}
{{ __('Amount') }} {{ __('Rs.') }} {{ number_format((float) $expense->amount, 2) }}
{{ __('Expense Date') }} {{ $expense->expense_date?->format('d M Y') ?? '-' }}
{{ __('Payment Date') }} {{ $expense->payment_date?->format('d M Y') ?? '-' }}
{{ __('Due Date') }} {{ $expense->due_date?->format('d M Y') ?? '-' }}
{{ __('Method') }} {{ $expense->payment_method ?: '-' }}
{{ __('Account') }} {{ $expense->account?->account_name ?? '-' }}
@if($expense->description)
{{ $expense->description }}
@endif @if($expense->receipt) @endif
{{ __('Print') }} @if($canEditExpense || $canDeleteExpense) @if($canEditExpense) @endif @if($canDeleteExpense) @endif @endif
@empty
{{ __('No expenses found yet.') }}
@endforelse
{{ $expenses->links() }}
@if($showExpenseModal) @endif @if($showCategoryModal)
{{ __('Add New Category') }}
@error('new_category_name') {{ $message }} @enderror
@endif