{{-- resources/views/exports/cash-flow-pdf.blade.php Rendered by ReportsController::exportCashFlow(). $data holds cash_flows (inflows and outflows, each a map of category => {name, amount, transactions}) and summary (opening_cash, total_inflows, total_outflows, net_cash_flow, closing_cash). --}} Cash Flow @include('exports._report-styles')

{{ config('accounts.organisation.name') }}

Cash Flow

{{ \Carbon\Carbon::parse($data['from_date'])->format('d/m/Y') }} to {{ \Carbon\Carbon::parse($data['to_date'])->format('d/m/Y') }}
@php $money = fn ($v) => number_format((float) $v, 2); $summary = $data['summary'] ?? []; @endphp
Opening Cash & Bank {{ $money($summary['opening_cash'] ?? 0) }}
@foreach ([['inflows', 'CASH INFLOWS', 'total_inflows'], ['outflows', 'CASH OUTFLOWS', 'total_outflows']] as [$key, $label, $totalKey]) @php $categories = $data['cash_flows'][$key] ?? []; @endphp @forelse ($categories as $category) {{-- Categories are pre-seeded by the controller and stay in the list at zero, so they are skipped here rather than printing a page of nil lines. --}} @if ((float) ($category['amount'] ?? 0) != 0.0) @endif @empty @endforelse
{{ $label }} Amount
{{ $category['name'] ?? '' }} {{ $money($category['amount']) }}
No {{ strtolower($label) }} in this period.
Total {{ ucfirst(strtolower($label)) }} {{ $money($summary[$totalKey] ?? 0) }}
@endforeach
Net Cash Flow {{ $money($summary['net_cash_flow'] ?? 0) }}
Closing Cash & Bank {{ $money($summary['closing_cash'] ?? 0) }}