@php use App\Models\CutoverConfirmation; $typeBadge = [ 'bank' => 'indigo', 'cash' => 'emerald', 'mobile_money' => 'sky', 'director' => 'amber', 'other' => 'slate', ]; $statusBadge = [ CutoverConfirmation::STATUS_PENDING => 'slate', CutoverConfirmation::STATUS_CONFIRMED => 'emerald', CutoverConfirmation::STATUS_DISPUTED => 'amber', CutoverConfirmation::STATUS_APPROVED => 'sky', ]; $tz = config('app.display_timezone'); $mine = count($rows); $done = $mine - $outstanding; $metrics = [ [ 'label' => __('Floats you hold'), 'value' => number_format($mine), 'icon' => 'wallet', 'accent' => '#124a61', 'sub' => __('Cash, pocket & mobile money'), ], [ 'label' => __('Declared'), 'value' => number_format($done) . ' / ' . number_format($mine), 'icon' => 'check-circle', 'accent' => $outstanding === 0 ? '#10b981' : '#0ea5e9', 'sub' => $outstanding === 0 ? __('You are done') : trans_choice('{1} :count still to count|[2,*] :count still to count', $outstanding, ['count' => $outstanding]), ], [ 'label' => __('Value declared'), 'value' => $baseCode . ' ' . number_format($declaredBase, 2), 'icon' => 'banknotes', 'accent' => '#8b5cf6', 'sub' => __('Your floats, in base currency'), ], [ 'label' => __('Declare by'), 'value' => $cutover?->due_at ? $cutover->due_at->timezone($tz)->format('j M Y') : __('Not open'), 'icon' => 'clock', 'accent' => $cutover?->isOverdue() ? '#f43f5e' : '#f59e0b', // Their own clock, not the team's. It is the number that answers // "how long have I got", which the team deadline alone does not. 'sub' => $cutover?->isOverdue() ? __('Past due') : ($campaign ? __('Day :day of :total', ['day' => $campaign->dayNumber(), 'total' => \App\Models\CutoverCampaign::WINDOW_DAYS]) : __('Workspace cut-over')), ], ]; @endphp
@if ($canStart && $cutover !== null && ! $cutover->isOpen()) {{-- The window closed when its last account settled, but the screen stays readable. Starting a fresh one is how a float that appeared afterwards, a new cashier, a new wallet, gets declared rather than assumed. --}} {{ __('Open a new punch-in') }} @endif @if ($canApprove) {{ __('Confirmations') }} {{ __('Books cut-over') }} @endif {{-- What this screen does to the books, before anybody types a number. --}}

{{ __('Why you are being asked') }}

{{ __('The company has moved to a fresh workspace. Everything you configured came across, but no balances did, because a float balance is only ever as good as the person holding it.') }}

{{ __('Count it, type it, confirm it. The figure is brought onto the books as an opening balance, which invents no sale and no cost. If it does not match what the books already show, a director signs it off, nothing is lost either way.') }}

{{ __('Bank accounts are not here on purpose: they are reconciled from the bank statement rather than declared.') }}

@if ($cutover === null) {{-- Nothing to declare until a director opens the window. --}} @if ($canStart) {{ __('Open the punch-in') }} {{ __('Opening…') }} @endif @else
@foreach ($metrics as $m)

{{ $m['label'] }}

{{ $m['value'] }}

{{ $m['sub'] }}
@endforeach
{{-- ── Your floats ─────────────────────────────────────────── --}}

{{ __('What you are holding') }}

{{ __('One row per float in your name. Count it before you type it.') }}

@if ($outstanding === 0 && $mine > 0) {{ __('All declared') }} @endif
@forelse ($rows as $row) @php $account = $row['account']; $confirmation = $row['confirmation']; $variance = $confirmation ? (float) $confirmation->variance : $row['preview']; $status = $confirmation?->status ?? CutoverConfirmation::STATUS_PENDING; @endphp @empty @endforelse
{{ __('Account') }} {{ __('Books say') }} {{ __('You count') }} {{ __('Variance') }} {{ __('Status') }} {{ __('Actions') }}

{{ $account->name }}

{{ $account->type_label }} {{ $account->currency_code }}

{{ number_format($row['system'], 2) }}
{{ $variance === null ? '—' : number_format($variance, 2) }} {{ CutoverConfirmation::STATUSES[$status] ?? $status }} @if ($confirmation?->confirmed_at)

{{ $confirmation->confirmed_at->timezone($tz)->format('j M Y, H:i') }}

@endif @if ($confirmation?->hasPendingAdjustment())

{{ __('Change with a director') }}

@elseif ($confirmation?->adjustmentWasDeclined())

{{ __('Change declined') }}

@endif
@php // A figure nobody has agreed to yet is still a draft and can simply // be re-counted. An AGREED one is where the account's books begin, // so changing it is a request, unless you are the person who signs // such things off. $agreed = $confirmation?->isSettled() ?? false; $label = ! $confirmation ? __('Confirm') : ($agreed ? ($canApprove ? __('Change & sign') : __('Request change')) : __('Re-declare')); @endphp {{ $label }} {{ __('Saving…') }} @if ($agreed)

{{ __('Needs a reason') }}

@endif
@if ($canApprove) {{-- ── Sign-off queue ────────────────────────────────────── Deliberately thin: phase 5 builds the full four-eyes flow on the same approved_by / approved_at columns. ─────────────────────────────────────────────────────────── --}}

{{ __('Waiting on a director') }}

{{ __('Declarations that do not match the books. The money is already on the books; this is the signature.') }}

@forelse ($signOffQueue as $item) @empty @endforelse
{{ __('Holder') }} {{ __('Account') }} {{ __('Declared') }} {{ __('Variance') }} {{ __('Note') }} {{ __('Actions') }}
{{ $item->user?->name ?? '—' }} {{ $item->fundAccount?->name ?? '—' }} {{ $item->fundAccount?->currency_code }} {{ number_format((float) $item->declared_amount, 2) }} {{ number_format((float) $item->variance, 2) }} {{ $item->note ?: '—' }}
{{-- ── Who is still to punch in ───────────────────────────── --}}

{{ __('Team progress') }}

{{ __('Every float in the workspace and who has to declare it. Opened :when.', [ 'when' => $cutover->started_at->timezone($tz)->format('j M Y, H:i'), ]) }}

@foreach ($progress as $item) @php $account = $item['account']; $confirmation = $item['confirmation']; $status = $confirmation?->status ?? CutoverConfirmation::STATUS_PENDING; @endphp @endforeach
{{ __('Account') }} {{ __('Holder') }} {{ __('Declared') }} {{ __('Status') }}
{{ $account->name }} {{ $account->type_label }} {{ $account->holder?->name ?? '—' }} {{ $confirmation ? $account->currency_code.' '.number_format((float) $confirmation->declared_amount, 2) : '—' }} {{ CutoverConfirmation::STATUSES[$status] ?? $status }}
@endif @endif