{{ $orderDetail->show_formatted_order_number }}

@if ($orderDetail->order_type == 'pickup') @elseif($orderDetail->order_type == 'delivery') @else @endif {{ Str::title($orderDetail->orderType?->order_type_name ?? $orderDetail->custom_order_type_name ?? $orderDetail->order_type) }}
@if ($orderDetail->order_type == 'dine_in') @if (!is_null($orderDetail->table))

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

@if(user_can('Update Order')) @endif
@elseif(user_can('Update Order')) @lang('modules.order.setTable') @endif @else

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

@endif
@if ($orderDetail->customer_id)
{{ $orderDetail->customer->name }}
@if(user_can('Update Order')) @endif
@elseif(user_can('Update Order')) + @lang('modules.order.addCustomerDetails') @endif
{{ $orderDetail->date_time->timezone(timezone())->format(dateFormat() . ' ' . timeFormat()) }}
($orderDetail->status == 'draft'), 'bg-yellow-100 text-yellow-800 dark:bg-yellow-700 dark:text-yellow-400 border border-yellow-400' => ($orderDetail->status == 'kot'), 'bg-blue-100 text-blue-800 dark:bg-blue-700 dark:text-blue-400 border border-blue-400' => ($orderDetail->status == 'billed'), 'bg-green-100 text-green-800 dark:bg-gray-700 dark:text-green-400 border border-green-400' => ($orderDetail->status == 'paid'), 'bg-red-100 text-red-800 dark:bg-red-700 dark:text-red-400 border border-red-400' => ($orderDetail->status == 'canceled'), ])> @lang('modules.order.' . $orderDetail->status)
@if ($orderDetail->order_status->value === 'cancelled') @lang('modules.order.info_cancelled') @else
@php $statuses = match($orderDetail->order_type) { '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($orderDetail->order_status->value, $statuses); $currentIndex = $currentIndex !== false ? $currentIndex : 0; $nextIndex = min($currentIndex + 1, count($statuses) - 1); @endphp @if ($orderDetail->order_status->value === 'canceled')

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

@else

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

$orderDetail->order_status->value === 'delivered' || $orderDetail->order_status->value === 'served' || $orderDetail->order_status->value === 'food_ready', 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300' => $orderDetail->order_status->value === 'placed', 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300' => $orderDetail->order_status->value !== 'delivered' && $orderDetail->order_status->value !== 'served' && $orderDetail->order_status->value !== 'placed', ])> {{ App\Enums\OrderStatus::from($orderDetail->order_status->value)->translatedLabel() }}
@foreach($statuses as $index => $status)
{!! App\Enums\OrderStatus::from($status)->icon() !!}
@endforeach
@if(user_can('Update Order'))
@if($orderDetail->order_status->value === '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 ($orderDetail)
@if (user_can('Delete Order') && $orderDetail->status !== 'paid') @endif @forelse ($orderDetail->items->load('modifierOptions') as $key => $item) @php 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 (user_can('Delete Order') && $orderDetail->status !== 'paid') @endif @empty @endforelse
@lang('modules.menu.itemName') @lang('modules.order.qty') @lang('modules.order.price') @lang('modules.order.amount') @lang('app.action')
{{ $item->menuItem->item_name }}
@if (isset($item->menuItemVariation))
{{ $item->menuItemVariation->variation }}
@endif @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, restaurant()->currency_id) }}
@endforeach
@endif
{{ $item->quantity }} {{ currency_format($displayPrice, restaurant()->currency_id) }} {{ currency_format($item->amount, restaurant()->currency_id) }}
@lang('messages.noItemAdded')
@lang('modules.order.totalItem')
{{ count($orderDetail->items) }}
@lang('modules.order.subTotal') @php $stampDiscountAmount = (float)($orderDetail->stamp_discount_amount ?? 0); $hasFreeStampItems = $orderDetail->items()->where('is_free_item_from_stamp', true)->exists(); @endphp @if($stampDiscountAmount > 0 || $hasFreeStampItems) @lang('app.stampDiscount') @if($stampDiscountAmount > 0) (-{{ currency_format($stampDiscountAmount, $currencyId ?? restaurant()->currency_id) }}) @elseif($hasFreeStampItems) (@lang('app.freeItem')) @endif @endif
{{ currency_format($orderDetail->sub_total, restaurant()->currency_id) }}
@if ($orderDetail->loyalty_points_redeemed > 0 && $orderDetail->loyalty_discount_amount > 0)
@lang('loyalty::app.loyaltyDiscount') ({{ number_format($orderDetail->loyalty_points_redeemed) }} @lang('loyalty::app.points'))
-{{ currency_format($orderDetail->loyalty_discount_amount, $currencyId ?? restaurant()->currency_id) }}
@endif @if (!is_null($orderDetail->discount_amount) && $orderDetail->loyalty_points_redeemed == 0)
@lang('modules.order.discount') @if ($orderDetail->discount_type == 'percent') ({{ rtrim(rtrim($orderDetail->discount_value), '.') }}%) @endif
-{{ currency_format($orderDetail->discount_amount, restaurant()->currency_id) }}
@endif @foreach ($extraCharges as $charge)
{{ $charge->charge_name }} @if ($charge->charge_type == 'percent') ({{ $charge->charge_value }}%) @endif @if($orderDetail->status !== 'paid' && user_can('Update Order')) @endif
@php // Calculate discounted subtotal for charges (after both regular and loyalty discounts) $chargeBase = $orderDetail->sub_total - ($orderDetail->discount_amount ?? 0) - ($orderDetail->loyalty_discount_amount ?? 0); @endphp {{ currency_format($charge->getAmount($chargeBase), restaurant()->currency_id) }}
@endforeach @if ($orderDetail->tip_amount > 0)
@lang('modules.order.tip')
{{ currency_format($orderDetail->tip_amount, restaurant()->currency_id) }}
@endif @if ($orderType === 'delivery' && !is_null($deliveryFee))
@lang('modules.delivery.deliveryFee')
@if($deliveryFee > 0) {{ currency_format($deliveryFee, restaurant()->currency_id) }} @else @lang('modules.delivery.freeDelivery') @endif
@endif @if ($taxMode == 'order') @php $net = $orderDetail->sub_total - ($orderDetail->discount_amount ?? 0); $taxBase = $orderDetail->tax_base ?? $net; @endphp @foreach ($orderDetail->taxes as $item)
{{ $item->tax->tax_name }} ({{ $item->tax->tax_percent }}%)
@php // Calculate tax on discounted subtotal (after both regular and loyalty discounts) $discountedSubtotal = $orderDetail->sub_total - ($orderDetail->discount_amount ?? 0) - ($orderDetail->loyalty_discount_amount ?? 0); $taxAmount = ($item->tax->tax_percent / 100) * $discountedSubtotal; @endphp {{ currency_format($taxAmount, restaurant()->currency_id) }}
@endforeach @else @php // Show item-wise tax breakdown using actual order items data $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') @if($taxMode === 'item') @lang(restaurant()->tax_inclusive ? 'modules.settings.taxInclusive' : 'modules.settings.taxExclusive') @endif
{{ currency_format($totalTaxAmount, restaurant()->currency_id) }}
@endif
@lang('modules.order.total')
{{ currency_format($orderDetail->total, restaurant()->currency_id) }}
@if ($orderDetail->status == 'billed' && user_can('Update Order')) @endif @if($orderDetail->status == 'paid') @endif
@endif

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

@lang('modules.order.confirmTableChange')

@lang('modules.order.currentTable'): {{ $orderDetail->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')
{{-- href="{{ route('orders.print', $orderDetail->id) }}" --}}