70 71
72 @forelse($tables as $table) 73 @php 74 $order = $active_orders->get($table->id); 75 $status = $order ? 'occupied' : ($table->table_status ?: 'available'); 76 $availableSeats = max(0, (int)$table->seats - (int)$table->current_persons); 77 78 $customerName = $order ? (optional($order->contact)->name ?: 'Walk-In') : ''; 79 $customerMobile = $order ? (optional($order->contact)->mobile ?: '') : ''; 80 $waiterName = $order ? ($waiter_names[$order->res_waiter_id] ?? '') : ''; 81 $invoiceNo = $order ? ($order->invoice_no ?? '') : ''; 82 $printCount = $order ? (int)($print_counts[$order->id] ?? 0) : 0; 83 84 $searchText = strtolower( 85 ($table->name ?? '') . ' ' . 86 (optional($table->floor)->name ?? '') . ' ' . 87 $invoiceNo . ' ' . 88 $customerName . ' ' . 89 $customerMobile . ' ' . 90 $waiterName 91 ); 92 @endphp 93 94
97 98
100 101
102
103 {{ optional($table->floor)->name ?: 'No Floor' }} 104

{{ $table->name }}

105
106 {{ strtoupper($status) }} 107
108 109
110 Total Seats {{ $table->seats }} 111 Persons {{ $table->current_persons }} 112 Available {{ $availableSeats }} 113
114 115 @if($order) 116
117
Order: {{ $order->invoice_no }}
118
Customer: {{ optional($order->contact)->name ?: 'Walk-In' }}
119 @if(!empty(optional($order->contact)->mobile)) 120
Mobile: {{ optional($order->contact)->mobile }}
121 @endif 122
Waiter: {{ $waiter_names[$order->res_waiter_id] ?? '-' }}
123
Time: {{ @format_datetime($order->transaction_date) }}
124
Total: @format_currency($order->final_total)
125
126 @else 127
No running order
128 @endif 129 130
131 132 137 138
139 140
141 @if($order) 142 144 Open Order 145 146 @else 147 149 New Order 150 151 @endif 152 153 158
159 160
161
162 @empty 163
164
165 No tables found. Add floors and tables first. 166
167
168 @endforelse 169
170 171 172 173 @endsection 174 175 @section('css')