@php $cur = $data['currency']; // Two questions, two answers: what the shift produced, and what is in the // box now. The drawer is what the books get settled against. // What came in is gross, before a cent of it goes back out: the cashier is // being asked what she took, and she cannot take a negative. The drawer is // the netted figure, opening plus everything that moved either way. $expectedTakings = round((float) ($data['inflow'] ?? 0), 2); $expectedDrawer = round((float) $data['opening'] + (float) $data['expected'], 2); // Literal class strings (Tailwind can't see interpolated names). $iconWrap = $accent === 'sky' ? 'bg-sky-50 text-sky-600' : 'bg-emerald-50 text-emerald-600'; @endphp {{-- One reconciliation bucket (Cash or EcoCash). Alpine computes both live differences: the takings one says what happened today, the drawer one is the money that has to be accounted for. Their gap is what was already missing (or already extra) when the day started. --}}
{{-- Header --}}

{{ $title }}

@if ($accounts->count() > 1) @else

{{ $account->name }} · {{ $cur }}

@endif
{{-- The two counts. Takings first, it is the one she does from the shift's own money; the drawer total second, because that is the figure the books are settled against. --}}
{{ $cur }}

@error($takingsModel)

{{ $message }}

@enderror
{{ $cur }}
@error($declaredModel)

{{ $message }}

@enderror {{-- Breakdown: how the expected figure is built, plus the opening check. --}}
{{ __('Opening (carried over)') }} {{ $cur }} {{ number_format((float) $data['opening'], 2) }}
@php // Named lines rather than one lump per category: "transfers // −110.00" tells a cashier nothing, "Transfer to Ashly's Wallet // −110.00" tells her exactly where the money went. $inItems = array_values(array_filter($data['items'] ?? [], fn ($i) => $i['direction'] === 'in')); $outItems = array_values(array_filter($data['items'] ?? [], fn ($i) => $i['direction'] === 'out')); @endphp
{{ __('Came in today') }} + {{ $cur }} {{ number_format((float) ($data['inflow'] ?? 0), 2) }}
@foreach ($inItems as $item)
{{ $item['label'] }} {{ $cur }} {{ number_format((float) $item['amount'], 2) }}
@endforeach
{{ __('Went out today') }} − {{ $cur }} {{ number_format((float) ($data['outflow'] ?? 0), 2) }}
@foreach ($outItems as $item)
{{ $item['label'] }} {{ $cur }} {{ number_format((float) $item['amount'], 2) }}
@endforeach
{{ __('In the account now, in total') }} {{ $cur }} {{ number_format($expectedDrawer, 2) }}
@if ($expectedDrawer < 0)

{{ __('More went out than the account held. Check the amounts, or whether something was booked to the wrong account.') }}

@endif {{-- Opening-balance confirmation / correction (tucked in the breakdown). --}}
{{ $cur }}
{{-- Difference. Both counts get their own verdict: either one being out is a difference somebody has to answer for. --}}
{{ __('Today') }} {{ __('Awaiting count') }} {{ __('Balanced') }} {{ __('Short') }} {{ __('Over') }}
{{ __('In total') }} {{ __('Awaiting count') }} {{ __('Balanced') }} {{ __('Short') }} {{ __('Over') }}
{{-- Where the difference came from. The two counts answer that between them, and it decides the fix: today's gap is usually an unrecorded expense or sale, an older one means the opening balance is wrong. --}} {{-- The day is out but the box totals correctly. Nothing is missing from the account, so there is nothing to record against today: the money that is wrong is the balance carried in. --}}

{{ __('The box totals correctly but the day does not, so the balance carried in was wrong by the same amount. Correct the opening balance above, or give a reason.') }}

@error($reasonModel)

{{ $message }}

@enderror
{{-- Shortage resolution --}}

{{ __('Money is missing, record what it was spent on, or give a reason.') }}

{{ __('Some of this was already there before today, open the expected figure above and correct the opening balance.') }}

@error($reasonModel)

{{ $message }}

@enderror
{{-- Surplus resolution --}}

{{ __('Extra cash on hand, record where it came from, or give a reason.') }}

@error($reasonModel)

{{ $message }}

@enderror
{{-- Sweep: move the counted cash, or leave it. Shown once a figure is entered, and never while correcting a day already recorded, the money was swept (or not) when it was first counted. --}}

{{ __('Otherwise it stays in this account.') }}

@error($sweepToModel)

{{ $message }}

@enderror @error($sweepAmountModel)

{{ $message }}

@enderror