@extends('layouts.app') @section('title', 'Cash Flow') @section('content') @php $f = $filters ?? []; $qParams = array_filter([ 'q' => $f['q'] ?? '', 'project_id' => $f['project_id'] ?? '', 'status' => ($f['status'] ?? 'all') !== 'all' ? ($f['status'] ?? '') : null, 'type' => $f['type'] ?? '', 'date_from' => $f['date_from'] ?? '', 'date_to' => $f['date_to'] ?? '', ]); $net = $netPosition ?? 0; $netClass = $net > 0 ? 'text-emerald-600' : ($net < 0 ? 'text-red-600' : 'text-amber-600'); @endphp

Cash Flow Management

Track money coming in and going out

Export Excel Export PDF
@if($errors->any())
{{ $errors->first() }}
@endif

Current Balance

{{ \App\Support\Format::mwkDecimal($currentBalance ?? 0) }}

Posted income − expenses

Expected In (30d)

{{ \App\Support\Format::mwkDecimal($expectedIn30 ?? 0) }}

Pending inflows

Going Out (30d)

{{ \App\Support\Format::mwkDecimal($goingOut30 ?? 0) }}

Pending outflows

Net Position

{{ \App\Support\Format::mwkDecimal($net) }}

Balance + expected in − going out

Clear

Money In — {{ $periodLabel ?? '' }}

@if($inflows->isEmpty())

No money-in records found

Add an expected inflow or adjust your filters.

@else @foreach($inflows as $i) @php $src = $i->client?->company_name ?: $i->inflow_type; $dt = $i->is_received ? $i->actual_date : $i->expected_date; $badge = $i->is_received ? 'g' : 'a'; $st = $i->is_received ? 'Received' : 'Expected'; @endphp @endforeach
Client/Source Project Amount Date Status
{{ $src }} @if($i->project_id) {{ $i->project?->name ?? 'Project #'.$i->project_id }} @else General @endif {{ \App\Support\Format::mwkDecimal($i->amount) }} {{ $dt?->format('M j, Y') }} {{ $st }} @if(!$i->is_received) @else Received @endif
@endif

Money Out — {{ $periodLabel ?? '' }}

@if($outflows->isEmpty())

No money-out records found

Add an expected outflow or adjust your filters.

@else @foreach($outflows as $o) @php $pay = $o->payable_to ?? $o->supplier?->company_name ?? 'General'; $dt = $o->is_paid ? $o->paid_date : $o->due_date; if ($o->is_paid) { $badge = 'g'; $st = 'Paid'; } elseif ($o->due_date && $o->due_date->isPast()) { $badge = 'r'; $st = 'Overdue'; } else { $badge = 'a'; $st = 'Pending'; } @endphp @endforeach
Payable To Type Project Amount Due / Paid Status
{{ $pay }} {{ $o->outflow_type }} @if($o->project_id) {{ $o->project?->name ?? '#'.$o->project_id }} @else General @endif {{ \App\Support\Format::mwkDecimal($o->amount) }} {{ $dt?->format('M j, Y') }} {{ $st }} @if(!$o->is_paid) @else Paid @endif
@endif
@include('cashflow.partials.mark-received-modal') @include('cashflow.partials.mark-paid-modal') @endsection @push('scripts') @endpush