feat(waiter): close with unpaid items as a setting, combine lines, seats (platform-v2 step 4.8a)

The owner's choices for 4.8 (2026-11-18), all configurable:
- Setting orders.close_with_unpaid (default off): when off, the server refuses to close
  an order with unpaid items (pos.order_unpaid) and the phone's CLOSE takes the payment
  first ("instant-pay close"); when on, CLOSE confirms and the items stay unpaid. Manager
  Settings → Operation, next to "auto-close after full payment" (unchanged).
- POST /api/orders/{id}/items/combine: unpaid lines of the same item (choices, note,
  price, course, kitchen state; no discount / deal / tab) become one line; the phone
  offers "Combine into one line" for selected lines or a grouped line. The grouping
  views (identical / same item) stay as they were.
- Seats: the table's seats next to its name on the cards (waiter Settings → Layout, on by
  default) and in the guests dialog, where more guests than seats only shows a hint.
- The table screen's last English-only labels (ADD, PAY, CLOSE, ACTIONS, SERVED, CLEAR,
  ALL) are keys too.
- Tests: test_close_and_combine.py (5), waiter e2e +5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 09:54:37 +02:00
co-authored by Claude Opus 5.5
parent beb53c65bb
commit 198f8ff571
18 changed files with 376 additions and 39 deletions
@@ -3,6 +3,7 @@ import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
import toast from 'react-hot-toast'
import client from '../../../api/client'
import RolePermissions from '../sections/RolePermissions'
import { useTranslation } from '@xenia/i18n'
function Toggle({ checked, onChange, disabled }) {
return (
@@ -372,6 +373,7 @@ function CloudSyncSection() {
}
function TableOrderSettingsSection() {
const { t } = useTranslation('manager')
const qc = useQueryClient()
const { data: settings, isLoading } = useQuery({
queryKey: ['pos-settings'],
@@ -387,6 +389,7 @@ function TableOrderSettingsSection() {
updateMut.mutate({ key, value: current === 'true' ? 'false' : 'true' })
}
const autoClose = settings?.['orders.auto_close_on_full_payment']?.value ?? 'false'
const closeUnpaid = settings?.['orders.close_with_unpaid']?.value ?? 'false'
const bypassKds = settings?.['orders.bypass_kds_serve']?.value ?? 'false'
return (
<SectionCard title="Ρυθμίσεις Τραπεζιών και Παραγγελιών" description="Συμπεριφορά τραπεζιών και παραγγελιών">
@@ -399,6 +402,10 @@ function TableOrderSettingsSection() {
>
<Toggle checked={autoClose === 'true'} onChange={() => toggle('orders.auto_close_on_full_payment', autoClose)} disabled={updateMut.isPending} />
</OptionRow>
{/* 4.8: closing with unpaid items; when off, the phones take the payment first */}
<OptionRow label={t('settings.operation.closeUnpaid')} description={t('settings.operation.closeUnpaidHint')}>
<Toggle checked={closeUnpaid === 'true'} onChange={() => toggle('orders.close_with_unpaid', closeUnpaid)} disabled={updateMut.isPending} data-testid="setting-orders.close_with_unpaid" />
</OptionRow>
<OptionRow
label="Παράκαμψη KDS και Κατάστασης Σερβιρίσματος"
description="Οι νέες παραγγελίες σημειώνονται άμεσα ως σερβιρισμένες — δεν απαιτείται επιβεβαίωση από σερβιτόρο"