@extends('layouts.app') @section('title', 'Análisis de Rentabilidad') @section('content')
Margen Bruto: {{ number_format($grossMargin, 2) }}%
Margen Neto: {{ number_format($netMargin, 2) }}%
| Período | Ingresos | Compras | Gastos | Utilidad Bruta | Utilidad Neta | Margen Bruto % | Margen Neto % |
|---|---|---|---|---|---|---|---|
| {{ $month['period_label'] }} | ${{ number_format($month['revenue'], 2) }} | ${{ number_format($month['purchases'], 2) }} | ${{ number_format($month['expenses'], 2) }} | ${{ number_format($month['gross_profit'], 2) }} | ${{ number_format($month['net_profit'], 2) }} | {{ number_format($month['gross_margin'], 2) }}% | {{ number_format($month['net_margin'], 2) }}% |
| No se encontraron datos en el período seleccionado. | |||||||
| Totales: | ${{ number_format($totalRevenue, 2) }} | ${{ number_format($totalPurchases, 2) }} | ${{ number_format($totalExpenses, 2) }} | ${{ number_format($grossProfit, 2) }} | ${{ number_format($netProfit, 2) }} | {{ number_format($grossMargin, 2) }}% | {{ number_format($netMargin, 2) }}% |
| Categoría | Cantidad Vendida | Ingresos | Costos | Utilidad | Margen % |
|---|---|---|---|---|---|
| {{ $item['category'] }} | {{ number_format($item['quantity'], 2) }} | ${{ number_format($item['revenue'], 2) }} | ${{ number_format($item['cost'], 2) }} | ${{ number_format($item['profit'], 2) }} | {{ number_format($item['margin'], 2) }}% |
| No se encontraron ventas por categoría en el período seleccionado. | |||||
| Totales: | {{ number_format(array_sum(array_column($productAnalysis, 'quantity')), 2) }} | ${{ number_format(array_sum(array_column($productAnalysis, 'revenue')), 2) }} | ${{ number_format(array_sum(array_column($productAnalysis, 'cost')), 2) }} | ${{ number_format(array_sum(array_column($productAnalysis, 'profit')), 2) }} | - |