@extends('layouts.admin') @section('title', 'Meu Caixa') @section('breadcrumb') Meu Caixa @endsection @push('styles') @endpush @section('content') {{-- Alerts --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error') || $errors->any())
{{ session('error') ?? $errors->first() }}
@endif {{-- ─── HERO STATUS ─────────────────────────────────────────── --}}
@if($openCashbox) Caixa Aberto @else Caixa Fechado @endif
@if($openCashbox) Meu Caixa — Turno em Andamento @else Meu Caixa — Nenhum Turno Aberto @endif
@if($openCashbox) Aberto em {{ $openCashbox->opened_at->format('d/m/Y \à\s H:i') }} · Conta: {{ $openCashbox->account?->name ?? 'N/D' }} @else Abra o caixa para registrar pagamentos neste turno. @endif
@if($openCashbox) @endif
@if($openCashbox)
Saldo Inicial
R$ {{ number_format((float)$openCashbox->opening_balance, 2, ',', '.') }}
Entradas
R$ {{ number_format($openCashbox->total_credits, 2, ',', '.') }}
Saídas
R$ {{ number_format($openCashbox->total_debits, 2, ',', '.') }}
Saldo Esperado
R$ {{ number_format($openCashbox->expected_balance, 2, ',', '.') }}
@endif
{{-- ══════════════ COLUNA PRINCIPAL ══════════════ --}}
@if($openCashbox) {{-- Movimentações do turno --}}
Movimentações do Turno Ver completo →
@php $movs = $openCashbox->transactions()->orderByDesc('transacted_at')->limit(15)->get(); @endphp @forelse($movs as $mov)
{{ $mov->description }}
{{ $mov->transacted_at->format('d/m H:i') }}
{{ $mov->type === 'credit' ? '+' : '-' }}R$ {{ number_format((float)$mov->amount, 2, ',', '.') }}
@empty
Nenhuma movimentação neste turno ainda.
@endforelse
{{-- Pagamentos do turno --}}
Pagamentos do Turno
@php $payments = $openCashbox->payments()->with(['method','reservation.guest'])->where('status','active')->get(); @endphp @forelse($payments as $p)
{{ $p->reservation?->locator }} — {{ $p->reservation?->guest?->full_name }}
{{ $p->method?->name }} · {{ $p->paid_at->format('H:i') }}
R$ {{ number_format((float)$p->amount, 2, ',', '.') }}
@empty
Nenhum pagamento neste turno.
@endforelse
@endif {{-- Histórico de Caixas --}}
Histórico de Caixas
@forelse($recentCashboxes as $cx)
{{ $cx->opened_at->format('d/m/Y') }} {{ $cx->isOpen() ? 'Aberto' : 'Fechado' }}
{{ $cx->opened_at->format('H:i') }} → {{ $cx->closed_at?->format('H:i') ?? '...' }} · {{ $cx->account?->name ?? 'N/D' }}
R$ {{ number_format($cx->expected_balance, 2, ',', '.') }}
Ver →
@empty
Nenhum caixa registrado ainda.
@endforelse
{{-- ══════════════ SIDEBAR ══════════════ --}}
{{-- Abrir Caixa --}} @if(!$openCashbox)
Abrir Caixa
@csrf
@error('financial_account_id'){{ $message }}@enderror
@endif {{-- Status Info do Caixa Aberto --}} @if($openCashbox)
Status do Turno
Conta{{ $openCashbox->account?->name }}
Abertura{{ $openCashbox->opened_at->format('d/m/Y H:i') }}
Fundo InicialR$ {{ number_format((float)$openCashbox->opening_balance, 2, ',', '.') }}
Entradas+ R$ {{ number_format($openCashbox->total_credits, 2, ',', '.') }}
Saídas− R$ {{ number_format($openCashbox->total_debits, 2, ',', '.') }}
Saldo Esperado R$ {{ number_format($openCashbox->expected_balance, 2, ',', '.') }}
@endif
{{-- ══════════════ MODAL FECHAR CAIXA ══════════════ --}} @if($openCashbox) @endif @endsection @push('scripts') @endpush