feat: staff apps show the menu in the reader's language (plan 6R.L)
The waiters' phones and the counter show categories, products and every choice (quick options, extras and sub-choices, preferences, shared sets, ingredients, groups) in the signed-in person's language, falling back to the stored text. Display only: carts, lines, tickets and the kitchen keep the venue's text (ids, sub-choices by stored name). In the venue's own language nothing changes. - @xenia/access: menuText / useMenuText (mt, mt.choice, mt.line, mt.matches) - /api/pos/menu carries translations for products, categories and choices - shared ProductDialog takes a text() prop (the counter passes useMenuText) - search finds a product by its name in any language (counter, waiter) - waiter: useMenuNames for sent lines; picker, drawer, cart, summary, table lines, quantity / price history, favourites setup - counter: categories, cards, dialog, cart lines, table lines, payment rows - tests: access menuText, ordering search, test_pos per-language, e2e waiter.mjs and terminal.mjs 6R.L blocks Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ import { assetUrl } from '../config/server'
|
||||
import { money } from '../i18n'
|
||||
import { LineError, estimate, wireLine } from '@xenia/api'
|
||||
import { useTranslation } from '@xenia/i18n'
|
||||
import { useMenuText } from '@xenia/access'
|
||||
import { fade } from '../logic/colour'
|
||||
import SeatsHint from '../components/SeatsHint'
|
||||
|
||||
@@ -156,6 +157,7 @@ function fmtDraftQty(qty, unitType) {
|
||||
|
||||
export default function AddItemsPage() {
|
||||
const { t } = useTranslation('waiter')
|
||||
const mt = useMenuText() // 6R.L: names in the waiter's language; the cart keeps ids and stored names
|
||||
const { tableId, orderType } = useParams()
|
||||
const isStandalone = !!orderType // true when on /standalone/:orderType/add
|
||||
const [searchParams] = useSearchParams()
|
||||
@@ -434,6 +436,7 @@ export default function AddItemsPage() {
|
||||
// Returns structured sections for the expanded cart view
|
||||
function buildItemSections(item, product) {
|
||||
const sections = []
|
||||
const c = name => mt.choice(product, name) // 6R.L: shown in the waiter's language
|
||||
|
||||
if (item.selected_options?.length) {
|
||||
const prefIds = new Set(
|
||||
@@ -442,7 +445,7 @@ export default function AddItemsPage() {
|
||||
// Build a map: prefChoiceId → preference set name
|
||||
const prefSetByChoiceId = {}
|
||||
;(product?.preference_sets || []).forEach(ps => {
|
||||
ps.choices.forEach(c => { prefSetByChoiceId[c.id] = ps.name })
|
||||
ps.choices.forEach(ch => { prefSetByChoiceId[ch.id] = mt(ps) })
|
||||
})
|
||||
const quickNames = new Set((product?.quick_options || []).map(o => o.name))
|
||||
const extraIds = new Set((product?.options || []).map(o => o.id))
|
||||
@@ -462,7 +465,7 @@ export default function AddItemsPage() {
|
||||
const setName = prefSetByChoiceId[o.id] ?? ''
|
||||
let subName = null
|
||||
if (i + 1 < opts.length && opts[i + 1].id == null) {
|
||||
subName = opts[i + 1].name
|
||||
subName = c(opts[i + 1].name)
|
||||
i += 2
|
||||
} else {
|
||||
i++
|
||||
@@ -471,15 +474,15 @@ export default function AddItemsPage() {
|
||||
const existing = prefGroups.find(g => g.setName === setName)
|
||||
if (existing) {
|
||||
// multiple choices from same set (shouldn't normally happen, but handle gracefully)
|
||||
existing.values.push(subName ? `${o.name} · ${subName}` : o.name)
|
||||
existing.values.push(subName ? `${c(o.name)} · ${subName}` : c(o.name))
|
||||
} else {
|
||||
prefGroups.push({ setName, values: [subName ? `${o.name} · ${subName}` : o.name] })
|
||||
prefGroups.push({ setName, values: [subName ? `${c(o.name)} · ${subName}` : c(o.name)] })
|
||||
}
|
||||
} else if (o.id != null && extraIds.has(o.id)) {
|
||||
// Collect sub immediately following
|
||||
let subName = null
|
||||
if (i + 1 < opts.length && opts[i + 1].id == null) {
|
||||
subName = opts[i + 1].name
|
||||
subName = c(opts[i + 1].name)
|
||||
i += 2
|
||||
} else {
|
||||
i++
|
||||
@@ -487,9 +490,9 @@ export default function AddItemsPage() {
|
||||
// Merge duplicates
|
||||
const existing = extraGroups.find(g => g.id === o.id && g.subName === subName)
|
||||
if (existing) existing.qty++
|
||||
else extraGroups.push({ id: o.id, name: o.name, subName, qty: 1 })
|
||||
else extraGroups.push({ id: o.id, name: c(o.name), subName, qty: 1 })
|
||||
} else if (quickNames.has(o.name)) {
|
||||
quickLines.push(o)
|
||||
quickLines.push({ ...o, name: c(o.name) })
|
||||
i++
|
||||
} else {
|
||||
i++
|
||||
@@ -510,7 +513,7 @@ export default function AddItemsPage() {
|
||||
}
|
||||
|
||||
if (item.removed_ingredients?.length) {
|
||||
sections.push({ type: 'removed', lines: item.removed_ingredients.map(n => ({ name: n })) })
|
||||
sections.push({ type: 'removed', lines: item.removed_ingredients.map(n => ({ name: c(n) })) })
|
||||
}
|
||||
|
||||
if (item.notes) {
|
||||
@@ -523,14 +526,15 @@ export default function AddItemsPage() {
|
||||
// Simple flat summary for the collapsed one-liner
|
||||
function buildItemSummary(item) {
|
||||
const lines = []
|
||||
const c = name => mt.choice(getProduct(item.product_id), name) // 6R.L
|
||||
if (item.selected_options?.length) {
|
||||
item.selected_options.forEach(o => {
|
||||
if (o.price_delta && o.price_delta !== 0)
|
||||
lines.push(`${o.name} (${o.price_delta > 0 ? '+' : ''}${money(o.price_delta)})`)
|
||||
else lines.push(o.name)
|
||||
lines.push(`${c(o.name)} (${o.price_delta > 0 ? '+' : ''}${money(o.price_delta)})`)
|
||||
else lines.push(c(o.name))
|
||||
})
|
||||
}
|
||||
if (item.removed_ingredients?.length) lines.push(t('add.withoutList', { names: item.removed_ingredients.join(', ') }))
|
||||
if (item.removed_ingredients?.length) lines.push(t('add.withoutList', { names: item.removed_ingredients.map(c).join(', ') }))
|
||||
if (item.notes) lines.push(item.notes)
|
||||
return lines
|
||||
}
|
||||
@@ -682,7 +686,7 @@ export default function AddItemsPage() {
|
||||
const p = getProduct(item.product_id)
|
||||
return (
|
||||
<div key={item._key} style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
|
||||
<span style={{ fontSize: 12, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', flex: 1 }}>{p?.name ?? `#${item.product_id}`}</span>
|
||||
<span style={{ fontSize: 12, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', flex: 1 }}>{p ? mt(p) : `#${item.product_id}`}</span>
|
||||
<span style={{ fontSize: 12, fontWeight: 700, color: 'var(--x-warning)', fontVariantNumeric: 'tabular-nums', flexShrink: 0 }}>{fmtDraftQty(item.quantity, p?.unit_type)}</span>
|
||||
</div>
|
||||
)
|
||||
@@ -1167,7 +1171,8 @@ function DealOfferModal({ offer, _products, onAccept, onDismiss }) {
|
||||
|
||||
function QuickAddToast({ product, count }) {
|
||||
const { t } = useTranslation('waiter')
|
||||
const initials = product.name.trim().split(/\s+/).slice(0, 2).map(w => w[0]).join('').toUpperCase()
|
||||
const mt = useMenuText()
|
||||
const initials = mt(product).trim().split(/\s+/).slice(0, 2).map(w => w[0]).join('').toUpperCase()
|
||||
return (
|
||||
<div style={{
|
||||
position: 'fixed', top: 62, left: '50%',
|
||||
@@ -1199,7 +1204,7 @@ function QuickAddToast({ product, count }) {
|
||||
<div style={{
|
||||
fontSize: 13, fontWeight: 600, color: 'var(--text)',
|
||||
overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap',
|
||||
}}>{product.name}</div>
|
||||
}}>{mt(product)}</div>
|
||||
<div style={{ fontSize: 11, color: 'var(--muted)', marginTop: 1 }}>{t('add.inCart')}</div>
|
||||
</div>
|
||||
{/* Count badge */}
|
||||
@@ -1243,6 +1248,7 @@ function SectionIcon({ type }) {
|
||||
|
||||
function CartItem({ item, product, summaryLines, sections, onEdit, onRemove, onChangeQty }) {
|
||||
const { t } = useTranslation('waiter')
|
||||
const mt = useMenuText()
|
||||
const [expanded, setExpanded] = useState(false)
|
||||
const hasDetails = sections.length > 0
|
||||
|
||||
@@ -1261,7 +1267,7 @@ function CartItem({ item, product, summaryLines, sections, onEdit, onRemove, onC
|
||||
{/* Name */}
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 600, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
|
||||
{product?.name ?? `#${item.product_id}`}
|
||||
{product ? mt(product) : `#${item.product_id}`}
|
||||
</div>
|
||||
{!expanded && hasDetails && (
|
||||
<div style={{ fontSize: 11, color: 'var(--muted)', marginTop: 1, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
|
||||
@@ -1380,14 +1386,13 @@ function CartItem({ item, product, summaryLines, sections, onEdit, onRemove, onC
|
||||
|
||||
function SearchModal({ products, query, setQuery, onClose, onAdd, courses = [], quickNotes }) {
|
||||
const { t } = useTranslation('waiter')
|
||||
const mt = useMenuText() // 6R.L: shown in the waiter's language, found by either
|
||||
const [drawerProduct, setDrawerProduct] = useState(null)
|
||||
const activeProducts = products.filter(p => p.lifecycle_status !== 'archived')
|
||||
|
||||
const results = query.trim().length === 0
|
||||
? []
|
||||
: activeProducts.filter(p =>
|
||||
p.name.toLowerCase().includes(query.trim().toLowerCase())
|
||||
)
|
||||
: activeProducts.filter(p => mt.matches(p, query.trim().toLowerCase()))
|
||||
|
||||
function openProduct(p) {
|
||||
// Blur the input first so the keyboard dismisses, then open the drawer
|
||||
@@ -1425,7 +1430,7 @@ function SearchModal({ products, query, setQuery, onClose, onAdd, courses = [],
|
||||
{t('add.search.none', { query })}
|
||||
</p>
|
||||
) : results.map(p => {
|
||||
const initials = p.name.trim().split(/\s+/).slice(0, 2).map(w => w[0]).join('').toUpperCase()
|
||||
const initials = mt(p).trim().split(/\s+/).slice(0, 2).map(w => w[0]).join('').toUpperCase()
|
||||
return (
|
||||
<button
|
||||
key={p.id}
|
||||
@@ -1450,7 +1455,7 @@ function SearchModal({ products, query, setQuery, onClose, onAdd, courses = [],
|
||||
</div>
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 600, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
|
||||
{p.name}
|
||||
{mt(p)}
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: 'var(--muted)', marginTop: 2 }}>
|
||||
{money(p.base_price)}
|
||||
|
||||
@@ -5,6 +5,7 @@ import useWaiterFavoritesStore from '../store/waiterFavoritesStore'
|
||||
import { assetUrl } from '../config/server'
|
||||
import { useFormat, useTranslation } from '@xenia/i18n'
|
||||
import { money } from '../i18n'
|
||||
import { useMenuText } from '@xenia/access'
|
||||
|
||||
// ── Heart icon ────────────────────────────────────────────────────────────────
|
||||
function Heart({ filled, size = 22 }) {
|
||||
@@ -17,6 +18,7 @@ function Heart({ filled, size = 22 }) {
|
||||
|
||||
// ── Thumb (product image or initials) ─────────────────────────────────────────
|
||||
function Thumb({ product, size = 42, radius = 10 }) {
|
||||
const mt = useMenuText() // 6R.L: names in the waiter's language
|
||||
return (
|
||||
<div style={{
|
||||
width: size, height: size, borderRadius: radius, flexShrink: 0,
|
||||
@@ -26,7 +28,7 @@ function Thumb({ product, size = 42, radius = 10 }) {
|
||||
{product.image_url
|
||||
? <img src={assetUrl(product.image_url)} alt="" style={{ width: '100%', height: '100%', objectFit: 'cover' }} />
|
||||
: <span style={{ fontSize: Math.round(size * 0.33), fontWeight: 700, color: 'var(--muted)' }}>
|
||||
{product.name.trim().split(/\s+/).slice(0, 2).map(w => w[0]).join('').toUpperCase()}
|
||||
{mt(product).trim().split(/\s+/).slice(0, 2).map(w => w[0]).join('').toUpperCase()}
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
@@ -38,6 +40,7 @@ function Thumb({ product, size = 42, radius = 10 }) {
|
||||
// The waiter picks which items appear in that product's Favorites tab.
|
||||
|
||||
function AttrSection({ title, items, favIds, onToggle }) {
|
||||
const mt = useMenuText() // 6R.L: names in the waiter's language
|
||||
if (!items || items.length === 0) return null
|
||||
return (
|
||||
<div style={{ marginBottom: 20 }}>
|
||||
@@ -65,7 +68,7 @@ function AttrSection({ title, items, favIds, onToggle }) {
|
||||
>
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 500, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
|
||||
{item.name}
|
||||
{mt(item)}
|
||||
</div>
|
||||
{item.extra_cost != null && item.extra_cost !== 0 && (
|
||||
<div style={{ fontSize: 12, color: 'var(--muted)' }}>+{money(item.extra_cost)}</div>
|
||||
@@ -90,6 +93,7 @@ function AttrSection({ title, items, favIds, onToggle }) {
|
||||
|
||||
function ItemFavoritesModal({ product, waiterAttrFavs, onSave, onClose }) {
|
||||
const { t } = useTranslation('waiter')
|
||||
const mt = useMenuText() // 6R.L: names in the waiter's language
|
||||
// Local state: { quick: id[], ingredients: id[], options: id[], prefs: id[] }
|
||||
// Start from waiter overrides if they exist, otherwise seed from manager's is_favorite flags
|
||||
function seedFromManager() {
|
||||
@@ -164,7 +168,7 @@ function ItemFavoritesModal({ product, waiterAttrFavs, onSave, onClose }) {
|
||||
<Thumb product={product} size={38} radius={9} />
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 15, fontWeight: 700, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
|
||||
{product.name}
|
||||
{mt(product)}
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: 'var(--muted)' }}>
|
||||
{waiterAttrFavs ? t('favSetup.personalOn') : t('favSetup.managerDefaults')}
|
||||
@@ -257,6 +261,7 @@ function ItemFavoritesModal({ product, waiterAttrFavs, onSave, onClose }) {
|
||||
// ── Product row (ALL tab) ─────────────────────────────────────────────────────
|
||||
function ProductRow({ product, isFav, hasAttrOverride, onToggleFav, onEditAttrs }) {
|
||||
const { t } = useTranslation('waiter')
|
||||
const mt = useMenuText() // 6R.L: names in the waiter's language
|
||||
const { formatMoney } = useFormat()
|
||||
const hasAttrs = (
|
||||
(product.quick_options || []).length > 0 ||
|
||||
@@ -279,7 +284,7 @@ function ProductRow({ product, isFav, hasAttrOverride, onToggleFav, onEditAttrs
|
||||
>
|
||||
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 600, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
|
||||
{product.name}
|
||||
{mt(product)}
|
||||
</div>
|
||||
{hasAttrOverride && (
|
||||
<Heart filled size={12} />
|
||||
@@ -304,6 +309,7 @@ function ProductRow({ product, isFav, hasAttrOverride, onToggleFav, onEditAttrs
|
||||
// ── Draggable favorites list (pointer-events — works on touch + mouse) ─────────
|
||||
function FavoritesList({ items, products, onReorder }) {
|
||||
const { t } = useTranslation('waiter')
|
||||
const mt = useMenuText() // 6R.L: names in the waiter's language
|
||||
const [dragging, setDragging] = useState(null)
|
||||
const [dropIndex, setDropIndex] = useState(null)
|
||||
const containerRef = useRef(null)
|
||||
@@ -405,7 +411,7 @@ function FavoritesList({ items, products, onReorder }) {
|
||||
<Thumb product={product} size={38} radius={9} />
|
||||
|
||||
<span style={{ flex: 1, fontSize: 14, fontWeight: 600, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
|
||||
{product.name}
|
||||
{mt(product)}
|
||||
</span>
|
||||
|
||||
<span style={{ fontSize: 12, color: 'var(--muted)', flexShrink: 0 }}>{money(product.base_price)}</span>
|
||||
@@ -424,6 +430,7 @@ function FavoritesList({ items, products, onReorder }) {
|
||||
// ── Main page ─────────────────────────────────────────────────────────────────
|
||||
export default function FavoritesSetupPage() {
|
||||
const { t } = useTranslation('waiter')
|
||||
const mt = useMenuText() // 6R.L: names in the waiter's language
|
||||
const navigate = useNavigate()
|
||||
const { products, categories } = useProductCache()
|
||||
const { favorites, toggleFavorite, reorderFavorites, itemFavorites, setItemFavorites } = useWaiterFavoritesStore()
|
||||
@@ -482,7 +489,7 @@ export default function FavoritesSetupPage() {
|
||||
background: 'var(--bg2)', borderBottom: '1px solid var(--border)',
|
||||
position: 'sticky', top: 0, zIndex: 1,
|
||||
}}>
|
||||
{cat.name}
|
||||
{mt(cat)}
|
||||
</div>
|
||||
{allProds.map(p => (
|
||||
<ProductRow
|
||||
|
||||
@@ -16,6 +16,7 @@ import { TransferIcon, MergeIcon, FlagsIcon, WaiterIcon, PrintIcon } from '../co
|
||||
import usePaymentSettingsStore from '../store/paymentSettingsStore'
|
||||
import useTableViewStore from '../store/tableViewStore'
|
||||
import { parseNumber, useTranslation } from '@xenia/i18n'
|
||||
import { useMenuNames } from '../hooks/useMenuNames'
|
||||
import PriceReason from '../components/PriceReason'
|
||||
import { priceReasonText } from '../logic/priceRules'
|
||||
import PriceHistory from '../components/PriceHistory'
|
||||
@@ -93,6 +94,7 @@ function mergeItems(items, mode) {
|
||||
|
||||
function SplitModal({ item, onConfirm, onClose }) {
|
||||
const { t } = useTranslation('waiter')
|
||||
const names = useMenuNames() // 6R.L: the waiter's language, display only
|
||||
const [splitQty, setSplitQty] = useState(1)
|
||||
const max = item.quantity - 1
|
||||
|
||||
@@ -102,7 +104,7 @@ function SplitModal({ item, onConfirm, onClose }) {
|
||||
<div className="modal-handle" />
|
||||
<h2 className="modal-title">{t('detail.split.title')}</h2>
|
||||
<p style={{ textAlign: 'center', color: 'var(--x-ink-2)', fontSize: 14, marginBottom: 4 }}>
|
||||
{item.product?.name} ×{item.quantity}
|
||||
{names.lineName(item, item.product?.name)} ×{item.quantity}
|
||||
</p>
|
||||
<p style={{ textAlign: 'center', color: 'var(--x-ink-2)', fontSize: 13, marginBottom: 16 }}>
|
||||
{t('detail.split.howMany')}
|
||||
@@ -134,6 +136,7 @@ function SplitModal({ item, onConfirm, onClose }) {
|
||||
|
||||
function PriceAdjustModal({ item, rules, error, onConfirm, onClose }) {
|
||||
const { t } = useTranslation('waiter')
|
||||
const names = useMenuNames() // 6R.L: the waiter's language, display only
|
||||
const [reason, setReason] = useState({ choice: '', other: '' }) // 6F.3
|
||||
const [tried, setTried] = useState(false)
|
||||
const basePrice = item.unit_price ?? 0
|
||||
@@ -173,7 +176,7 @@ function PriceAdjustModal({ item, rules, error, onConfirm, onClose }) {
|
||||
<div className="modal-handle" />
|
||||
<h2 className="modal-title">{t('detail.price.title')}</h2>
|
||||
<p style={{ textAlign: 'center', color: 'var(--muted)', fontSize: 13, margin: '0 0 16px' }}>
|
||||
{item.product?.name}
|
||||
{names.lineName(item, item.product?.name)}
|
||||
</p>
|
||||
|
||||
{/* Current effective price — tap to type */}
|
||||
@@ -276,10 +279,11 @@ function PriceAdjustModal({ item, rules, error, onConfirm, onClose }) {
|
||||
|
||||
function ItemActionModal({ target, onOrderAgain, onSplit, onMoveToTable, onCancel, onCombine, canCancel, cancelNeedsApproval, priceAdjAllowed, priceNeedsApproval, canMove, onAdjustPrice, canSeePriceHistory, onPriceHistory, movedLine, onMoveHistory, canChangeQty, onChangeQty, onClose }) {
|
||||
const { t } = useTranslation('waiter')
|
||||
const names = useMenuNames() // 6R.L: the waiter's language, display only
|
||||
const { items, singleStacked, multiSelect } = target
|
||||
const label = multiSelect
|
||||
? t('detail.selected', { count: items.length })
|
||||
: items[0]?.product?.name || `#${items[0]?.product_id}`
|
||||
: names.lineName(items[0], items[0]?.product?.name) || `#${items[0]?.product_id}`
|
||||
|
||||
const actionRows = [
|
||||
// 6F.5: correct how many there are, without sending it to the kitchen again
|
||||
@@ -464,6 +468,7 @@ function ItemActionModal({ target, onOrderAgain, onSplit, onMoveToTable, onCance
|
||||
|
||||
function ApplyDiscountModal({ order, _waiterId, onClose, onApplied }) {
|
||||
const { t } = useTranslation('waiter')
|
||||
const names = useMenuNames() // 6R.L: the waiter's language, display only
|
||||
const activeItems = (order?.items ?? []).filter(i => i.status === 'active')
|
||||
const [selectedIds, setSelectedIds] = useState(activeItems.map(i => i.id))
|
||||
const [pct, setPct] = useState(10)
|
||||
@@ -544,7 +549,7 @@ function ApplyDiscountModal({ order, _waiterId, onClose, onApplied }) {
|
||||
</div>
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 13, fontWeight: 600, color: 'var(--text)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
|
||||
{item.product?.name ?? `#${item.product_id}`}
|
||||
{names.lineName(item, item.product?.name) ?? `#${item.product_id}`}
|
||||
</div>
|
||||
<div style={{ fontSize: 11, color: 'var(--muted)' }}>×{item.quantity} · {fmtPrice(eff)}</div>
|
||||
</div>
|
||||
@@ -1154,6 +1159,7 @@ function CustomerCountModal({ value, seats, onChange, onClose }) {
|
||||
|
||||
export default function TableDetailPage() {
|
||||
const { t } = useTranslation('waiter')
|
||||
const names = useMenuNames() // 6R.L: the waiter's language, display only
|
||||
const { tableId, orderId: standaloneOrderId } = useParams()
|
||||
const isStandalone = !!standaloneOrderId
|
||||
const [searchParams, setSearchParams] = useSearchParams()
|
||||
@@ -2338,7 +2344,7 @@ export default function TableDetailPage() {
|
||||
onMoveHistory={() => {
|
||||
const item = itemActionTarget.items[0]
|
||||
setItemActionTarget(null)
|
||||
setMoveSheet({ title: t('moves.lineTitle'), subtitle: item.product_name || item.product?.name, moves: moves.items[item.id] ?? [], itemId: item.id })
|
||||
setMoveSheet({ title: t('moves.lineTitle'), subtitle: names.lineName(item, item.product_name || item.product?.name), moves: moves.items[item.id] ?? [], itemId: item.id })
|
||||
}}
|
||||
onPriceHistory={() => {
|
||||
const item = itemActionTarget.items[0]
|
||||
|
||||
Reference in New Issue
Block a user