@isset($exportar) @php header("Cache-Control: maxage=1"); header("Pragma: public"); header('Content-type: application/vnd.ms-excel'); header("Content-Disposition: attachment; filename=Facturas_Resumidas_Factura.xls"); header("Pragma: no-cache"); header("Expires: 0"); @endphp @endisset @isset($factura) @php $totalventa=0; $totalCosto=0; $totalRentabilidad=0; @endphp @foreach ($factura as $key=>$item) @php $rentab=$item->valor-($item->costoCaja + $item->costoFrcc); $totalventa=$totalventa+$item->valor; $totalCosto=$totalCosto+$item->costoCaja + $item->costoFrcc; $totalRentabilidad=$totalRentabilidad+$rentab; @endphp @endforeach @endisset
bodega Tipo_Factu Tipo_Atenci Numero valorVenta totalcosto Rentabilidad Ident Nombre detallef
{{$item->bodegaVenta}} {{$item->tipoFactura}} {{$item->tipoAtencion}} {{$item->factura}} {{$item->valor}} {{$item->costoCaja + $item->costoFrcc}} {{$rentab}} {{$item->cedula}} {{$item->Nombre}} {{$item->detallef}}
______________ ______________ ______________ ______________ ______________ ______________ ______________ ______________ ______________
TOTAL {{$totalventa}} {{$totalCosto}} {{$totalRentabilidad}}