@php // POS_QUICK_CHARGE:preamble — placeholder MenuItem JSON for classic AJAX cart (see addPosQuickChargeClientSide) $posQuickChargePlaceholderId = null; $posQuickChargePlaceholderPayload = null; if (function_exists('module_enabled') && module_enabled('PosQuickCharge') && function_exists('restaurant_modules') && in_array('PosQuickCharge', restaurant_modules())) { try { $pqcMi = \Modules\PosQuickCharge\Services\PlaceholderMenuItemService::ensurePlaceholderForBranch(branch()->id); $posQuickChargePlaceholderId = (int) $pqcMi->id; if (! empty($orderTypeId)) { $normDel = (($selectedDeliveryApp ?? null) === 'default' || empty($selectedDeliveryApp)) ? null : (int) $selectedDeliveryApp; $pqcMi->setPriceContext((int) $orderTypeId, $normDel); } $nm = $pqcMi->item_name; $label = is_array($nm) ? (string) ($nm[app()->getLocale()] ?? $nm['en'] ?? reset($nm) ?? '') : (string) $nm; $posQuickChargePlaceholderPayload = [ 'id' => $pqcMi->id, 'name' => $label, 'item_name' => $label, 'price' => (float) $pqcMi->price, 'image' => null, 'taxes' => $pqcMi->taxes->map(function ($t) { return [ 'id' => (int) $t->id, 'tax_name' => (string) $t->tax_name, 'tax_percent' => (float) $t->tax_percent, ]; })->values()->all(), 'variationsCount' => 0, 'modifiersCount' => 0, ]; } catch (\Throwable $e) { $posQuickChargePlaceholderId = null; $posQuickChargePlaceholderPayload = null; } } $posqcToast = function (string $key, string $fallback): string { $t = __($key); return ($t === $key) ? $fallback : $t; }; $posqcMsgCartBad = $posqcToast('posquickcharge::app.cart_bad_payload', 'Invalid quick charge data. Please try again.'); $posqcMsgNamePrice = $posqcToast('posquickcharge::app.cart_enter_name_and_price', 'Please enter an item name and a valid unit price.'); $posqcMsgNoPlaceholder = $posqcToast('posquickcharge::app.cart_placeholder_id_missing', 'PosQuickCharge has no placeholder item for this branch. Enable the module, run migrations, and reload the POS.'); $posqcMsgFetchFail = $posqcToast('posquickcharge::app.cart_placeholder_fetch_failed', 'Could not load the placeholder menu item. Check your connection and try again.'); $posQcEnsurePlaceholderUrl = url('ajax/pos/pos-quick-charge/ensure-placeholder'); @endphp
@if(config('app.debug') && app()->environment('development'))

{{ __('messages.posOfflineDebugHint') }}

@endif {{-- MultiPOS: registration modals / pending & declined overlays (active device label is in navigation-menu by stop impersonate) --}} @if(module_enabled('MultiPOS') && in_array('MultiPOS', restaurant_modules())) @include('multipos::partials.pos-registration', [ 'hasPosMachine' => $hasPosMachine, 'machineStatus' => $machineStatus, 'posMachine' => $posMachine, 'limitReached' => $limitReached, 'limitMessage' => $limitMessage, 'shouldBlockPos' => $shouldBlockPos ]) @endif {{-- Only render POS content if not blocked by registration/pending/declined --}} @if(!$shouldBlockPos) {{-- Restaurant availability banner (outside operating hours) --}} @if(!empty($showRestaurantClosedBanner) && !empty($restaurantClosedMessage))
{{ $restaurantClosedMessage }}
@endif {{-- Offline: order queued on device (replaces success toast) --}} {{-- Order type modal: pure Blade + JS (prices prefetched in window.posOrderTypePriceMaps) --}} @include('pos.partials.order-type-modal', [ 'orderTypes' => $orderTypes ?? [], 'deliveryPlatforms' => $deliveryPlatforms ?? collect(), 'posDeliveryPlatformsForModal' => $posDeliveryPlatformsForModal ?? [], ]) {{-- Below lg: pad whole stack; lg+: outer pt-0 so fixed cart stays full viewport — menu column adds lg:pt-16 to clear fixed nav (same as app main pt-16). --}}
@include('pos.menu', ['posMenuFiltersInline' => true])
{{-- Keeps menu width when cart is position:fixed (out of flex flow). --}} {{-- lg+: fixed cart flush to top; clicks over the right column pass through POS nav (navigation-menu pointer-events) so the cart header stays usable under z-50 nav. --}}
@php $showOrderDetail = request()->boolean('show-order-detail'); @endphp @if (!$orderDetail || ($orderDetail && $orderDetail->status == 'draft')) @include('pos.kot_items') @elseif($orderDetail && $orderDetail->status == 'kot') @php // Get current KOT ID for print functionality $currentKot = $orderDetail->kot()->orderBy('created_at', 'desc')->first(); $currentKotId = $currentKot ? $currentKot->id : null; @endphp @if($currentKotId) @endif @if($showOrderDetail) @include('pos.order_items') @else @include('pos.kot_items') @endif @elseif($orderDetail && in_array($orderDetail->status, ['billed', 'paid', 'payment_due'])) @include('pos.order_detail') @endif
{{-- Variation Modal --}} @if(module_enabled('Hotel') && in_array('Hotel', restaurant_modules())) @include('hotel::pos.show-stay') @endif {{-- KOT Note Modal --}} {{-- Item Note Modal --}} {{-- Table Modal --}} {{-- Discount Modal --}} {{-- Offline payment (queued to localStorage; syncs via ajax.pos.sync-offline-payment) --}} {{-- Inline Tailwind Confirm Popover (anchored near clicked button) --}} {{-- Loyalty Redemption (AJAX POS) - $posLoyaltyEnabled passed from PosController (tt parity) --}} @if($posLoyaltyEnabled ?? false) @endif {{-- Print Options Modal (AJAX/JS-based) --}} {{-- Error Modal --}} {{-- Modifiers Modal: compact width, scroll body, pinned actions --}} {{-- Table Change Modal --}} @endif
@push('scripts') @vite(['resources/js/pos-offline.js']) @endpush