@extends('layouts.app') @section('title', 'Expenses') @section('content')

Expenses

{{ $expenses->total() }} expense(s) matching your filters. Approved expenses post to the ledger and appear on the P&L.

P&L + Record expense
@include('components.kpi', ['label' => 'Total', 'value' => money($totals['all']), 'variant' => 'info']) @include('components.kpi', ['label' => 'This month', 'value' => money($totals['thisMonth'])]) @include('components.kpi', ['label' => 'Awaiting approval', 'value' => money($totals['pending']), 'variant' => $totals['pending'] ? 'warn' : '']) @include('components.kpi', ['label' => 'Approved', 'value' => money($totals['approved']), 'variant' => 'good'])
@if ($expenses->isEmpty()) @include('components.empty-state', [ 'icon' => '💸', 'title' => 'No expenses recorded', 'message' => 'Until an expense is approved the profit & loss report shows zero costs and profit equal to revenue. Use the button above to record the first one.', ]) @else @foreach ($expenses as $expense) @endforeach
DateDescriptionVendorCategory AccountPaid byAmount StatusBy
{{ $expense->expense_date?->format('d M Y') }} {{ \Illuminate\Support\Str::limit($expense->description, 44) }} @if ($expense->reference)
{{ $expense->reference }}
@endif
{{ $expense->vendor ?: '—' }} {{ title_case_words($expense->category) }} {{ $expense->account?->code ?: '—' }}
{{ \Illuminate\Support\Str::limit($expense->account?->name ?? '', 20) }}
{{ title_case_words($expense->payment_method ?? 'cash') }} {{ money($expense->amount) }} {{ title_case_words($expense->status) }} {{ $expense->recordedBy?->name ?: '—' }} Open
@endif
@if ($expenses->hasPages())
{{ $expenses->links('partials.pagination') }}
@endif
@if ($byCategory)

By category

@foreach ($byCategory as $category => $total) @endforeach
CategoryTotalShare
{{ title_case_words($category) }} {{ money($total) }} {{ $totals['all'] > 0 ? round($total / $totals['all'] * 100, 1) : 0 }}%
@endif @endsection