@unless(isset($result[0]->medio_de_pago_id))
|
{{ $result[0]->caja }}
|
@endunless
@php
$cajaActual = '';
$totalCajaActual = 0;
$totalGeneral = 0;
@endphp
@foreach ($result as $item)
{{-- @dd($item) --}}
@php
if($item->caja_nombre != $cajaActual) {
$totalCajaActual = 0;
}
$totalCajaActual += $item->data;
$totalGeneral += $item->data;
@endphp
@unless (isset($item->medio_de_pago_id))
| {{ strtoupper($item->caja_nombre) }} |
@endunless
@if(!$fecha_inicio && !$fecha_fin && $item->data > 0 && $caja)
@isset ($item->medio_de_pago_id)
| {{$item->caja}} |
₡{{ number_format($item->data, 2, ".", ",") }} |
@endisset
@endif
@if($fecha_inicio && $fecha_fin && $item->data > 0 && !$caja || !$fecha_inicio && !$fecha_fin && $item->data > 0 && !$caja)
{{-- @php
if($item->caja_nombre != $cajaActual) {
$totalCajaActual = 0;
}
$totalCajaActual += $item->data;
$totalGeneral += $item->data;
@endphp --}}
@if($item->caja_nombre != $cajaActual)
| {{ strtoupper($item->caja_nombre) }} |
@else
| {{$item->caja}} |
₡{{ number_format($item->data, 2, ".", ",") }} |
@endif
@endif
{{-- @if($item->caja_nombre != $cajaActual) --}}
@if($loop->last || $item->caja_nombre != $result[$loop->index +1]->caja_nombre)
| Total Rubro |
₡{{ number_format($totalCajaActual, 2, ".", ",") }} |
@endif
@php
$cajaActual = $item->caja_nombre;
@endphp
{{-- @endif --}}
@endforeach
| Total General : | ₡{{number_format($totalGeneral, 2, ".", ",")}} |