Reporte de Ventas Variedades La revolución de los Precios bajos

Desde: {{ $fromDate }} | Hasta: {{ $toDate }}

@php $totalGeneral = 0; $ventasPorDia = []; @endphp @foreach($ventas as $venta) @php $fecha = $venta->created_at->format('Y-m-d'); $ventasPorDia[$fecha][] = $venta; $totalGeneral += $venta->total; @endphp @endforeach @foreach($ventasPorDia as $fecha => $ventasDelDia) @php $totalDia = 0; @endphp @foreach($ventasDelDia as $venta) @php $totalDia += $venta->total; @endphp @endforeach @endforeach
Fecha Cliente Total Detalles
Ventas del día: {{ $fecha }}
{{ $venta->created_at->format('Y-m-d') }} {{ $venta->cliente->nombre ?? 'Sin cliente' }} ${{ number_format($venta->total, 2) }} @foreach($venta->detalles as $detalle) {{ $detalle->producto->nombre ?? 'Producto eliminado' }} x {{ $detalle->cantidad }}
@endforeach
Total del día ${{ number_format($totalDia, 2) }}
Total General ${{ number_format($totalGeneral, 2) }}