@foreach($zonales as $zonal => $resultados) @foreach($resultados as $resultado) @php $total = $resultado->total_cantidad * $resultado->tarifa; $count = 0; if($resultado->TB) $count++; if($resultado->IB) $count++; if($resultado->TV) $count++; if($resultado->CM) $count++; $divided_total = $count > 0 ? $total / $count : 0; @endphp @endforeach
Tipo Condición Elemento Cantidad Tarifa Total $ TB IB TV CM
{{ $resultado->tipo }} {{ $resultado->condicion }} {{ $resultado->nombre }} {{ $resultado->total_cantidad }} {{ $resultado->tarifa }} {{ $resultado->total_cantidad * $resultado->tarifa }}@if($resultado->TB) {{ $divided_total }} @endif @if($resultado->IB) {{ $divided_total }} @endif @if($resultado->TV) {{ $divided_total }} @endif @if($resultado->CM) {{ $divided_total }} @endif

@endforeach