@extends('layouts.app') @section('title', __('billing::messages.sessions.title')) @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 @section('content') {{-- ── Page head ──────────────────────────────────────────────────────── --}}

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

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

{{-- The open drawer, promoted to the action slot. A cashier arriving at this screen is either opening one or going back to theirs. --}} @if ($openSession !== null) {{ $openSession->reference }} @endif
@if ($openSession === null)
{{ __('billing::messages.sessions.no_open_session') }}
@can('create', \App\Modules\Billing\Models\CashSession::class)
@csrf
@endcan @else
{{ __('billing::messages.sessions.already_open') }}
@endif
@forelse ($sessions as $session) @empty @endforelse
{{ __('billing::messages.sessions.reference') }} {{ __('billing::messages.sessions.cashier') }} {{ __('billing::messages.sessions.opened_at') }} {{ __('billing::messages.sessions.closed_at') }} {{ __('billing::messages.sessions.variance') }} {{ __('common.status') }}
{{ $session->reference }} {{ $session->cashier->name }} {{ $session->opened_at->format('Y-m-d H:i') }} {{ $session->closed_at?->format('Y-m-d H:i') ?? '—' }} {{-- A drawer still open has no variance yet, which is a different thing from a variance of nothing. --}} @if ($session->variance === null) — @elseif ($session->variance->isZero()) {{ __('billing::messages.sessions.reconciled') }} @else {{ $session->variance->toMajor() }} @endif {{ $session->status->label() }}

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

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

@if ($sessions->hasPages())
{{ $sessions->links() }}
@endif
@endsection