@extends('layouts.app') @section('title', 'Análisis ABC') @section('content')

Análisis ABC de Productos

{{-- Fixed route reference --}} Volver a Reportes Exportar Excel
Filtros
Limpiar
Categoría A
@php $categoryA = array_filter($products, fn($p) => $p['category'] == 'A'); $totalA = array_sum(array_column($categoryA, 'total_revenue')); $percentageA = $totalRevenue > 0 ? ($totalA / $totalRevenue) * 100 : 0; @endphp

{{ count($categoryA) }}

Productos (80% del valor)


Ingresos: ${{ number_format($totalA, 2) }}
Porcentaje: {{ number_format($percentageA, 2) }}%

Categoría B
@php $categoryB = array_filter($products, fn($p) => $p['category'] == 'B'); $totalB = array_sum(array_column($categoryB, 'total_revenue')); $percentageB = $totalRevenue > 0 ? ($totalB / $totalRevenue) * 100 : 0; @endphp

{{ count($categoryB) }}

Productos (15% del valor)


Ingresos: ${{ number_format($totalB, 2) }}
Porcentaje: {{ number_format($percentageB, 2) }}%

Categoría C
@php $categoryC = array_filter($products, fn($p) => $p['category'] == 'C'); $totalC = array_sum(array_column($categoryC, 'total_revenue')); $percentageC = $totalRevenue > 0 ? ($totalC / $totalRevenue) * 100 : 0; @endphp

{{ count($categoryC) }}

Productos (5% del valor)


Ingresos: ${{ number_format($totalC, 2) }}
Porcentaje: {{ number_format($percentageC, 2) }}%

Clasificación ABC de Productos {{ count($products) }} productos
@forelse($products as $index => $item) @empty @endforelse @if(count($products) > 0) @endif
# Categoría Producto SKU Ventas (Unidades) Ingresos % Individual % Acumulado Stock Actual Costo Promedio Valor Inventario
{{ $index + 1 }} {{ $item['category'] }} {{ $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['percentage'], 2) }}% {{ number_format($item['cumulative_percentage'], 2) }}% {{ number_format($item['current_stock'], 2) }} ${{ 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_column($products, 'total_sold')), 2) }} ${{ number_format($totalRevenue, 2) }} 100% - - - ${{ number_format(array_sum(array_column($products, 'inventory_value')), 2) }}
Información sobre el Análisis ABC
Categoría A:

Productos de alto valor (80% de los ingresos). Requieren control estricto y atención prioritaria.

Categoría B:

Productos de valor medio (15% de los ingresos). Requieren control moderado.

Categoría C:

Productos de bajo valor (5% de los ingresos). Control básico y revisión periódica.

@endsection