Estado de Cuenta

Fecha de Emisión: {{ date('d/m/Y h:i A') }}

@if(\App\Models\Setting::get('app_logo')) Logo @else

{{ \App\Models\Setting::get('app_name', 'TI Manager') }}

@endif

Reporte de Facturación

@if($targetEntity)

Datos del Cliente

@if($targetEntity instanceof \App\Models\Company)

Empresa: {{ $targetEntity->name }}

NIT: {{ $targetEntity->nit }}

@if($targetEntity->address)

Dirección: {{ $targetEntity->address }}

@endif @if($targetEntity->phone)

Teléfono: {{ $targetEntity->phone }}

@endif @else

Cliente: {{ $targetEntity->name }}

Cédula/NIT: {{ $targetEntity->document }}

@if($targetEntity->phone)

Teléfono: {{ $targetEntity->phone }}

@endif @if($targetEntity->email)

Email: {{ $targetEntity->email }}

@endif @endif
@else

Filtros Aplicados

Búsqueda: {{ request('search', 'Todas las facturas') }}

@if(request('statuses') && is_array(request('statuses')))

Estados: {{ implode(', ', request('statuses')) }}

@endif
@endif @foreach($invoices as $invoice) @php $paid = $invoice->payments->where('status', 'Aprobado')->sum('amount'); $balance = max(0, $invoice->total_amount - $paid); $displayStatus = $invoice->status; if ($displayStatus === 'Sin Pagar' && $paid > 0) { $displayStatus = 'Abonada'; } $badgeClass = $displayStatus === 'Pagado' ? 'bg-green' : ($displayStatus === 'Abonada' ? 'bg-orange' : 'bg-red'); $clientName = $invoice->company_id ? ($invoice->company->name ?? 'N/A') : ($invoice->customer->name ?? 'N/A'); @endphp @endforeach @if($invoices->count() === 0) @endif
Emisión Factura No. Cliente / Empresa Monto Total Abonos Saldo Pendiente Estado
{{ $invoice->issue_date->format('d/m/Y') }} {{ $invoice->document_number }} {{ $clientName }} ${{ number_format($invoice->total_amount, 2) }} ${{ number_format($paid, 2) }} ${{ number_format($balance, 2) }} {{ $displayStatus }}
No se encontraron facturas con los filtros aplicados.
Total Facturado: ${{ number_format($totalInvoiced, 2) }}
Total Abonado / Pagado: ${{ number_format($totalPaid, 2) }}
Saldo Pendiente Total: ${{ number_format($totalPending, 2) }}
Documento generado automáticamente el {{ date('d/m/Y') }} a las {{ date('h:i A') }}