@extends('layouts.app') @section('title', 'Order') @section('content')
Active @can('tables.manage') Table @endcan @can('kitchen.access') KOT @endcan

Orders

All ({{ $counts['all'] }}) Dine In ({{ $counts['dine_in'] }}) Takeaway ({{ $counts['takeaway'] }}) Delivery ({{ $counts['delivery'] }})
+ New Order
@forelse ($orders as $order) @php $isNew = $order->created_at->diffInMinutes(now()) < 5; $paidSoFar = $order->payments->sum('amount') ?? 0; @endphp
{{ $order->table->name ?? ucfirst(str_replace('_',' ',$order->order_type)) }} @if ($isNew) New @endif
{{ ucfirst(str_replace('_',' ',$order->order_type)) }} @if ($order->order_type === 'delivery') {{ $order->channelLabel() }} @endif {{ $order->created_at->diffForHumans() }}
@if ($order->order_type === 'delivery')
@if ($order->external_order_ref)
Ref: {{ $order->external_order_ref }}
@endif @if ($order->assignedRider)
Rider: {{ $order->assignedRider->name }}
@endif @if ($order->delivery_status) {{ ucfirst(str_replace('_',' ',$order->delivery_status)) }} @endif
@endif
    @foreach ($order->items->take(5) as $item)
  • {{ $item->displayName() }} {{ $item->quantity }}
  • @endforeach @if ($order->items->count() > 5)
  • +{{ $order->items->count() - 5 }} more
  • @endif
@if ($order->placed_by_customer && $order->status === 'open')
📱 Placed by customer
@endif
{{ $order->items->count() }} items {{ number_format($order->total, 2) }}
@if ($paidSoFar > 0 && $paidSoFar < $order->total)
Balance due: {{ number_format($order->total - $paidSoFar, 2) }}
@endif Open Order
@empty

No active orders right now.

@endforelse
@endsection