@if(!isOrderPrefixEnabled()) @lang('modules.order.orderNumber') #{{ $orderNumber }} @else {{ $formattedOrderNumber }} @endif
@if ($orderType == 'dine_in')
{{ $tableNo }} @if (user_can('Update Order')) @endif
@if(user_can('Update Order')) @lang('modules.order.setTable') @endif
@else
{{ $customer->name ?? '' }}
@if(user_can('Update Order')) @endif
@endif
@if ($orderType == 'dine_in')
@lang('modules.order.noOfPax')
@if (auth()->user()->roles->pluck('display_name')->contains('Waiter') || $isWaiterLocked)
@lang('modules.order.waiter'): {{ $waiterName }}
@elseif(user_can('Update Order'))
@foreach ($users as $item) @endforeach
@elseif($currentWaiter)
@lang('modules.order.waiter'): {{ $waiterName }}
@endif @endif @if ($orderType == 'delivery' && user_can('Update Order'))
@foreach ($deliveryExecutives as $item) @endforeach
@endif @if ($orderType == 'pickup')
@endif
@if ($orderStatus->value === 'cancelled') @lang('modules.order.info_cancelled') @else
@php $statuses = match ($orderType) { 'delivery' => ['placed', 'confirmed', 'preparing', 'food_ready','picked_up', 'out_for_delivery', 'reached_destination', 'delivered'], 'pickup' => ['placed', 'confirmed', 'preparing', 'ready_for_pickup', 'delivered'], default => ['placed', 'confirmed', 'preparing', 'food_ready', 'served'], }; $currentIndex = array_search($orderStatus->value, $statuses); $currentIndex = $currentIndex !== false ? $currentIndex : 0; $nextIndex = min($currentIndex + 1, count($statuses) - 1); @endphp

{{ __('modules.order.orderStatus') }}

