@if ($order)

{{ $order->show_formatted_order_number }}
@php $tokenNumber = $order->kot->whereNotNull('token_number')->first()?->token_number; @endphp @if ($tokenNumber)
@lang('modules.order.tokenNumber') {{ $tokenNumber }}
@endif
@if ($order->order_type == 'pickup') @elseif($order->order_type == 'delivery') @else @endif {{ Str::title($order->orderType?->order_type_name ?? $order->custom_order_type_name ?? $order->order_type) }}
@if($order->order_type == 'pickup')
@lang('modules.order.pickupDate') {{ \Carbon\Carbon::parse($order->pickup_date)->translatedFormat('M d, Y h:i A') }}
@else
{{ $order->date_time->timezone(timezone())->translatedFormat('M d, Y h:i A') }}
@endif

@if ($order->order_type == 'dine_in') @if (!is_null($order->table))
!user_can('Update Order'), ])>

{{ $order->table->table_code ?? '--' }}

@if(user_can('Update Order')) @endif
@elseif(user_can('Update Order')) @lang('modules.order.setTable') @endif @endif
@if ($order->customer_id)
{{ $order->customer ? ($order->customer->name ? $order->customer->name : __('modules.customer.walkin')) : '--' }}
@if(user_can('Update Order')) @endif
@elseif(user_can('Update Order')) + @lang('modules.order.addCustomerDetails') @endif
{{ $order->date_time->timezone(timezone())->translatedFormat('M d, Y h:i A') }}
@if ($order->order_type == 'delivery')
@if ($order->deliveryPlatform)
@if ($order->deliveryPlatform->logo_url) {{ $order->deliveryPlatform->name }} @endif {{ $order->deliveryPlatform->name }}
@endif @if ($order->deliveryExecutive)
@lang('modules.order.deliveryExecutive')
{{ $order->deliveryExecutive->name }}
@else @foreach ($deliveryExecutives as $deliveryExecutive) @endforeach @endif
@endif
@if (user_can('Update Order') && !auth()->user()->roles->pluck('display_name')->contains('Waiter'))
@foreach ($users as $item) @endforeach
@elseif($selectWaiter)
@lang('modules.order.waiter'): {{ optional($users->firstWhere('id', $selectWaiter))->name }}
@endif
$order->status == 'draft', 'bg-yellow-100 text-yellow-800 dark:bg-yellow-700 dark:text-yellow-400 border border-yellow-400' => $order->status == 'kot', 'bg-blue-100 text-blue-800 dark:bg-gray-700 dark:text-blue-400 border border-blue-400' => $order->status == 'billed' || $order->status == 'out_for_delivery', 'bg-green-100 text-green-800 dark:bg-gray-700 dark:text-green-400 border border-green-400' => $order->status == 'paid' || $order->status == 'delivered', 'bg-red-100 text-red-800 dark:bg-gray-700 dark:text-red-400 border border-red-400' => $order->status == 'canceled' || $order->status == 'payment_due', 'bg-orange-100 text-orange-800 dark:bg-gray-700 dark:text-orange-400 border border-orange-400' => $order->status == 'pending_verification', ])> @lang('modules.order.' . $order->status) @if($order->placed_via) $order->placed_via === 'pos', 'bg-emerald-100 text-emerald-800 dark:bg-emerald-700 dark:text-emerald-400 border border-emerald-400' => $order->placed_via === 'shop', 'bg-amber-100 text-amber-800 dark:bg-amber-700 dark:text-amber-400 border border-amber-400' => $order->placed_via === 'kiosk', ])> @if($order->placed_via === 'pos') @elseif($order->placed_via === 'shop') @elseif($order->placed_via === 'kiosk') @endif {{ __('app.via_' . $order->placed_via) }} {{ module_enabled('Kiosk') && class_exists(\Modules\Kiosk\Entities\Kiosk::class) && ($order->kiosk) ? ' : ' . $order->kiosk->code : '' }} @endif
@if ($orderProgressStatus === 'cancelled')

@lang('modules.order.info_cancelled')

