Files
ladill-pos/resources/views/pos/settings.blade.php
T
isaaccladandClaude Opus 4.8 d4f4821d96
Deploy Ladill POS / deploy (push) Successful in 23s
Restaurant mode Phase 3: table-QR self-ordering into the kitchen
The "links" slice — a guest scans a table's QR, browses the menu (with
modifiers), and submits an order that lands on that table's open tab and fires
straight to the Kitchen Display.

- Public, auth-free flow scoped by an unguessable table short_code:
  GET /t/{code} (menu + client cart), POST /t/{code}/order (throttled),
  GET /t/{code}/done. Orders open/append the table's dine-in tab, add lines as
  source=guest, and send to the kitchen.
- Staff print a per-table QR (Settings → table → QR; renders client-side to the
  public menu URL). short_code is generated lazily.
- Guest lines are badged on the ticket and the KDS so staff can tell them apart;
  staff still settle the tab as usual (cash / Ladill Pay).
- Extracted PosSaleService::buildProductLine as the single product+modifier
  price resolver, now shared by staff and guest ordering (client prices never
  trusted).

Schema additive: pos_tables.short_code, pos_sale_lines.source. New
PosRestaurantTest covers the guest order firing to the kitchen; suite green (12).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 20:13:28 +00:00

103 lines
6.6 KiB
PHP

<x-app-layout title="Settings">
<div class="mx-auto max-w-2xl space-y-6">
<div>
<h1 class="text-lg font-semibold text-slate-900">Settings</h1>
<p class="mt-1 text-sm text-slate-500">Register location, receipt footer, and catalog imports.</p>
</div>
<form method="POST" action="{{ route('pos.settings.update') }}" class="space-y-4 rounded-2xl border border-slate-200 bg-white p-6">
@csrf
@method('PUT')
<h2 class="text-sm font-semibold text-slate-900">Location</h2>
<div>
<label for="name" class="text-sm font-medium text-slate-700">Register name</label>
<input type="text" id="name" name="name" value="{{ old('name', $location->name) }}" required
class="mt-1.5 block w-full rounded-xl border-slate-300 text-sm shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
</div>
<div>
<label for="currency" class="text-sm font-medium text-slate-700">Currency</label>
<input type="text" id="currency" name="currency" value="{{ old('currency', $location->currency) }}" maxlength="3" required
class="mt-1.5 block w-full rounded-xl border-slate-300 text-sm uppercase shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
</div>
<div>
<label for="service_style" class="text-sm font-medium text-slate-700">Service style</label>
<select id="service_style" name="service_style"
class="mt-1.5 block w-full rounded-xl border-slate-300 text-sm shadow-sm focus:border-indigo-500 focus:ring-indigo-500">
<option value="retail" @selected(old('service_style', $location->service_style) === 'retail')>Retail quick register checkout</option>
<option value="restaurant" @selected(old('service_style', $location->service_style) === 'restaurant')>Restaurant / café tables, tabs & kitchen display</option>
</select>
<p class="mt-1 text-xs text-slate-400">Restaurant mode adds the Floor and Kitchen screens to the sidebar.</p>
</div>
<div>
<label for="receipt_footer" class="text-sm font-medium text-slate-700">Receipt footer</label>
<textarea id="receipt_footer" name="receipt_footer" rows="3"
class="mt-1.5 block w-full rounded-xl border-slate-300 text-sm shadow-sm focus:border-indigo-500 focus:ring-indigo-500">{{ old('receipt_footer', $location->receipt_footer) }}</textarea>
</div>
<div class="flex justify-end">
<button type="submit" class="btn-primary">Save settings</button>
</div>
</form>
<section class="rounded-2xl border border-slate-200 bg-white p-6">
<h2 class="text-sm font-semibold text-slate-900">Import catalog</h2>
<p class="mt-1 text-sm text-slate-500">Pull products into your local POS catalog from CRM or Merchant storefronts.</p>
<div class="mt-4 flex flex-wrap gap-3">
<form method="POST" action="{{ route('pos.settings.import-crm') }}">
@csrf
<button type="submit" class="rounded-xl border border-slate-200 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50">
Import from CRM
</button>
</form>
@if ($merchantImportEnabled)
<form method="POST" action="{{ route('pos.settings.import-merchant') }}">
@csrf
<button type="submit" class="rounded-xl border border-slate-200 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50">
Import from Merchant
</button>
</form>
@endif
</div>
</section>
@if ($location->isRestaurant())
<section class="rounded-2xl border border-slate-200 bg-white p-6">
<h2 class="text-sm font-semibold text-slate-900">Tables</h2>
<p class="mt-1 text-sm text-slate-500">Dine-in tables shown on the Floor screen.</p>
<form method="POST" action="{{ route('pos.settings.tables.store') }}" class="mt-4 grid gap-2 sm:grid-cols-[1fr_1fr_5rem_auto]">
@csrf
<input type="text" name="area" placeholder="Area (e.g. Patio)"
class="rounded-xl border-slate-300 text-sm focus:border-indigo-500 focus:ring-indigo-500">
<input type="text" name="label" placeholder="Label (e.g. T1)" required
class="rounded-xl border-slate-300 text-sm focus:border-indigo-500 focus:ring-indigo-500">
<input type="number" name="seats" value="2" min="1" max="99" placeholder="Seats"
class="rounded-xl border-slate-300 text-sm focus:border-indigo-500 focus:ring-indigo-500">
<button type="submit" class="btn-primary">Add</button>
</form>
@if ($tables->isNotEmpty())
<ul class="mt-4 divide-y divide-slate-100">
@foreach ($tables as $table)
<li class="flex items-center justify-between py-2.5 text-sm">
<span>
<span class="font-medium text-slate-900">{{ $table->label }}</span>
<span class="text-slate-400">· {{ $table->area ?: 'Floor' }} · {{ $table->seats }} seats · {{ $table->isFree() ? 'free' : 'occupied' }}</span>
</span>
<div class="flex items-center gap-3">
<a href="{{ route('pos.tables.qr', $table) }}" class="text-sm font-medium text-indigo-600 hover:text-indigo-800">QR</a>
<form method="POST" action="{{ route('pos.settings.tables.destroy', $table) }}"
onsubmit="return confirm('Remove this table?');">
@csrf
@method('DELETE')
<button class="text-sm font-medium text-red-500 hover:text-red-700">Remove</button>
</form>
</div>
</li>
@endforeach
</ul>
@endif
</section>
@endif
</div>
</x-app-layout>