@extends('layouts.inspinia') @section('title', 'Expense Register') @section('content_header', 'Expense Register') @section('breadcrumb') @endsection @section('content')
Read-only report. Shows posted expenses only.
{{-- Filter Form --}}
Filters
Reset
{{-- Summary Cards --}}

{{ number_format($totalAmount, 2) }}

Total Expenses

{{ number_format($totalTax, 2) }}

Total Tax

{{ $expenseCount }}

Expense Count

{{-- By Category --}} @if($byCategory->isNotEmpty())
By Category
@foreach($byCategory as $row) @endforeach
CategoryTotalCount
{{ $row->category_name }} {{ number_format($row->total, 2) }} {{ $row->cnt }}
@endif {{-- By Method --}} @if($byMethod->isNotEmpty())
By Payment Method
@foreach($byMethod as $row) @endforeach
MethodTotalCount
{{ ucfirst(str_replace('_', ' ', $row->payment_method ?? 'N/A')) }} {{ number_format($row->total, 2) }} {{ $row->cnt }}
@endif
{{-- Expenses Table --}}
Expense List — {{ $from }} to {{ $to }} {{ $expenses->total() }} records
@if($expenses->isEmpty())
No expenses found for the selected filters.
@else
@foreach($expenses as $e) @endforeach
Expense # Date Category Payee Description Method Subtotal Tax Total Posted By Posted At
{{ $e->expense_number }} {{ $e->expense_date?->format('d/m/Y') }} {{ $e->category?->name ?? '—' }} {{ $e->payee_name ?? '—' }} {{ \Illuminate\Support\Str::limit($e->description, 40) }} {{ ucfirst(str_replace('_', ' ', $e->payment_method ?? 'N/A')) }} {{ number_format($e->subtotal, 2) }} {{ number_format($e->tax_amount, 2) }} {{ number_format($e->total_amount, 2) }} {{ $e->postedBy?->name ?? '—' }} {{ $e->posted_at?->format('d/m/Y H:i') ?? '—' }}
Page Totals: {{ number_format($expenses->sum('subtotal'), 2) }} {{ number_format($expenses->sum('tax_amount'), 2) }} {{ number_format($expenses->sum('total_amount'), 2) }}
{{ $expenses->links() }}
@endif
@endsection