@extends('layouts.app') @section('title', 'Análisis de Margen') @section('content')
| # | Producto | SKU | Categoría | Cantidad | Ingresos | Costos | Margen | Margen % |
|---|---|---|---|---|---|---|---|---|
| {{ $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['total_revenue'], 2) }} | ${{ number_format($item['total_cost'], 2) }} | ${{ number_format($item['total_margin'], 2) }} | {{ number_format($item['margin_percentage'], 2) }}% |
| No se encontraron ventas en el período seleccionado. | ||||||||
| Totales: | {{ number_format(array_sum(array_column($productAnalysis, 'total_quantity')), 2) }} | ${{ number_format($totalRevenue, 2) }} | ${{ number_format($totalCost, 2) }} | ${{ number_format($totalMargin, 2) }} | {{ number_format($totalMarginPercentage, 2) }}% | |||