ESTADO DE CUENTA BANCARIO

@php $company = \App\Models\Empresa::first(); @endphp @if($company) {{ $company->nombre_empresa ?? 'SOSSYSTEM' }}
{{ $company->direccion ?? '' }}
Tel: {{ $company->telefono ?? '' }} | Email: {{ $company->email ?? '' }} @else SOSSYSTEM @endif
Banco: {{ $account->bank->name ?? 'N/A' }}
Número de Cuenta: {{ $account->account_number }}
Titular: {{ $account->account_holder_name }}
Moneda: {{ $account->currency }}
Período: {{ \Carbon\Carbon::parse($dateFrom)->format('d/m/Y') }} - {{ \Carbon\Carbon::parse($dateTo)->format('d/m/Y') }}
Saldo Inicial
{{ number_format($openingBalance, 2) }} {{ $account->currency }}
Total Ingresos
{{ number_format($totalCredits, 2) }} {{ $account->currency }}
Total Egresos
{{ number_format($totalDebits, 2) }} {{ $account->currency }}
Saldo Final
{{ number_format($closingBalance, 2) }} {{ $account->currency }}
@php $runningBalance = $openingBalance; @endphp @foreach($transactions as $transaction) @php $isCredit = in_array($transaction->transaction_type, ['deposit', 'interest', 'transfer_in', 'refund']); $isDebit = in_array($transaction->transaction_type, ['withdrawal', 'fee', 'transfer_out', 'payment']); if ($isCredit) { $runningBalance += $transaction->amount; } else { $runningBalance -= $transaction->amount; } @endphp @endforeach
Fecha Número Referencia Descripción Tipo Ingreso Egreso Saldo Estado
{{ \Carbon\Carbon::parse($transaction->transaction_date)->format('d/m/Y') }} {{ $transaction->transaction_number }} {{ $transaction->reference_number ?? 'N/A' }} {{ $transaction->description ?? 'N/A' }} {{ ucfirst(str_replace('_', ' ', $transaction->transaction_type)) }} @if($isCredit) {{ number_format($transaction->amount, 2) }} @else - @endif @if($isDebit) {{ number_format($transaction->amount, 2) }} @else - @endif {{ number_format($runningBalance, 2) }} @if($transaction->is_reconciled) ✓ Conciliado @else Pendiente @endif
TOTALES: {{ number_format($totalCredits, 2) }} {{ number_format($totalDebits, 2) }} {{ number_format($closingBalance, 2) }}