$orderStatus->value === 'delivered' || $orderStatus->value === 'served', 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300' => $orderStatus->value === 'placed', 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300' => $orderStatus->value !== 'delivered' && $orderStatus->value !== 'served' && $orderStatus->value !== 'placed', ])> {{ App\Enums\OrderStatus::from($orderStatus->value)->translatedLabel() }}
@foreach ($statuses as $index => $status)
{!! App\Enums\OrderStatus::from($status)->icon() !!}
{{ App\Enums\OrderStatus::from($status)->translatedLabel() }}
@endforeach
@if (user_can('Update Order'))
@if ($orderStatus->value === 'placed') {{ __('modules.order.cancelOrder') }} @endif @if ($currentIndex < count($statuses) - 1) {{ __('modules.order.moveTo') }} {{ App\Enums\OrderStatus::from($statuses[$nextIndex])->translatedLabel() }} @endif
@endif
@endif @foreach ($kotList as $kot) @php $hasItems = false; foreach ($orderItemList as $key => $item) { if (strpos($key, 'kot_' . $kot->id . '_') === 0) { $hasItems = true; break; } } @endphp @if ($hasItems)
@lang('menu.kot') #{{ $kot->kot_number }}
{{ $kot->created_at->timezone(timezone())->translatedFormat('d F, h:i A') }}
@endif @endforeach @if (count($orderItemList) === 0 && isset($orderDetail) && $orderDetail && $orderDetail->status === 'kot') @php $fallbackKotItems = collect(); if (!$orderDetail->relationLoaded('kot')) { $orderDetail->load('kot.items.menuItem', 'kot.items.menuItemVariation', 'kot.items.modifierOptions'); } foreach ($orderDetail->kot as $kot) { $fallbackKotItems = $fallbackKotItems->merge($kot->items->where('status', '!=', 'cancelled')); } @endphp @foreach ($fallbackKotItems as $kotItem) @php $isFreeItemFromStamp = (bool) ($kotItem->is_free_item_from_stamp ?? false); $expectedAmount = (float) ($kotItem->price ?? 0) * (int) ($kotItem->quantity ?? 1); $actualAmount = (float) ($kotItem->amount ?? 0); $stampDiscountAmount = !$isFreeItemFromStamp ? max(0, $expectedAmount - $actualAmount) : 0; $hasStampDiscount = $stampDiscountAmount > 0.01; @endphp
{{ $kotItem->menuItem->item_name ?? __('app.item') }} @if ($isFreeItemFromStamp) @lang('app.freeItem') @elseif($hasStampDiscount) @lang('app.stampDiscount') (-{{ currency_format($stampDiscountAmount, restaurant()->currency_id) }}) @endif
{{ __('modules.order.qty') }}: {{ $kotItem->quantity }}
@if ($isFreeItemFromStamp)
{{ currency_format(0, restaurant()->currency_id) }} {{ currency_format($expectedAmount, restaurant()->currency_id) }}
@elseif($hasStampDiscount)
{{ currency_format($actualAmount, restaurant()->currency_id) }} {{ currency_format($expectedAmount, restaurant()->currency_id) }}
@else {{ currency_format($actualAmount, restaurant()->currency_id) }} @endif
@endforeach @endif
@if (user_can('Add Discount on POS'))
@lang('modules.order.addDiscount')
@endif
@lang('modules.order.totalItem')
{{ count($orderItemList) }}
@lang('modules.order.subTotal') @php $stampDiscountAmount = 0; $hasFreeStampItems = false; if (isset($orderID) && $orderID && isset($orderDetail) && $orderDetail) { $stampDiscountAmount = (float)($orderDetail->stamp_discount_amount ?? 0); $hasFreeStampItems = $orderDetail->items()->where('is_free_item_from_stamp', true)->exists(); } else { foreach (($orderItemList ?? []) as $itemKey => $itemValue) { $note = $itemNotes[$itemKey] ?? ''; $rawFreeFlag = is_array($itemValue) ? ($itemValue['is_free_item_from_stamp'] ?? false) : ($itemValue->is_free_item_from_stamp ?? false); $isFlaggedFree = in_array($rawFreeFlag, [true, 1, '1', 'true'], true); if ( str_starts_with((string)$itemKey, 'free_stamp_') || $isFlaggedFree || str_contains((string)$note, __('loyalty::app.freeItemFromStamp')) || str_starts_with(strtolower(trim((string)$note)), 'free') ) { $hasFreeStampItems = true; break; } } } @endphp @lang('app.stampDiscount') @if($stampDiscountAmount > 0) (-{{ currency_format($stampDiscountAmount, restaurant()->currency_id) }}) @elseif($hasFreeStampItems) (@lang('app.freeItem')) @endif
{{ currency_format($subTotal, restaurant()->currency_id) }}
@if(function_exists('module_enabled') && module_enabled('Loyalty'))
@include('loyalty::components.loyalty-discount-display', [ 'loyaltyPointsRedeemed' => $loyaltyPointsRedeemed ?? 0, 'loyaltyDiscountAmount' => $loyaltyDiscountAmount ?? 0, 'currencyId' => restaurant()->currency_id, 'showEditIcon' => true, 'customer' => $customer ?? null ])
@endif
@lang('modules.order.discount') @if ($discountType == 'percent') ({{ $discountValue }}%) @endif @if(user_can('Add Discount on POS') && user_can('Update Order')) @endif
-{{ currency_format($discountAmount, restaurant()->currency_id) }}
@php $applicableExtraCharges = collect($extraCharges ?? [])->filter(function ($charge) use ($orderType) { $allowedTypes = $charge->order_types ?? []; return empty($allowedTypes) || in_array($orderType, $allowedTypes); }); @endphp
@if (count($orderItemList) > 0 && $extraCharges) @foreach ($extraCharges as $charge)
{{ $charge->charge_name }} @if ($charge->charge_type == 'percent') ({{ $charge->charge_value }}%) @endif @if (user_can('Update Order')) @endif
{{ currency_format($charge->getAmount($discountedTotal), restaurant()->currency_id) }}
@endforeach @endif
@if ($tipAmount > 0)
@lang('modules.order.tip')
{{ currency_format($tipAmount, restaurant()->currency_id) }}
@endif @if ($orderType === 'delivery' && !is_null($deliveryFee))
@lang('modules.delivery.deliveryFee') @lang('modules.delivery.freeDelivery')
@if ($deliveryFee > 0) {{ currency_format($deliveryFee, restaurant()->currency_id) }} @else @lang('modules.delivery.freeDelivery') @endif
@endif @if ($taxMode == 'order')
@foreach ($taxes as $item)
{{ $item->tax_name }} ({{ $item->tax_percent }}%)
{{ currency_format(($item->tax_percent / 100) * $taxBase, restaurant()->currency_id) }}
@endforeach
@else @php $taxTotals = []; foreach ($orderItemTaxDetails as $item) { $qty = $item['qty'] ?? 1; if (!empty($item['tax_breakup'])) { foreach ($item['tax_breakup'] as $taxName => $taxInfo) { if (!isset($taxTotals[$taxName])) { $taxTotals[$taxName] = [ 'percent' => $taxInfo['percent'], 'amount' => 0 ]; } $taxTotals[$taxName]['amount'] += $taxInfo['amount'] * $qty; } } } @endphp
@foreach ($taxTotals as $taxName => $taxInfo)
{{ $taxName }} ({{ $taxInfo['percent'] }}%)
{{ currency_format($taxInfo['amount'], restaurant()->currency_id) }}
@endforeach
@lang('modules.order.totalTax')
{{ currency_format($totalTaxAmount, restaurant()->currency_id) }}
@endif
@lang('modules.order.total')
{{ currency_format($total, restaurant()->currency_id) }}
@if ($orderDetail->status == 'kot' && user_can('Update Order'))
@lang('modules.order.newKot') @if (user()->hasRole('Admin_'. user()->restaurant_id)) @endif
@endif @if ($orderDetail->status == 'billed' && user_can('Update Order'))
@endif @if ($orderType == 'delivery' && $orderDetail->delivery_address)
@if ($orderDetail->customer)
{{ $orderDetail->customer->name }}
@endif
@lang('modules.customer.address')
@if ($orderDetail->customer_lat && $orderDetail->customer_lng && branch()->lat && branch()->lng) @lang('modules.order.viewOnMap') @endif
{!! nl2br(e($orderDetail->delivery_address)) !!}
@endif
{{--

@lang('modules.order.cancelOrder')

@lang('modules.order.cancelOrderMessageUndone')

@lang('modules.order.cancelOrderMessage')

Please select a reason for cancellation

@foreach ($cancelReasons as $reason) @endforeach
{{ __('app.cancel') }} @lang('modules.order.cancelOrder')
@lang('modules.order.deleteOrder')? @lang('modules.order.deleteOrderMessage') {{ __('app.cancel') }} @lang('modules.order.deleteOrder')
@lang('modules.order.changeTable')

@lang('modules.order.confirmTableChange')

@lang('modules.order.currentTable'): {{ $tableNo }}

@if($pendingTable)

@lang('modules.order.changeTo'): {{ $pendingTable->table_code }}

@endif

@lang('modules.order.tableChangeMessage')

@lang('modules.order.tableChangeWarning')

@lang('app.cancel') @lang('modules.order.changeTable')
--}}