{{$title}}

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

{{-- Total Office Expense --}}

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

{{-- Office Expenses by Category --}}

Expenses by Category

@if($expenseByCategoryOffice->isEmpty())

No office expense data found for this month.

@else @foreach($expenseByCategoryOffice as $categoryId => $amount) @endforeach
Expense Category Total Amount
{{-- Assuming you have an OfficeExpenseCategory model with a 'name' field --}} {{ \App\Models\OfficeExpenseCategory::find($categoryId)->name ?? 'Unknown Category' }} ฿{{ number_format($amount, 2) }}
@endif

Expenses by Category

{{-- Detailed Office Expense List --}}

Expense Details

@if($officeExpenses->isEmpty())

No office expense records found for this month.

@else @foreach($officeExpenses as $expense) @endforeach
ID Date Category Amount Description Account
{{ $loop->iteration }} {{ \Carbon\Carbon::parse($expense->date)->format('d M, Y') }} {{-- Assuming the relation is defined as 'officeExpenseCategory' on the OfficeExpense model --}} {{ $expense->officeExpenseCategory->name ?? 'N/A' }} ฿{{ number_format($expense->amount, 2) }} {{ $expense->description ?? 'N/A' }} {{-- Display the account name or details; adjust as needed --}} {{ $expense->account->name ?? 'N/A' }}
@endif