@extends('layouts.master') @section('page_title', 'Expenditure Report') @section('content')
Expenditure Report Filters

Expenditure Report

Period: {{ Carbon\Carbon::parse($startDate)->format('M d, Y') }} - {{ Carbon\Carbon::parse($endDate)->format('M d, Y') }}

Generated: {{ Carbon\Carbon::now()->format('M d, Y g:i A') }}

Total Transactions: {{ $expenditures->count() }}

{{ \App\Helpers\Mk::formatCurrency($expenditures->sum('amount')) }}

Total Expenditure

{{ \App\Helpers\Mk::formatCurrency($expenditures->avg('amount')) }}

Average Transaction

{{ $expenditures->groupBy('category_name')->count() }}

Categories Used

{{ \App\Helpers\Mk::formatCurrency($expenditures->max('amount')) }}

Largest Transaction

Expenditure by Category
@php $totalExpenditure = $expenditures->sum('amount'); @endphp @foreach($categorySummary as $summary) @php $percentage = $totalExpenditure > 0 ? ($summary->total_amount / $totalExpenditure) * 100 : 0; @endphp @endforeach
Category Transactions Total Amount Average Percentage
{{ $summary->category_name }} {{ $summary->transaction_count }} ${{ number_format($summary->total_amount, 2) }} ${{ number_format($summary->avg_amount, 2) }} {{ number_format($percentage, 1) }}%
Total {{ $expenditures->count() }} ${{ number_format($totalExpenditure, 2) }} ${{ number_format($expenditures->avg('amount'), 2) }} 100.0%
Monthly Expenditure Trend
@php $previousAmount = 0; @endphp @foreach($monthlyTrend as $trend) @php $change = $previousAmount > 0 ? (($trend->total_amount - $previousAmount) / $previousAmount) * 100 : 0; $changeClass = $change > 0 ? 'text-danger' : ($change < 0 ? 'text-success' : 'text-muted'); @endphp @php $previousAmount = $trend->total_amount; @endphp @endforeach
Month Transactions Total Amount Change from Previous
{{ $trend->month_name }} {{ $trend->transaction_count }} ${{ number_format($trend->total_amount, 2) }} @if($previousAmount > 0) {{ $change > 0 ? '+' : '' }}{{ number_format($change, 1) }}% @else - @endif
Detailed Expenditure Transactions
@if($expenditures->count() > 0)
@foreach($expenditures->sortByDesc('voucher_date') as $expenditure) @endforeach
Date Voucher # Description Category Vendor Amount Payment Method Status
{{ Carbon\Carbon::parse($expenditure->voucher_date)->format('M d, Y') }} {{ $expenditure->voucher_number }} {{ str($expenditure->description)->limit(40) }} {{ $expenditure->category_name ?? 'Uncategorized' }} {{ $expenditure->vendor_name }} ${{ number_format($expenditure->amount, 2) }} {{ $expenditure->payment_method ?? 'N/A' }} {{ $expenditure->status ?? 'Unknown' }}
Grand Total ${{ number_format($expenditures->sum('amount'), 2) }}
@else
No Data Found
No expenditure transactions found for the selected criteria.
@endif
@endsection