@if ($order->cancelReason || $order->cancel_reason_text)
@if ($order->cancelReason)
@lang('modules.settings.kotCancelReasons'): {{ $order->cancelReason->reason }}
@endif @if ($order->cancel_reason_text)
@lang('modules.settings.enterCancelReason'):
{{ $order->cancel_reason_text }}
@endif
@endif
@else
@php $statuses = match ($order->order_type) { 'delivery' => ['placed', 'confirmed', 'preparing', 'food_ready', 'out_for_delivery', 'delivered'], 'pickup' => ['placed', 'confirmed', 'preparing', 'ready_for_pickup', 'delivered'], default => ['placed', 'confirmed', 'preparing', 'food_ready', 'served'], }; $currentIndex = array_search($orderProgressStatus, $statuses); $currentIndex = $currentIndex !== false ? $currentIndex : 0; $nextIndex = min($currentIndex + 1, count($statuses) - 1); @endphp

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

$orderProgressStatus === 'delivered' || $orderProgressStatus === 'served' || $orderProgressStatus === 'food_ready', 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300 border border-gray-400' => $orderProgressStatus === 'placed', 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300 border border-blue-400' => $orderProgressStatus !== 'delivered' && $orderProgressStatus !== 'served' && $orderProgressStatus !== 'placed', ])> {{ App\Enums\OrderStatus::from($orderProgressStatus)->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($orderProgressStatus === 'placed') {{ __('modules.order.cancelOrder') }} @endif @if($currentIndex < count($statuses) - 1) {{ __('modules.order.moveTo') }} {{ App\Enums\OrderStatus::from($statuses[$nextIndex])->translatedLabel() }} @endif
@endif
@endif @endif
@if ($order)
@if (!in_array($order->status, ['paid', 'payment_due', 'canceled']) && user_can('Delete Order')) @endif @forelse ($order->items as $key => $item) @php $orderTypeId = $order->order_type_id; $selectedDeliveryApp = $order?->delivery_app_id; if ($orderTypeId) { $item->menuItem->setPriceContext($orderTypeId, $selectedDeliveryApp); if ($item->menuItemVariation) { $item->menuItemVariation->setPriceContext($orderTypeId, $selectedDeliveryApp); } foreach ($item->modifierOptions as $modifier) { $modifier->setPriceContext($orderTypeId, $selectedDeliveryApp); } } // Get prices with context applied $baseItemPrice = $item->menuItemVariation ? $item->menuItemVariation->price : $item->menuItem->price; $modifierTotal = $item->modifierOptions->sum('pivot.modifier_option_price'); $displayPrice = $baseItemPrice + $modifierTotal; @endphp @if (!in_array($order->status, ['paid', 'payment_due', 'canceled']) && user_can('Delete Order')) @endif @empty @endforelse
@lang('modules.menu.itemName') @lang('modules.order.qty') @lang('modules.order.amount') @lang('app.action')
{{ $item->menuItem ? $item->menuItem->item_name : '--' }}
{{ isset($item->menuItemVariation) ? $item->menuItemVariation->variation : '' }}
@if ($item->modifierOptions->isNotEmpty())
@foreach ($item->modifierOptions as $modifier)
{{ $modifier->name ?? $modifier->pivot->modifier_option_name }} {{ currency_format($modifier->pivot->modifier_option_price ?? $modifier->price , $currencyId) }}
@endforeach
@endif
{{ $item->quantity }} {{ currency_format($item->amount, $currencyId) }}
@lang('messages.noItemAdded')
@lang('modules.order.totalItem')
{{ count($order->items) }}
@lang('modules.order.subTotal')
{{ currency_format($order->sub_total, $currencyId) }}
@if (!is_null($order->discount_amount))
@lang('modules.order.discount') @if ($order->discount_type == 'percent') ({{ rtrim(rtrim(number_format($order->discount_value, 2), '0'), '.') }}%) @endif
-{{ currency_format($order->discount_amount, $currencyId) }}
@endif @foreach ($order->charges as $item)
{{ $item->charge->charge_name }} @if ($item->charge->charge_type == 'percent') ({{ $item->charge->charge_value }}%) @endif @if (!in_array($order->status, ['paid', 'payment_due', 'canceled'])) @endif
{{ currency_format($item->charge->getAmount($order->sub_total - ($order->discount_amount ?? 0)), $currencyId) }}
@endforeach @if ($order->tip_amount > 0)
@lang('modules.order.tip')
{{ currency_format($order->tip_amount, $currencyId) }}
@endif @if ($order->order_type === 'delivery' && !is_null($order->delivery_fee))
@lang('modules.delivery.deliveryFee')
@if($order->delivery_fee > 0) {{ currency_format($order->delivery_fee, $currencyId) }} @else @lang('modules.delivery.freeDelivery') @endif
@endif @if ($taxMode == 'order') @foreach ($order->taxes as $item)
{{ $item->tax->tax_name }} ({{ $item->tax->tax_percent }}%)
{{ currency_format(($item->tax->tax_percent / 100) * ($order->sub_total - ($order->discount_amount ?? 0)), restaurant()->currency_id) }}
@endforeach @else @if($order->total_tax_amount > 0) @php $taxTotals = []; $totalTax = 0; foreach ($order->items as $item) { $qty = $item->quantity ?? 1; $taxBreakdown = is_array($item->tax_breakup) ? $item->tax_breakup : (json_decode($item->tax_breakup, true) ?? []); foreach ($taxBreakdown as $taxName => $taxInfo) { if (!isset($taxTotals[$taxName])) { $taxTotals[$taxName] = [ 'percent' => $taxInfo['percent'] ?? 0, 'amount' => ($taxInfo['amount'] ?? 0) * $qty ]; } else { $taxTotals[$taxName]['amount'] += ($taxInfo['amount'] ?? 0) * $qty; } } $totalTax += $item->tax_amount ?? 0; } @endphp @foreach ($taxTotals as $taxName => $taxInfo)
{{ $taxName }} ({{ $taxInfo['percent'] }}%) {{ currency_format($taxInfo['amount'], $currencyId) }}
@endforeach
@lang('modules.order.totalTax')
{{ currency_format($totalTax, $currencyId) }}
@endif @endif
@lang('modules.order.total')
{{ currency_format($order->total, $currencyId) }}
@lang('modules.order.balanceReturn')
@php $totalBalance = $order->payments->sum('balance'); @endphp {{ currency_format($totalBalance > 0 ? $totalBalance : 0, $currencyId) }}
@if ($order->status == 'kot' && !is_null($order->table_id)) @endif @if (($order->status == 'billed' || $order->status == 'payment_due') && user_can('Update Order')) @endif
@lang('app.print') @if (in_array($order->status, ['billed', 'payment_due', 'paid']) && user_can('Delete Order')) @endif @if (!in_array($order->status, ['paid', 'payment_due', 'canceled'])) @if (user_can('Delete Order')) @endif @endif
@if ($order->payments->count())
@foreach ($order->payments as $key => $item) @endforeach
@lang('modules.order.amount') @lang('modules.order.paymentMethod') @lang('app.dateTime')
{{ currency_format($item->amount, $currencyId) }}
@if($order->status !== 'pending_verification' && user_can('Update Order')) @foreach(['cash', 'card', 'upi', 'due' , 'bank_transfer'] as $method) @endforeach @else
$item->payment_method == 'due', 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-400 border border-gray-400' => $item->payment_method != 'due', ])> @php $icons = [ 'cash' => '', 'upi' => '', 'card' => '' ]; @endphp {!! $icons[$item->payment_method] ?? '' !!} @lang('modules.order.' . $item->payment_method)
@endif
@if ($item->payment_method == 'due' && user_can('Update Order')) @lang('modules.order.addPayment') @elseif ($order->status == 'pending_verification' && user_can('Update Order')) @lang('modules.order.confirmPayment') @lang('modules.order.reportUnpaid') @else {{ $item->created_at->timezone(timezone())->translatedFormat('d M, Y h:i A') }} @endif
@endif @if ($order->order_type == 'delivery' && $order->delivery_address)
@lang('modules.customer.address')
@if($order->customer_lat && $order->customer_lng && branch()->lat && branch()->lng) @lang('modules.order.viewOnMap') @endif
{!! nl2br(e($order->delivery_address)) !!}
@endif @endif
{{ __('app.close') }}
@if ($order) @lang('modules.table.availableTables') @livewire('pos.setTable')

@lang('modules.order.cancelOrder')

This action cannot be undone

@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.cancelOrder')

This action cannot be undone

@lang('modules.order.cancelOrderMessage')

Please select a reason for cancellation

@foreach ($cancelReasons as $reason) @endforeach
{{ __('app.cancel') }} @lang('modules.order.cancelOrder')
@lang('modules.order.deleteOrderItem')? @lang('modules.order.deleteOrderItemMessage') {{ __('app.cancel') }} @if ($itemToDelete) {{ __('Delete') }} @endif
@lang('modules.order.changeTable')

@lang('modules.order.confirmTableChange')

@lang('modules.order.currentTable'): {{ $order->table->table_code ?? '--' }}

@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')
@endif @script @endscript