@props(['progress']) @php use App\Support\MoneyFormatter; $max = max(1, collect($progress['series'])->flatMap(fn ($p) => [$p['moved'], $p['received']])->max() ?: 1); @endphp {{-- What actually happened, over the chosen stretch of time. Every figure here comes from money that moved and was referenced, not from money that was merely planned. --}}

{{ __('progress.title') }}

@foreach (\App\Services\Progress\ProgressService::WINDOWS as $window) {{ __('progress.window.'.$window) }} @endforeach

{{ $progress['from']->translatedFormat('j M Y') }} — {{ $progress['to']->translatedFormat('j M Y') }}

@if ($progress['outstanding']->isPositive()) {{ __('progress.outstanding_note', ['amount' => MoneyFormatter::format($progress['outstanding'])]) }} @endif {{-- Received against moved, side by side. Two bars per point, because the gap between them is the story. --}}
{{ __('progress.over_time') }}
@foreach ($progress['series'] as $point)
{{ $point['label'] }}
@endforeach
{{ __('progress.received') }} {{ __('progress.moved') }}
{{-- Consistency: how often a plan was carried through, not how big it was. --}} @if ($progress['periods_total'] > 0)
{{ __('progress.consistency') }}
{{ __('progress.periods_closed', [ 'closed' => $progress['periods_closed'], 'total' => $progress['periods_total'], ]) }}
{{ number_format($progress['consistency'], 0) }}%
@endif