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

Análisis de Margen de Ganancia

Volver a Reportes Exportar Excel
Filtros
Limpiar
Ingresos Totales

${{ number_format($totalRevenue, 2) }}

Costos Totales

${{ number_format($totalCost, 2) }}

Margen Total

${{ number_format($totalMargin, 2) }}

Margen %

{{ number_format($totalMarginPercentage, 2) }}%

Análisis de Margen por Producto
@forelse($productAnalysis as $index => $item) @empty @endforelse @if(count($productAnalysis) > 0) @endif
# 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) }}%
@endsection