@extends('layouts.app') @section('title', 'Análisis de Proveedores') @section('content')
| # | Proveedor | RIF/NIT | Teléfono | Facturas | Total Compras | Total Pagado | Total Pendiente | Deuda Actual | Promedio por Factura | Días Promedio de Pago |
|---|---|---|---|---|---|---|---|---|---|---|
| {{ $index + 1 }} |
{{ $item['supplier']->business_name }}
@if($item['supplier']->contact_name)
{{ $item['supplier']->contact_name }} @endif |
{{ $item['supplier']->tax_id ?? 'N/A' }} | {{ $item['supplier']->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['average_amount'], 2) }} | @if($item['avg_payment_days'] > 0) {{ number_format($item['avg_payment_days'], 0) }} días @else N/A @endif |
| No se encontraron compras en el período seleccionado. | ||||||||||
| Totales: | {{ number_format(array_sum(array_column($analysis, 'invoice_count')), 0) }} | ${{ number_format(array_sum(array_column($analysis, 'total_amount')), 2) }} | ${{ number_format(array_sum(array_column($analysis, 'total_paid')), 2) }} | ${{ number_format(array_sum(array_column($analysis, 'total_due')), 2) }} | ${{ number_format(array_sum(array_column($analysis, 'current_debt')), 2) }} | - | - | |||