@extends('layouts.app') @section('title', 'Productos Más Comprados') @section('content')

Productos Más Comprados

Volver a Reportes Exportar Excel
Filtros
Limpiar
Resumen

{{ count($topProducts) }}

Productos Listados

{{ number_format(array_sum(array_column($topProducts, 'total_quantity')), 2) }}

Unidades Compradas

${{ number_format(array_sum(array_column($topProducts, 'total_amount')), 2) }}

Monto Total

Top {{ $limit ?? 50 }} Productos Más Comprados
@forelse($topProducts as $index => $item) @empty @endforelse @if(count($topProducts) > 0) @endif
# Producto SKU Categoría Cantidad Comprada Facturas Precio Promedio Monto Total
{{ $index + 1 }} {{ $item['product']->name }} @if($item['product']->brand)
{{ $item['product']->brand->name }} @endif
{{ $item['product']->sku ?? 'N/A' }} {{ $item['product']->category->name ?? 'N/A' }} {{ number_format($item['total_quantity'], 2) }} {{ number_format($item['invoice_count'], 0) }} ${{ number_format($item['avg_price'], 2) }} ${{ number_format($item['total_amount'], 2) }}
No se encontraron productos comprados en el período seleccionado.
Totales: {{ number_format(array_sum(array_column($topProducts, 'total_quantity')), 2) }} - - ${{ number_format(array_sum(array_column($topProducts, 'total_amount')), 2) }}
@endsection