@include('templates.pdf_header', [ 'organisation' => $organisation, 'asOfDate' => $asOfDate, 'title' => $budget->name ])
@php $groups = [ 'Expenses' => $budget->items->where('type', 'Expense'), 'Revenue' => $budget->items->where('type', 'Revenue'), ]; @endphp @foreach($groups as $category => $items) @php $totalAmount = $totalSpent = $totalRemaining = $totalBase = 0; @endphp @foreach($items as $item) @php $totalAmount += $item->amount; $totalSpent += $item->spent_amount; $totalRemaining += $item->remaining_amount; $totalBase += $item->amount_in_base_currency; @endphp @endforeach @if($items->count()) @endif
{{ $category }}
Item Name Item Type Item Amount Item Spent Item Remaining Currency Rate Amount in Base Currency
{{ $item->name }} {{ $item->type }} {{ number_format($item->amount,2) }} {{ number_format($item->spent_amount,2) }} {{ number_format($item->remaining_amount,2) }} {{ $item->currency_rate }} {{ number_format($item->amount_in_base_currency,2) }}
Total {{ $category }} {{ number_format($totalAmount,2) }} {{ number_format($totalSpent,2) }} {{ number_format($totalRemaining,2) }} {{ number_format($totalBase,2) }}
@endforeach