@extends('layouts.app') @section('title', 'Rotación de Inventario') @section('content')
| # | Producto | SKU | Ventas (Unidades) | Ingresos | Stock Promedio | Stock Actual | Rotación | Días para Rotar | Costo Promedio | Valor Inventario |
|---|---|---|---|---|---|---|---|---|---|---|
| {{ isset($paginatedTurnover) ? (($paginatedTurnover->currentPage() - 1) * $paginatedTurnover->perPage() + $index + 1) : ($index + 1) }} |
{{ $item['product']->name }}
@if($item['product']->category)
{{ $item['product']->category->name }} @endif |
{{ $item['product']->sku ?? 'N/A' }} | {{ number_format($item['total_sold'], 2) }} | ${{ number_format($item['total_revenue'], 2) }} | {{ number_format($item['avg_stock'], 2) }} | {{ number_format($item['current_stock'], 2) }} | {{ number_format($item['turnover_rate'], 2) }}x | {{ number_format($item['days_to_turnover'], 0) }} días | ${{ number_format($item['avg_cost'], 2) }} | ${{ number_format($item['inventory_value'], 2) }} |
| No se encontraron productos con ventas en el período seleccionado. | ||||||||||
| Totales: | {{ number_format(array_sum(array_map(function($item) { return $item['total_sold'] ?? 0; }, $turnover)), 2) }} | ${{ number_format(array_sum(array_map(function($item) { return $item['total_revenue'] ?? 0; }, $turnover)), 2) }} | - | - | - | - | - | ${{ number_format(array_sum(array_map(function($item) { return $item['inventory_value'] ?? 0; }, $turnover)), 2) }} | ||