{{$title}}

Monthly Expense Report for {{ \Carbon\Carbon::createFromFormat('Y-m', $month)->format('F Y') }}

{{-- Total Expense --}}

Total Expense: ฿{{ number_format($totalExpense, 2) }}

{{-- Expenses by Category --}}

Expenses by Category

@if($expenseByCategory->isEmpty())

No expense data found for this month.

@else @foreach($expenseByCategory as $categoryId => $amount) @endforeach
Expense Category Total Amount
{{-- Assuming you have a helper or relationship to retrieve category name --}} {{ \App\Models\ExpenseCategory::find($categoryId)->name ?? 'Unknown Category' }} ฿{{ number_format($amount, 2) }}
@endif

Expenses by Category

{{-- Expenses by Vehicle --}}

Expenses by Vehicle

@if($expenseByVehicle->isEmpty())

No vehicle expense data found for this month.

@else @foreach($expenseByVehicle as $vehicleId => $amount) @endforeach
Vehicle No Total Amount
{{-- Retrieve the vehicle number; adjust if you have eager loaded this relationship --}} {{ \App\Models\Vehicle::find($vehicleId)->vehicle_no ?? 'N/A' }} ฿{{ number_format($amount, 2) }}
@endif
{{-- Detailed Expense List --}}

Expense Details

@if($expenses->isEmpty())

No expense records found for this month.

@else @foreach($expenses as $expense) @endforeach
ID Date Vehicle Category Amount Description
{{ $loop->iteration }} {{ \Carbon\Carbon::parse($expense->date)->format('d M, Y') }} {{ $expense->vehicle->vehicle_no ?? 'N/A' }} {{ $expense->expenseCategory->name ?? 'N/A' }} ฿{{ number_format($expense->amount, 2) }} {{ $expense->description ?? 'N/A' }}
@endif