@isset($activo) @php $nombreArchivo = 'Vendedor'; if ($agruparPor == 'usuario') $nombreArchivo = 'Usuario'; elseif ($agruparPor == 'marca') $nombreArchivo = 'Marca'; elseif ($agruparPor == 'categoria') $nombreArchivo = 'Categoria'; header("Cache-Control: maxage=1"); header("Pragma: public"); header('Content-type: application/vnd.ms-excel'); header("Content-Disposition: attachment; filename=Resumen_Ventas_".$nombreArchivo.".xls"); header("Pragma: no-cache"); header("Expires: 0"); @endphp @endisset @isset($resultados) @php $totFacturas = 0; $totVentaBruta = 0; $totDevolucion = 0; $totVentaNeta = 0; $totBaseIva = 0; $totTotalIva = 0; @endphp @foreach ($resultados as $item) @php $totFacturas += $item['cant_facturas']; $totVentaBruta += $item['venta_bruta']; $totDevolucion += $item['devolucion']; $totVentaNeta += $item['venta_neta']; $totBaseIva += $item['base_iva']; $totTotalIva += $item['total_iva']; @endphp @endforeach @endisset
@if($agruparPor == 'usuario') Usuario @elseif($agruparPor == 'marca') Codigo Marca @elseif($agruparPor == 'categoria') Codigo Categoria @else Codigo Vendedor @endif @if($agruparPor == 'usuario') Nombre Usuario @elseif($agruparPor == 'marca') Nombre Marca @elseif($agruparPor == 'categoria') Nombre Categoria @else Nombre Vendedor @endif Cant Facturas Venta Bruta Devoluciones Venta Neta Base IVA Total IVA
{{ $item['codigo'] }} {{ $item['nombre'] }} {{ $item['cant_facturas'] }} {{ round($item['venta_bruta'], 2) }} {{ round($item['devolucion'], 2) }} {{ round($item['venta_neta'], 2) }} {{ round($item['base_iva'], 2) }} {{ round($item['total_iva'], 2) }}
TOTAL GENERAL: {{ $totFacturas }} {{ round($totVentaBruta, 2) }} {{ round($totDevolucion, 2) }} {{ round($totVentaNeta, 2) }} {{ round($totBaseIva, 2) }} {{ round($totTotalIva, 2) }}