@lang('modules.report.removedKotItemReportDescription')
{{ $totalRemovedItems }}
{{ currency_format($totalRemovedAmount, $currencyId) }}
@lang('modules.report.noDataAvailable')
@endif@lang('modules.report.noDataAvailable')
@endif| @lang('modules.report.kotNumber') | @lang('modules.report.orderNumber') | @lang('modules.report.removedBy') | @lang('modules.report.itemName') | @lang('modules.report.quantity') | @lang('modules.report.table') | @lang('modules.report.cancellationReason') | @lang('modules.report.removedDate') | @lang('modules.report.totalPrice') |
|---|---|---|---|---|---|---|---|---|
| #{{ $item->kot->kot_number ?? __('modules.report.notAvailable') }} | @if($item->kot && $item->kot->order) {{ $item->kot->order->show_formatted_order_number ?? '#' . $item->kot->order->order_number }} @else @lang('modules.report.notAvailable') @endif |
@if($item->cancelledBy)
{{ $item->cancelledBy->name }}
@if($item->cancelledBy->email)
{{ $item->cancelledBy->email }}
@endif
{{ $item->kot->order->waiter->name }}
@if($item->kot->order->waiter->email)
{{ $item->kot->order->waiter->email }}
@endif
|
@php // Try to get item name from menuItem, then orderItem, then direct query $itemName = __('modules.report.notAvailable'); // First try: menuItem relationship if ($item->menuItem) { $itemName = $item->menuItem->item_name ?? __('modules.report.notAvailable'); } // Second try: orderItem relationship elseif ($item->orderItem && $item->orderItem->menuItem) { $itemName = $item->orderItem->menuItem->item_name ?? __('modules.report.notAvailable'); } // Third try: direct query if menu_item_id exists elseif (isset($item->menu_item_id) && $item->menu_item_id) { try { $menuItem = \App\Models\MenuItem::withoutGlobalScopes()->find($item->menu_item_id); if ($menuItem) { $itemName = $menuItem->item_name ?? __('modules.report.notAvailable'); } } catch (\Exception $e) { // If query fails, keep N/A } } @endphp {{ $itemName }} | {{ $item->quantity }} | @php $notAvailableText = __('modules.report.notAvailable'); $tableName = $notAvailableText; if ($item->kot && $item->kot->order && $item->kot->order->table) { // Table uses table_code field $tableName = $item->kot->order->table->table_code ?? $notAvailableText; } elseif ($item->kot && $item->kot->table) { // Fallback: try kot->table relationship $tableName = $item->kot->table->table_code ?? $notAvailableText; } @endphp @if($tableName !== $notAvailableText) {{ $tableName }} @else @lang('modules.report.notAvailable') @endif | @if($item->cancelReason) {{ $item->cancelReason->reason }} @elseif($item->cancel_reason_text) {{ $item->cancel_reason_text }} @else @lang('modules.report.notAvailable') @endif | {{ $item->updated_at ? \Carbon\Carbon::parse($item->updated_at)->format('M d, Y h:i A') : __('modules.report.notAvailable') }} | @php // Try to get price from menuItemVariation, then menuItem, then orderItem $unitPrice = 0; if ($item->menuItemVariation) { $unitPrice = $item->menuItemVariation->price ?? 0; } elseif ($item->menuItem) { $unitPrice = $item->menuItem->price ?? 0; } elseif ($item->orderItem && $item->orderItem->menuItem) { $unitPrice = $item->orderItem->menuItem->price ?? 0; } $totalPrice = $unitPrice * $item->quantity; @endphp {{ currency_format($totalPrice, $currencyId) }} |
| @lang('modules.report.noRemovedKotItemsFound') | ||||||||
|
@lang('modules.report.total'):
|
{{ currency_format($totalRemovedAmount, $currencyId) }} | |||||||