@extends('layouts.app') @section('title', 'Clientes Más Importantes') @section('content')
Clientes Listados
Total de Ventas
Total Pagado
Deuda Actual
| # | Cliente | RIF/NIT | Teléfono | Facturas | Total Ventas | Total Pagado | Total Pendiente | Deuda Actual | Promedio por Factura | % del Total |
|---|---|---|---|---|---|---|---|---|---|---|
| {{ $index + 1 }} |
{{ $item['client']->business_name }}
@if($item['client']->contact_name)
{{ $item['client']->contact_name }} @endif |
{{ $item['client']->tax_id ?? 'N/A' }} | {{ $item['client']->phone ?? 'N/A' }} | {{ number_format($item['invoice_count'], 0) }} | ${{ number_format($item['total_amount'], 2) }} | ${{ number_format($item['total_paid'], 2) }} | ${{ number_format($item['total_due'], 2) }} | ${{ number_format($item['current_debt'], 2) }} | ${{ number_format($item['avg_amount'], 2) }} | {{ $grandTotal > 0 ? number_format(($item['total_amount'] / $grandTotal * 100), 2) : 0 }}% |
| No se encontraron clientes con ventas en el período seleccionado. | ||||||||||
| Totales: | {{ number_format(array_sum(array_column($topClients, 'invoice_count')), 0) }} | ${{ number_format($grandTotal, 2) }} | ${{ number_format(array_sum(array_column($topClients, 'total_paid')), 2) }} | ${{ number_format(array_sum(array_column($topClients, 'total_due')), 2) }} | ${{ number_format(array_sum(array_column($topClients, 'current_debt')), 2) }} | - | 100% | |||