@extends('admin.reports.pdf.layout') @php $reportBadge = 'Extrato Financeiro'; $reportTitle = 'Relatório de Transações'; $totalCredit = $transactions->where('type','credit')->sum('amount'); $totalDebit = $transactions->where('type','debit')->sum('amount'); $netBalance = $totalCredit - $totalDebit; @endphp @section('content') {{-- KPIs --}}
Total Entradas
R$ {{ number_format($totalCredit,2,',','.') }}
{{ $transactions->where('type','credit')->count() }} lançamentos
Total Saídas
R$ {{ number_format($totalDebit,2,',','.') }}
{{ $transactions->where('type','debit')->count() }} lançamentos
Saldo Líquido
{{ $netBalance >= 0 ? '+' : '-' }}R$ {{ number_format(abs($netBalance),2,',','.') }}
{{ $netBalance >= 0 ? 'Saldo positivo' : 'Saldo negativo' }}
Total de Lançamentos
{{ $transactions->count() }}
no período selecionado
{{-- Tabela de Transações --}}
🧾 Detalhamento de Lançamentos
@forelse($transactions as $t) @empty @endforelse
Data/Hora Descrição Reserva Usuário Tipo Valor
{{ $t->transacted_at->format('d/m/Y') }}
{{ $t->transacted_at->format('H:i') }}
{{ $t->description }} @if($t->notes)
{{ $t->notes }}@endif
@if($t->reservation) #{{ $t->reservation->locator }}
{{ $t->reservation->guest?->full_name }} @else @endif
{{ $t->createdBy?->name ?? '—' }} @if($t->type === 'credit') ▲ Entrada @else ▼ Saída @endif {{ $t->type === 'credit' ? '+' : '-' }}R$ {{ number_format($t->amount,2,',','.') }}
Nenhuma transação no período.
TOTAL DO PERÍODO {{ $netBalance >= 0 ? '+' : '-' }}R$ {{ number_format(abs($netBalance),2,',','.') }}
@endsection