@extends('layouts.app') @section('title', $session->reference) @section('content') @php $pill = static fn (string $tone): string => match ($tone) { 'success' => 'px-pill--green', 'warning' => 'px-pill--amber', 'danger' => 'px-pill--red', 'info' => 'px-pill--blue', 'primary' => 'px-pill--violet', default => 'px-pill--grey', }; @endphp

{{ $session->reference }}

{{ $session->cashier->name }}

{{-- This screen's own way back. Breadcrumbs are deliberately absent across the product, so a detail page reached from a listing carries a single explicit return instead. --}} {{ __('billing::messages.sessions.title') }}
{{ $session->status->label() }} {{ __('billing::messages.sessions.opened_at') }}: {{ $session->opened_at->format('Y-m-d H:i') }} @if ($session->closed_at) {{ __('billing::messages.sessions.closed_at') }}: {{ $session->closed_at->format('Y-m-d H:i') }} @endif
@foreach ($breakdown as $row)
{{ $row['method'] }} ({{ $row['count'] }})
{{ $row['amount']->toMajor() }}
@endforeach @if ($breakdown === [])
{{ __('billing::messages.payments.empty') }}
@endif

{{ __('billing::messages.sessions.cash_only_note') }}

@forelse ($payments as $payment) @empty @endforelse
{{ __('billing::messages.payments.reference') }} {{ __('billing::messages.invoices.singular') }} {{ __('billing::messages.payments.method') }} {{ __('billing::messages.payments.amount') }}
{{ $payment->reference }} @if ($payment->kind->isNegative()) {{ $payment->kind->label() }} @endif {{ $payment->invoice->reference }} {{ $payment->method->name }} {{ $payment->amount->toMajor() }}

{{ __('billing::messages.payments.empty') }}

{{ __('billing::messages.sessions.no_payments_text') }}

{{ __('billing::messages.sessions.opening_float') }}
{{ $session->opening_float->toMajor() }}
{{ __('billing::messages.sessions.expected') }}
{{ $expected?->toMajor() ?? '—' }}
@if (! $session->isOpen())
{{ __('billing::messages.sessions.counted') }}
{{ $session->counted_cash?->toMajor() ?? '—' }}
{{-- The one line anybody looks at on a closed session. Green when the drawer agreed with the system, red when it did not — and the amount is named either way, because "short by 200" is the fact, not "does not reconcile". --}}
! $session->reconciled()])>
{{ __('billing::messages.sessions.variance') }}
@if ($session->reconciled()) {{ __('billing::messages.sessions.reconciled') }} @else {{ $session->variance->isNegative() ? __('billing::messages.sessions.short', ['amount' => $session->variance->absolute()->toMajor()]) : __('billing::messages.sessions.over', ['amount' => $session->variance->toMajor()]) }} @endif
@endif
@can('close', $session)
@csrf {{-- Said plainly, on the screen where it matters: the figure entered here is recorded against the expected one exactly as it falls. --}}

{{ __('billing::messages.sessions.variance_note') }}

@endcan
@endsection