{{-- Cierres anteriores --}}
@foreach($cerradas as $hashCierre => $grupoOriginal)
@php
$grupo = collect($grupoOriginal);
$ultimaComanda = $grupo->last();
@endphp
| Hora |
Por |
Producto |
Descuento
|
Cantidad
|
Subtotal
|
@foreach($grupo as $comanda)
|
{{ optional(
$comanda->created_at
)->format('H:i') }}
|
{{ optional(
$comanda->user
)->name }}
|
{{ optional(
$comanda->producto
)->nombre }}
|
@if($comanda->descuento)
{{ $comanda->descuento * 100 }}%
@endif
|
{{ $comanda->cantidad }}
|
${{ number_format(
$comanda->total,
0,
',',
'.'
) }}
|
@endforeach
|
{{ $ultimaComanda
? optional(
$ultimaComanda->updated_at
)->format('H:i')
: ''
}}
|
{{ $ultimaComanda
? optional(
$ultimaComanda->medio
)->nombre
: ''
}}
|
|
|
{{ $grupo->sum('cantidad') }}
|
${{ number_format(
$grupo->sum('total'),
0,
',',
'.'
) }}
|
@if(!$loop->last)
@endif
@endforeach
@if($tieneCerradas && $tienePendientes)
@endif
{{-- Comandas pendientes --}}
@if($tienePendientes)
| Hora |
Por |
Producto |
Cantidad
|
Subtotal
|
Borrar
|
@foreach($pendientes as $comanda)
|
{{ optional(
$comanda->created_at
)->format('H:i') }}
|
{{ optional(
$comanda->user
)->name }}
|
{{ optional(
$comanda->producto
)->nombre }}
|
{{ $comanda->cantidad }}
|
${{ number_format(
$comanda->total,
0,
',',
'.'
) }}
|
|
@endforeach
| Total |
Pendiente de cierre
|
|
{{ $cantidadPendiente }}
|
${{ number_format(
$totalPendiente,
0,
',',
'.'
) }}
|
|
@elseif(!$tieneCerradas)
Esta mesa no tiene comandas.
@endif