@php $lang = $filters['lang'] ?? 'en'; $name = function($x) use ($lang){ if(!$x) return ''; if($lang==='ps') return $x->title_ps ?: ($x->title_en ?: ''); if($lang==='dr') return $x->title_dr ?: ($x->title_en ?: ''); return $x->title_en ?: ($x->title_ps ?: ''); }; $fmt = fn($n)=> number_format((float)$n,2); $roleText = function($secName){ $s = strtolower($secName); if(str_contains($s,'oper')) return 'Operating'; if(str_contains($s,'invest')) return 'Investing'; if(str_contains($s,'financ')) return 'Financing'; return 'Section'; }; @endphp

Cash Flow Statement

Period: {{ $from }} to {{ $to }} • Beginning Cash ({{ $beginDate }})
Printed: {{ now()->format('Y-m-d H:i') }}
Lang: {{ strtoupper($lang) }}
Beginning Cash ({{ $beginDate }}){{ $fmt($totals['begin'] ?? 0) }}
Net Cash Flow (Sum){{ $fmt($totals['net_flow'] ?? 0) }}
Net Change (End - Begin){{ $fmt($totals['net_change'] ?? 0) }}
Ending Cash ({{ $to }}){{ $fmt($totals['end'] ?? 0) }}
@foreach($sections as $sec) @php $secTitle = $name($sec); @endphp
{{ $roleText($secTitle) }} {{ $secTitle }}
@foreach($sec->lines as $l) @endforeach
Key Name Source In Out Net
{{ $l->key }} {{ $name($l) }} {{ strtoupper($l->source) }} {{ $fmt($l->in) }} {{ $fmt($l->out) }} {{ $fmt($l->net) }}
Total {{ $fmt($sec->in) }} {{ $fmt($sec->out) }} {{ $fmt($sec->net) }}
@endforeach