@extends('layouts.app') @section('titulo', 'Caja / Arqueo') @section('subtitulo', 'Apertura, movimientos y cierre de caja') @php $sim = auth()->user()->empresa?->simbolo ?? 'S/'; @endphp @section('contenido') @if ($abierta) {{-- Caja abierta --}}
@include('partials.icon', ['name' => 'cash', 'class' => 'h-7 w-7'])
ABIERTA {{ $abierta->codigo }}

Caja en curso

Abierta el {{ $abierta->fecha_apertura->format('d/m/Y H:i') }} @if($abierta->responsable) por {{ $abierta->responsable->name }} @endif

Gestionar caja
@foreach ([ ['Monto inicial', $sim.' '.number_format($abierta->monto_inicial, 2)], ['Ingresos', $sim.' '.number_format($abierta->totalIngresos(), 2)], ['Egresos', $sim.' '.number_format($abierta->totalEgresos(), 2)], ['Saldo esperado', $sim.' '.number_format($abierta->esperado(), 2)], ] as [$label, $valor])

{{ $label }}

{{ $valor }}

@endforeach
@else {{-- Abrir caja --}}

Abrir caja

No hay una caja abierta. Registra el monto inicial para comenzar el turno.

@if ($errors->any())
{{ $errors->first() }}
@endif @php $in = 'w-full rounded-xl border border-slate-200 bg-slate-50 px-4 py-2.5 text-sm outline-none focus:border-brand-400 focus:ring-4 focus:ring-brand-100 transition'; @endphp
@csrf
@endif {{-- Historial --}}

Historial de turnos

@forelse ($historial as $c) @empty @endforelse
Código Responsable Cierre Esperado Contado Diferencia
{{ $c->codigo }} {{ $c->responsable?->name ?? '—' }} {{ $c->fecha_cierre?->format('d/m/Y H:i') ?? '—' }} {{ $sim }} {{ number_format($c->monto_esperado, 2) }} {{ $sim }} {{ number_format($c->monto_final, 2) }} {{ $sim }} {{ number_format($c->diferencia, 2) }} Ver
Aún no hay turnos cerrados.
{{ $historial->links() }}
@endsection