@php header("Content-Type: application/vnd.ms-excel; charset=UTF-8"); header("Content-Disposition: attachment; filename=Informe_Guias_Actualizadas_" . date('Ymd_His') . ".xls"); header("Pragma: no-cache"); header("Expires: 0"); @endphp
| FECHA | NOMBRE | SKU | CANT | TELEFONO | GUÍA | FLETE | RECAUDO | COSTO | COSTO TOTAL | INVENTARIO | CPA | COMISIONES | UTILIDAD | ESTADO GUIA | PAGOS |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ date('d/m/Y', strtotime($item->fecha)) }} | {{ $item->nombre }} | {{ $item->sku }} | {{ number_format($itemCant, 0, ',', '.') }} | '{{ $item->telefonoDes }} | '{{ $item->GUIA }} | {{ number_format($itemFlete, 2, ',', '.') }} | {{ number_format($itemRecaudo, 2, ',', '.') }} | {{ number_format(floatval($item->costo_caja), 2, ',', '.') }} | {{ number_format($itemCostoTotal, 2, ',', '.') }} | {{ number_format(floatval($item->stock), 2, ',', '.') }} | {{ number_format(floatval(str_replace(['$', ',', ' '], '', $item->cpa ?? 0)), 2, ',', '.') }} | {{ number_format(floatval(str_replace(['$', ',', ' '], '', $item->comision ?? 0)), 2, ',', '.') }} | {{ number_format($itemUtilidad, 2, ',', '.') }} | @php $estadoCode = strtoupper(trim($item->estado)); $label = $item->estado; switch ($estadoCode) { case 'A': $label = 'Alistamiento'; break; case 'V': $label = 'Verificado'; break; case 'C': $label = 'Confirmado'; break; case 'D': $label = 'Despachado'; break; case 'DV': $label = 'Devolución'; break; case 'AN': $label = 'Anulado'; break; } @endphp {{ $label }} | {{ $item->pago }} |
| TOTALES: | {{ number_format($totalCant, 0, ',', '.') }} | {{ number_format($totalFlete, 2, ',', '.') }} | {{ number_format($totalRecaudo, 2, ',', '.') }} | {{ number_format($totalCostoTotal, 2, ',', '.') }} | {{ number_format($totalUtilidad, 2, ',', '.') }} | ||||||||||