@extends('layouts.app') @section('titulo', 'Caja '.$caja->codigo) @section('subtitulo', $caja->estaAbierta() ? 'Turno en curso' : 'Turno cerrado') @php $sim = auth()->user()->empresa?->simbolo ?? 'S/'; $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'; $ing = $caja->totalIngresos(); $egr = $caja->totalEgresos(); $esp = $caja->esperado(); @endphp @section('contenido')
Volver a caja {{ $caja->estaAbierta() ? 'ABIERTA' : 'CERRADA' }}
{{-- Resumen --}}
@foreach ([ ['Monto inicial', $sim.' '.number_format($caja->monto_inicial, 2), 'from-brand-500 to-brand-400', 'wallet'], ['Ingresos', $sim.' '.number_format($ing, 2), 'from-emerald-500 to-teal-400', 'cash'], ['Egresos', $sim.' '.number_format($egr, 2), 'from-red-500 to-orange-400', 'receipt'], ['Saldo esperado', $sim.' '.number_format($esp, 2), 'from-violet-500 to-fuchsia-400', 'chart'], ] as [$label, $valor, $color, $icono])
@include('partials.icon', ['name' => $icono, 'class' => 'h-6 w-6'])

{{ $valor }}

{{ $label }}

@endforeach
{{-- Movimientos --}}

Movimientos

{{ $movimientos->count() }}
@forelse ($movimientos as $m)

{{ $m->concepto }}

{{ $m->etiquetaMetodo() }} · {{ $m->created_at->format('d/m H:i') }} @if($m->referencia) · {{ $m->referencia }} @endif

{{ $m->tipo === 'ingreso' ? '+' : '−' }} {{ $sim }} {{ number_format($m->monto, 2) }}

@empty

Sin movimientos registrados.

@endforelse
{{-- Acciones --}}
@if ($caja->estaAbierta())

Registrar movimiento

@csrf

Cerrar caja

Esperado: {{ $sim }} {{ number_format($esp, 2) }}

@csrf
@else

Arqueo final

@foreach ([ 'Saldo esperado' => $sim.' '.number_format($caja->monto_esperado, 2), 'Monto contado' => $sim.' '.number_format($caja->monto_final, 2), 'Cerrada el' => $caja->fecha_cierre?->format('d/m/Y H:i') ?? '—', ] as $label => $valor)
{{ $label }}
{{ $valor }}
@endforeach
Diferencia {{ $sim }} {{ number_format($caja->diferencia, 2) }}
@if ($caja->observacion)

{{ $caja->observacion }}

@endif
@endif
@endsection