@extends('layout.main') @section('content')

Expenses

Track and manage all business expenses across categories

@if (Auth::user()->can('expenses-create')) Add Expense @endif
Total Expenses
{{ formatCurrencyDecimals($expenses->sum('amount')) }}
Total Records
{{ $expenses->count() }}
Average Expense
{{ $expenses->count() > 0 ? formatCurrencyDecimals($expenses->avg('amount')) : formatCurrencyDecimals(0) }}
This Month
{{ formatCurrencyDecimals($expenses->where('date', '>=', now()->startOfMonth())->sum('amount')) }}

Expense Records

{{ $expenses->count() }} Expenses
Expense Details Type & Category Amount ({{ getCurrencyCode() }}) Date Branch @if (Auth::user()->can('expenses-edit') || Auth::user()->can('expenses-delete')) Actions @endif @forelse ($expenses as $expense)
@if($expense->expense_type_id == 3)
@else
@endif
@if ($expense->expense_type_id == 3)
Click to view loan details
@else
{{ $expense->expense_type->name ?? 'General Expense' }}
@if($expense->description)
{{ Str::limit($expense->description, 40) }}
@endif @endif
{{ $expense->expense_type->name ?? 'Unknown Type' }} @if($expense->expense_category)
{{ $expense->expense_category->name }}
@endif
{{ formatAmount($expense->amount) }}
@if($expense->rate && $expense->rate > 0)
Rate: {{ $expense->rate }}%
@endif
{{ \Carbon\Carbon::parse($expense->date)->format('M j, Y') }}
{{ \Carbon\Carbon::parse($expense->date)->diffForHumans() }}
{{ $expense->branch->name ?? 'Main Branch' }}
@if($expense->created_by)
by {{ $expense->created_by->name ?? 'System' }}
@endif
@if (Auth::user()->can('expenses-edit') || Auth::user()->can('expenses-delete'))
@if (Auth::user()->can('expenses-edit')) @endif @if (Auth::user()->can('expenses-delete')) @endif
@endif
@empty

No expenses recorded

Start tracking your business expenses.

@if (Auth::user()->can('expenses-create')) Record First Expense @endif
@endforelse
@endsection