@if (count($doc->detalles)>0) @php $valor = 0; $desc = 0; $nosujeta = 0; $gravada = 0; $excenta = 0; $iva = 0; $total = 0; @endphp @foreach ($doc->detalles as $key => $item) @php $valor = $valor+ ($item->cantidad*$item->precio_unitario); $desc = $desc+ $item->descuento; $nosujeta = $nosujeta+$item->nosujeta; $gravada = $gravada+$item->gravada; $excenta = $excenta+$item->exenta; $iva = $iva+$item->iva; $total =$total+$item->total; @endphp @endforeach
# Item Cant Unitario Valor Desc Gravada Excenta No Sujeta Iva Total
{{ $key+1 }} @if ($item->producto_id != null) {{ $item->producto->codigo }} {{ $item->producto->producto }} @endif @if ($item->servicio_id != null) {{ $item->servicio->codigo }} {{ $item->servicio->nombre }} @endif {{ $item->cantidad }} {{ number_format($item->precio_unitario,2 ) }} {{ number_format($item->cantidad*$item->precio_unitario,2) }} {{ number_format($item->descuento,2) }} {{ number_format($item->gravada ,2) }} {{ number_format($item->exenta,2) }} {{ number_format($item->nosujeta,2) }} {{ number_format($item->iva,2) }} {{ number_format($item->total,2) }}
TOTAL {{ number_format($valor,2) }} {{ number_format($desc,2) }} {{ number_format($gravada,2) }} {{ number_format($excenta,2) }} {{ number_format($nosujeta,2) }} {{ number_format($iva,2) }} {{ number_format($total,2) }}
@else @endif