@extends('layouts.app') @section('title','Expenditure Report') @section('page-title','Expenditure Report') @section('content') {{-- Filter Bar --}}
{{-- Report Header (for print) --}}

Hillside Real Estates — Expenditure Report

Generated: {{ now()->format('d M Y H:i') }}

{{-- Summary Cards --}} @php $grandTotal = $expenditures->sum('amount'); $paidTotal = $expenditures->where('is_paid',true)->sum('amount'); $pendingTotal = $expenditures->where('is_paid',false)->sum('amount'); $recordCount = $expenditures->count(); @endphp
Total Expenditure
GH₵ {{ number_format($grandTotal,2) }}
Amount Paid
GH₵ {{ number_format($paidTotal,2) }}
Outstanding
GH₵ {{ number_format($pendingTotal,2) }}
Line Items
{{ $recordCount }}
{{-- Pie Chart --}}
Spend by Category
{{-- Category Breakdown Table --}}
Category Breakdown
@php $sorted = $byCategory->sortByDesc('total'); @endphp @foreach($sorted as $cat) @endforeach
CategoryAmount (GH₵)%Items
{{ $cat['name'] }} {{ number_format($cat['total'],2) }} {{ $grandTotal>0 ? round(($cat['total']/$grandTotal)*100,1) : 0 }}% {{ $cat['count'] }}
TOTAL {{ number_format($grandTotal,2) }} 100% {{ $recordCount }}
{{-- All Transactions Table --}}
All Transactions ({{ $recordCount }})
@forelse($expenditures as $i => $e) @empty @endforelse @if($expenditures->count() > 0) @endif
# Date Description Category Project Paid By Mode Amount (GH₵) Status
{{ $i+1 }} {{ $e->date instanceof \Carbon\Carbon ? $e->date->format('d/m/Y') : \Carbon\Carbon::parse($e->date)->format('d/m/Y') }} {{ Str::limit($e->description, 45) }} {{ $e->category->code ?? '-' }} {{ $e->project->name ?? '-' }} {{ $e->paid_by ?? '-' }} {{ str_replace('_',' ',$e->payment_mode ?? '-') }} {{ number_format($e->amount,2) }} {{ $e->is_paid ? 'Paid' : 'Pending' }}
No expenditure records found for the selected filters.
Clear Filters
TOTAL GH₵ {{ number_format($grandTotal,2) }}
@endsection @push('scripts') @endpush