@extends('master.app') @section('title', 'Cash Flow Statement') @section('body') @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); $netChange = (float)($totals['net_change'] ?? 0); $roleMeta = function($label){ $label = strtolower($label); if(str_contains($label,'oper')) return ['cls'=>'badge-soft-primary','icon'=>'fa-briefcase','txt'=>'Operating']; if(str_contains($label,'invest')) return ['cls'=>'badge-soft-warning','icon'=>'fa-chart-column','txt'=>'Investing']; if(str_contains($label,'financ')) return ['cls'=>'badge-soft-info','icon'=>'fa-coins','txt'=>'Financing']; return ['cls'=>'badge-soft-dark','icon'=>'fa-layer-group','txt'=>$label]; }; @endphp @push('styles') @endpush
{{-- Header --}}
Cash Flow Statement
Period: {{ $from }} to {{ $to }} • Beginning Cash ({{ $beginDate }})
{{ $from }} → {{ $to }} {{ strtoupper($lang) }} Cash + Bank
Beginning Cash
{{ $fmt($totals['begin'] ?? 0) }}
Start position
Net Cash Flow (Sum)
{{ $fmt($totals['net_flow'] ?? 0) }}
Operating + Investing + Financing
Net Change (End - Begin)
{{ $fmt($netChange) }}
End position difference
Ending Cash
{{ $fmt($totals['end'] ?? 0) }}
Cash & bank balance
{{-- Filters --}}
Filters
Click each section to expand details
Reset
{{-- Sections + Summary --}}
@forelse($sections as $sec) @php $m = $roleMeta($name($sec) ?: ($sec->title_en ?? '')); @endphp
{{ $m['txt'] }} {{ $name($sec) }}
In: {{ $fmt($sec->in) }} Out: {{ $fmt($sec->out) }} Net: {{ $fmt($sec->net) }}
@forelse($sec->lines as $l) @php $n = (float)$l->net; @endphp @empty @endforelse
Key Name Source In Out Net
{{ $l->key }} {{ $name($l) }} {{ strtoupper($l->source) }} {{ $fmt($l->in) }} {{ $fmt($l->out) }} {{ $fmt($n) }}
No data
Total {{ $fmt($sec->in) }} {{ $fmt($sec->out) }} {{ $fmt($sec->net) }}
@empty
No cash/bank movements found for this period.
@endforelse
Summary
Cash Position
Beginning Cash
{{ $fmt($totals['begin'] ?? 0) }}
Net Cash Flow (Sum)
{{ $fmt($totals['net_flow'] ?? 0) }}
Net Change (End - Begin)
{{ $fmt($netChange) }}
Ending Cash
{{ $fmt($totals['end'] ?? 0) }}
Note: Categories are auto-mapped (cash_types keywords). Banks default to Operating.
@endsection