diff --git a/local_backend/core/errors.py b/local_backend/core/errors.py
index c03aa2f..afe91ca 100644
--- a/local_backend/core/errors.py
+++ b/local_backend/core/errors.py
@@ -222,6 +222,12 @@ CODES: dict[str, tuple[int, str]] = {
"order.item_paid": (400, "This item is already paid."),
"order.item_not_active": (400, "Only items still on the order can be changed."),
"order.price_change_off": (403, "Changing prices by hand is turned off for this venue."),
+ "order.one_more_off": (400, "\"One more\" isn't turned on for this product."),
+ "order.one_more_line": (400, "This line can't be ordered again with one tap."),
+ "order.quantity_change_off": (403, "Changing quantities is turned off for this venue."),
+ "order.quantity_remove_off": (403, "Quantities can only go up at this venue."),
+ "order.quantity_invalid": (400, "Choose a whole number from 1 to {max}."),
+ "order.quantity_line": (400, "This line's quantity can't be changed here."),
"order.price_change_sent_off": (403, "Prices can only be changed before the items are sent."),
"order.price_reason_required": (400, "Say why the price changes."),
"order.nothing_paid": (404, "There are no paid items to undo."),
diff --git a/local_backend/migrations/versions/0049_one_more.py b/local_backend/migrations/versions/0049_one_more.py
new file mode 100644
index 0000000..adc6677
--- /dev/null
+++ b/local_backend/migrations/versions/0049_one_more.py
@@ -0,0 +1,30 @@
+"""One more and quantity changes (owner 2026-11-23, plan 6F.5).
+
+- products.one_more_enabled (off: the owner turns it on per product).
+- The key ordering.items.change_quantity for owners and store managers (the venue's setting
+ orders.quantity_change starts 'off').
+
+Revision ID: 0049_one_more
+Revises: 0048_order_moves
+Create Date: 2026-11-23 18:00:00
+"""
+from alembic import op
+import sqlalchemy as sa
+
+revision = '0049_one_more'
+down_revision = '0048_order_moves'
+branch_labels = None
+depends_on = None
+
+
+def upgrade() -> None:
+ with op.batch_alter_table('products') as b:
+ b.add_column(sa.Column('one_more_enabled', sa.Boolean(), nullable=False, server_default='0'))
+ op.get_bind().execute(sa.text("insert or ignore into user_permissions (user_id, key) "
+ "select id, 'ordering.items.change_quantity' from users where role in ('owner', 'store_manager')"))
+
+
+def downgrade() -> None:
+ op.get_bind().execute(sa.text("delete from user_permissions where key = 'ordering.items.change_quantity'"))
+ with op.batch_alter_table('products') as b:
+ b.drop_column('one_more_enabled')
diff --git a/local_backend/models/product.py b/local_backend/models/product.py
index 939d5be..0f97e8a 100644
--- a/local_backend/models/product.py
+++ b/local_backend/models/product.py
@@ -82,6 +82,8 @@ class Product(Base):
# Quick Add: allow adding 1 unit directly from product list without opening config modal
quick_add_enabled = Column(Boolean, default=True, nullable=False)
+ # "One more" (6F.5): a sent line of this product shows +1 (re-order the same, printed as new)
+ one_more_enabled = Column(Boolean, default=False, nullable=False, server_default="0")
# Service item: non-inventoried table-service items (cutlery, glasses, etc.)
is_service_item = Column(Boolean, default=False, nullable=False)
diff --git a/local_backend/modules/ordering/manifest.py b/local_backend/modules/ordering/manifest.py
index d234467..ff0d724 100644
--- a/local_backend/modules/ordering/manifest.py
+++ b/local_backend/modules/ordering/manifest.py
@@ -13,6 +13,7 @@ MODULE = Module(
Perm('ordering.orders.cancel', 'Cancel items already sent', roles=('owner', 'store_manager'), overridable=True),
Perm('ordering.prices.modify', "Change an item's price before it is sent", roles=('owner',), overridable=True),
Perm('ordering.prices.modify_sent', "Change the price of an item already sent or served", roles=('owner',), overridable=True),
+ Perm('ordering.items.change_quantity', "Change a sent line's quantity (no new ticket)", roles=('owner', 'store_manager'), overridable=True),
Perm('ordering.prices.view_changes', 'See the prices changed by hand (who, when, why)', roles=('owner', 'store_manager')),
Perm('ordering.refunds', 'Refund payments from other shifts', roles=('owner', 'store_manager'), overridable=True),
Perm('ordering.payments.revert', 'Turn paid items back to unpaid', roles=('owner', 'store_manager'), overridable=True),
@@ -24,6 +25,7 @@ MODULE = Module(
SettingDef('orders.auto_close_on_full_payment', 'false', "Automatically close the table order when all items have been paid: 'true' | 'false'", type='bool'),
SettingDef('orders.close_with_unpaid', 'false', "Allow closing an order that still has unpaid items (they are written off as unpaid): 'true' | 'false'. When 'false', closing asks for the payment first (plan step 4.8).", type='bool'),
SettingDef('orders.bypass_kds_serve', 'false', "Skip KDS pending/serve flow — new orders and items are immediately marked as served: 'true' | 'false'", type='bool'),
+ SettingDef('orders.quantity_change', 'off', "Changing a sent line's quantity without sending it again (6F.5): 'off' | 'add_only' | 'add_and_remove' (lowering cancels the difference; also needs ordering.orders.cancel). Who may: ordering.items.change_quantity.", type='enum', choices=('off', 'add_only', 'add_and_remove')),
SettingDef('orders.price_change', 'anytime', "Changing a line's price by hand (6F.3): 'off' | 'before_sending' (only in the cart) | 'anytime' (also a sent or served line). Who may: the keys ordering.prices.modify / modify_sent.", type='enum', choices=('off', 'before_sending', 'anytime')),
SettingDef('orders.price_change_reason', 'false', "A price changed by hand needs a reason: 'true' | 'false' (6F.3).", type='bool'),
SettingDef('orders.price_change_reasons', '[]', 'JSON array of quick reasons offered when a price is changed by hand (6F.3); [] = the built-in ones.', type='json'),
diff --git a/local_backend/routers/orders.py b/local_backend/routers/orders.py
index a2b601d..f246761 100644
--- a/local_backend/routers/orders.py
+++ b/local_backend/routers/orders.py
@@ -343,7 +343,8 @@ def get_order(order_id: int, db: Session = Depends(get_db), user: User = Depends
"id": i.id,
"order_id": i.order_id,
"product_id": i.product_id,
- "product": {"id": i.product.id, "name": i.product.name} if i.product else None,
+ "product": {"id": i.product.id, "name": i.product.name, "unit_type": i.product.unit_type or "piece",
+ "one_more_enabled": bool(i.product.one_more_enabled)} if i.product else None, # 6F.5: +1
"product_name": i.product_name, "category_id": i.category_id, "category_name": i.category_name,
"added_by": i.added_by,
"added_by_name": name_map.get(i.added_by),
@@ -366,6 +367,9 @@ def get_order(order_id: int, db: Session = Depends(get_db), user: User = Depends
"system_key": i.system_key, # the delivery fee line (phase 3S, S.5)
"source": i.source, # waiter | counter | qr | online (4.8)
"course_id": i.course_id,
+ "deal_id": i.deal_id, "linked_item_id": i.linked_item_id,
+ "split_from_id": i.split_from_id, # 6F.4: the line it was cut from
+ "cancel_reason": i.cancel_reason,
}
def fmt_log(l):
@@ -1618,26 +1622,7 @@ def split_item(
# Reduce original item
item.quantity -= body.quantity
-
- # Create split-off item
- new_item = OrderItem(
- source=item.source,
- order_id=order_id,
- product_id=item.product_id,
- added_by=item.added_by,
- quantity=body.quantity,
- unit_price=item.unit_price,
- selected_options=item.selected_options,
- removed_ingredients=item.removed_ingredients,
- notes=item.notes,
- status="active",
- printed=item.printed,
- split_from_id=item.id, # 6F.4: the moves the line had come with this part
- # the rest of what the line was (kitchen, course, price, names, cost) goes with the part
- kds_status=item.kds_status, course_id=item.course_id, price_adjustment=item.price_adjustment,
- unit_cost=item.unit_cost, product_name=item.product_name, category_id=item.category_id,
- category_name=item.category_name,
- )
+ new_item = cut_part(item, body.quantity)
db.add(new_item)
db.commit()
db.refresh(item)
@@ -1645,6 +1630,136 @@ def split_item(
return [item, new_item]
+def cut_part(item, quantity, **changes):
+ """A new line cut from `item` (a split, a lowered quantity, 6F.4/6F.5): everything the line was
+ (product, price and its change, choices, note, kitchen state, course, cost, names, source) for
+ `quantity`, linked by split_from_id so its moves follow it. Not added to the session."""
+ fields = dict(
+ source=item.source, order_id=item.order_id, product_id=item.product_id, added_by=item.added_by,
+ quantity=quantity, unit_price=item.unit_price, selected_options=item.selected_options,
+ removed_ingredients=item.removed_ingredients, notes=item.notes, status="active", printed=item.printed,
+ split_from_id=item.id, kds_status=item.kds_status, course_id=item.course_id,
+ price_adjustment=item.price_adjustment, unit_cost=item.unit_cost, product_name=item.product_name,
+ category_id=item.category_id, category_name=item.category_name,
+ ) # added_at = now: the moment it was cut (services/moves.py reads it)
+ fields.update(changes)
+ return OrderItem(**fields)
+
+
+# ─── One more of a line, and a line's quantity (6F.5) ────────────────────────
+
+class AgainRequest(BaseModel):
+ quantity: int = Field(default=1, ge=1, le=50)
+
+
+@router.post("/{order_id}/items/{item_id}/again", response_model=AddItemsResponse)
+def order_again(order_id: int, item_id: int, body: AgainRequest, request: Request, db: Session = Depends(get_db),
+ user: User = Depends(get_current_user)):
+ """"One more" (6F.5): a new line just like this one (product, choices, removed ingredients, note,
+ course) for `quantity`, priced by the server now and sent like any new line (kitchen ticket,
+ KDS). Only for products with one_more_enabled, counted in pieces, from an active, paid or
+ tabbed line that isn't a deal's or the system's. Needs ordering.orders.open."""
+ from core.access.context import current_device
+ from schemas.order import OrderItemInput, SelectedOptionInput
+ _need(request, db, user, "ordering.orders.open", target=f"order:{order_id}")
+ order = db.get(Order, order_id)
+ if order is None:
+ raise XeniaError("order.not_found", order_id=order_id)
+ if not _can_access_order(order, user, db):
+ raise XeniaError("order.not_yours")
+ item = db.query(OrderItem).filter(OrderItem.id == item_id, OrderItem.order_id == order_id).first()
+ if item is None:
+ raise XeniaError("order.item_not_found")
+ product = item.product
+ if product is None or not product.one_more_enabled:
+ raise XeniaError("order.one_more_off")
+ if item.status not in ("active", "paid", "tabbed") or item.deal_id or item.linked_item_id \
+ or product.system_key or (product.unit_type or "piece") != "piece":
+ raise XeniaError("order.one_more_line")
+ try:
+ options = [SelectedOptionInput(**o) for o in json.loads(item.selected_options or "[]") if isinstance(o, dict)]
+ removed = [str(x) for x in json.loads(item.removed_ingredients or "[]")]
+ except (ValueError, TypeError):
+ options, removed = [], []
+ device = current_device(request, db)
+ source = "counter" if device is not None and device.app_key == "pos_counter" else "waiter"
+ result = add_priced_items(order_id, AddItemsRequest(items=[OrderItemInput(
+ product_id=item.product_id, quantity=body.quantity, selected_options=options or None,
+ removed_ingredients=removed or None, notes=item.notes, course_id=item.course_id, source=source,
+ )]), db, user)
+ _audit(db, order_id, "ITEM_REORDERED", waiter_id=user.id, item_ids=[item.id],
+ note=f"{body.quantity:g} more of #{item.id}")
+ db.commit()
+ return result
+
+
+class QuantityRequest(BaseModel):
+ quantity: int = Field(ge=1, le=999)
+ print_cancellation: bool = False # lowering: send a cancellation to the kitchen (the app asks)
+
+
+@router.post("/{order_id}/items/{item_id}/quantity")
+def change_quantity(order_id: int, item_id: int, body: QuantityRequest, request: Request, background_tasks: BackgroundTasks,
+ db: Session = Depends(get_db), user: User = Depends(get_current_user)):
+ """Change a sent line's quantity without sending it again (6F.5). The venue
+ (orders.quantity_change: off | add_only | add_and_remove) and ordering.items.change_quantity
+ decide; lowering also needs ordering.orders.cancel (or a manager's PIN each). Up: the line
+ grows, nothing is printed. Down: the removed part becomes its own cancelled line ("quantity
+ lowered", split_from_id = the line) and, when asked, a cancellation ticket goes to the kitchen.
+ Only unpaid lines counted in pieces, not a deal's or the system's."""
+ from models.settings import PosSettings
+ order = db.get(Order, order_id)
+ if order is None:
+ raise XeniaError("order.not_found", order_id=order_id)
+ if not _can_access_order(order, user, db):
+ raise XeniaError("order.not_yours")
+ row = db.query(PosSettings).filter(PosSettings.key == "orders.quantity_change").first()
+ mode = row.value if row is not None and row.value in ("off", "add_only", "add_and_remove") else "off"
+ if mode == "off":
+ raise XeniaError("order.quantity_change_off")
+ item = db.query(OrderItem).filter(OrderItem.id == item_id, OrderItem.order_id == order_id).first()
+ if item is None:
+ raise XeniaError("order.item_not_found")
+ product = item.product
+ if item.status != "active" or item.deal_id or item.linked_item_id or (product is not None and product.system_key) \
+ or (item.unit_type or "piece") != "piece" or item.quantity != int(item.quantity):
+ raise XeniaError("order.quantity_line")
+ old = int(item.quantity)
+ if body.quantity == old:
+ return {"item_id": item.id, "quantity": old, "cancelled_item_id": None}
+ lowering = body.quantity < old
+ if lowering and mode != "add_and_remove":
+ raise XeniaError("order.quantity_remove_off")
+ approval = _need(request, db, user, "ordering.items.change_quantity", target=f"order:{order_id} item:{item_id}")
+ cancel_approval = None
+ if lowering and not holds(user, "core.dashboard.access") and not _waiter_can_cancel(user, db):
+ cancel_approval = require_override(request, db, "ordering.orders.cancel", target=f"order:{order_id}")
+ note = f"{old} → {body.quantity}" + (f" · {_approval_note(approval)}" if approval is not None else "")
+ part = None
+ if lowering:
+ now = utcnow()
+ part = cut_part(item, old - body.quantity, status="cancelled", cancelled_by=user.id, cancelled_at=now,
+ cancel_reason="quantity lowered")
+ db.add(part)
+ item.quantity = body.quantity
+ db.flush()
+ _audit(db, order_id, "ITEM_CANCELLED", waiter_id=user.id, item_ids=[part.id],
+ note=("quantity lowered" + (f" · {_approval_note(cancel_approval)}" if cancel_approval is not None else "")
+ + ("" if body.print_cancellation else " · no kitchen ticket")))
+ else:
+ item.quantity = body.quantity
+ _audit(db, order_id, "QUANTITY_CHANGED", waiter_id=user.id, item_ids=[item.id], note=note)
+ db.commit()
+ broadcast_sync("order_updated", {"order_id": order_id, "table_id": order.table_id, "status": order.status,
+ "action": "quantity_changed", "item_ids": [item.id]})
+ if part is not None:
+ broadcast_sync("order_updated", {"order_id": order_id, "table_id": order.table_id, "status": order.status,
+ "action": "items_cancelled", "item_ids": [part.id]})
+ if body.print_cancellation:
+ background_tasks.add_task(print_cancellation_ticket, order_id, [part.id])
+ return {"item_id": item.id, "quantity": item.quantity, "cancelled_item_id": part.id if part is not None else None}
+
+
# ─── Adjust price on an existing item ────────────────────────────────────────
class PriceAdjustRequest(BaseModel):
diff --git a/local_backend/routers/pos.py b/local_backend/routers/pos.py
index ce0a737..d32c71b 100644
--- a/local_backend/routers/pos.py
+++ b/local_backend/routers/pos.py
@@ -89,6 +89,7 @@ def _product_out(p, price: float, prices: dict | None = None) -> dict:
"price": round(price, 2), "prices": {k: round(v, 2) for k, v in (prices or {}).items()},
"sold_at": [sp for sp in sales_points.sold_at(p) if sp in sales_points.IN_PERSON],
"base_price": round(p.base_price, 2), "unit_type": p.unit_type or "piece",
+ "one_more": bool(p.one_more_enabled), # 6F.5
"tags": _tags(p.tags),
"allergens": allergens.of(p),
"primary_category_id": p.primary_category_id,
diff --git a/local_backend/schemas/order.py b/local_backend/schemas/order.py
index 46213a3..91a1787 100644
--- a/local_backend/schemas/order.py
+++ b/local_backend/schemas/order.py
@@ -40,6 +40,8 @@ class AddItemsRequest(BaseModel):
class ProductNameOut(BaseModel):
id: int
name: str
+ one_more_enabled: bool = False # 6F.5: the line shows +1
+ unit_type: Optional[str] = None
model_config = {"from_attributes": True}
diff --git a/local_backend/schemas/product.py b/local_backend/schemas/product.py
index 3fb316f..9bb2baf 100644
--- a/local_backend/schemas/product.py
+++ b/local_backend/schemas/product.py
@@ -386,6 +386,7 @@ class ProductBase(BaseModel):
cost_breakdown: Optional[List[CostBreakdownItem]] = None
# Quick Add
quick_add_enabled: bool = True
+ one_more_enabled: bool = False # 6F.5
# Tags
tags: Optional[List[str]] = None
# The EU allergens (plan step 6.3): {key: "contains" | "may_contain"}, core/allergens.py
@@ -437,6 +438,7 @@ class ProductUpdate(BaseModel):
cost_breakdown: Optional[List[CostBreakdownItem]] = None
# Quick Add
quick_add_enabled: Optional[bool] = None
+ one_more_enabled: Optional[bool] = None # 6F.5
# Tags
tags: Optional[List[str]] = None
allergens: Optional[Dict[str, str]] = None # None = unchanged, {} = none
@@ -510,6 +512,7 @@ class ProductOut(ProductBase):
'cost_simple': data.cost_simple,
'cost_breakdown': parsed,
'quick_add_enabled': getattr(data, 'quick_add_enabled', True),
+ 'one_more_enabled': bool(getattr(data, 'one_more_enabled', False)),
'tags': json.loads(data.tags) if isinstance(getattr(data, 'tags', None), str) else (getattr(data, 'tags', None) or []),
'allergens': _allergens_of(data),
'translations': _menu_tr_of(data),
diff --git a/local_backend/tests/test_one_more.py b/local_backend/tests/test_one_more.py
new file mode 100644
index 0000000..80ba321
--- /dev/null
+++ b/local_backend/tests/test_one_more.py
@@ -0,0 +1,123 @@
+"""One more, and a sent line's quantity (owner 2026-11-23, plan 6F.5).
+
+- POST /api/orders/{id}/items/{item}/again: a new line like the old one, priced now, printed as new;
+ only with the product's one_more_enabled, from active / paid / tabbed lines in pieces.
+- POST /api/orders/{id}/items/{item}/quantity: the venue's switch (off | add_only | add_and_remove),
+ the key ordering.items.change_quantity; up changes the line only (no ticket); down cuts a
+ cancelled part ("quantity lowered") and prints a cancellation only when asked.
+"""
+import json
+
+import pytest
+
+from tests.test_live import err
+from tests.test_waiter_keys import shop # noqa: F401 (fixture)
+
+
+@pytest.fixture
+def printed(monkeypatch):
+ """What went to the kitchen: new lines (route_and_print_sync) and cancellations."""
+ import routers.orders as orders
+ got = {"tickets": [], "cancellations": []}
+ monkeypatch.setattr(orders, "route_and_print_sync", lambda *a, **k: (got["tickets"].append(a), [])[1])
+ monkeypatch.setattr(orders, "print_cancellation_ticket", lambda order_id, ids: got["cancellations"].append(list(ids)))
+ return got
+
+
+def setting(db, key, value):
+ from models.settings import PosSettings
+ row = db.query(PosSettings).filter(PosSettings.key == key).first()
+ if row is None:
+ db.add(PosSettings(key=key, value=value))
+ else:
+ row.value = value
+ db.commit()
+
+
+def lines(db, order_id):
+ from models.order import OrderItem
+ db.expire_all()
+ return db.query(OrderItem).filter(OrderItem.order_id == order_id).order_by(OrderItem.id).all()
+
+
+def test_one_more_needs_the_products_switch(client, db, shop, printed):
+ o, item = shop["order"], shop["items"][0]
+ url = f"/api/orders/{o.id}/items/{item.id}/again"
+ assert err(client.post(url, headers=shop["h"], json={})) == "order.one_more_off"
+ item.product.one_more_enabled = True
+ item.notes = "no ice"
+ item.selected_options = json.dumps([{"id": None, "name": "Sweet", "price_delta": 0.0, "type": "quick"}])
+ db.commit()
+ before = len(lines(db, o.id))
+ r = client.post(url, headers=shop["h"], json={"quantity": 2})
+ assert r.status_code == 200, r.text
+ new = lines(db, o.id)[-1]
+ assert len(lines(db, o.id)) == before + 1 and new.id != item.id
+ assert (new.product_id, new.quantity, new.notes, new.status) == (item.product_id, 2, "no ice", "active")
+ assert json.loads(new.selected_options)[0]["name"] == "Sweet" and new.unit_price == 4.0
+ assert len(printed["tickets"]) == 1 # sent to the kitchen like any new line
+ # from a paid line too; never from a cancelled one
+ paid = shop["items"][2]
+ assert client.post(f"/api/orders/{o.id}/items/{paid.id}/again", headers=shop["h"], json={}).status_code == 200
+ paid.status = "cancelled"
+ db.commit()
+ assert err(client.post(f"/api/orders/{o.id}/items/{paid.id}/again", headers=shop["h"], json={})) == "order.one_more_line"
+
+
+def test_one_more_needs_ordering_orders_open(client, db, shop, login, printed):
+ o, item = shop["order"], shop["items"][0]
+ item.product.one_more_enabled = True
+ db.commit()
+ h = login(shop["new_waiter"](remove=("ordering.orders.open",)), client="waiter")
+ assert err(client.post(f"/api/orders/{o.id}/items/{item.id}/again", headers=h, json={})) == "access.denied"
+
+
+def test_quantity_follows_the_venue_and_the_key(client, db, shop, login, printed):
+ o, item = shop["order"], shop["items"][0]
+ url = f"/api/orders/{o.id}/items/{item.id}/quantity"
+ assert err(client.post(url, headers=shop["h"], json={"quantity": 3})) == "order.quantity_change_off"
+ setting(db, "orders.quantity_change", "add_only")
+ # a waiter without the key: a manager may approve it
+ assert err(client.post(url, headers=shop["h"], json={"quantity": 3})) == "access.override_possible"
+ h = login(shop["new_waiter"](add=("ordering.items.change_quantity",)), client="waiter")
+ r = client.post(url, headers=h, json={"quantity": 3})
+ assert r.status_code == 200, r.text
+ assert lines(db, o.id)[0].quantity == 3 and printed["tickets"] == [] and printed["cancellations"] == []
+ assert err(client.post(url, headers=h, json={"quantity": 2})) == "order.quantity_remove_off"
+ from models.order import OrderAuditLog
+ log = db.query(OrderAuditLog).filter(OrderAuditLog.event_type == "QUANTITY_CHANGED").one()
+ assert log.note.startswith("1 → 3")
+
+
+def test_lowering_cancels_the_difference_and_asks_about_the_ticket(client, db, shop, login, printed):
+ o, item = shop["order"], shop["items"][0]
+ item.quantity = 5
+ db.commit()
+ setting(db, "orders.quantity_change", "add_and_remove")
+ url = f"/api/orders/{o.id}/items/{item.id}/quantity"
+ # the key, but not the cancel key: a manager's approval for the cancel part
+ h = login(shop["new_waiter"](add=("ordering.items.change_quantity",), remove=("ordering.orders.cancel",)), client="waiter")
+ assert err(client.post(url, headers=h, json={"quantity": 3})) == "access.override_possible"
+ h = login(shop["new_waiter"](add=("ordering.items.change_quantity", "ordering.orders.cancel")), client="waiter")
+ r = client.post(url, headers=h, json={"quantity": 3, "print_cancellation": False})
+ assert r.status_code == 200, r.text
+ part_id = r.json()["cancelled_item_id"]
+ rows = {i.id: i for i in lines(db, o.id)}
+ assert rows[item.id].quantity == 3 and rows[item.id].status == "active"
+ part = rows[part_id]
+ assert (part.quantity, part.status, part.cancel_reason, part.split_from_id) == (2, "cancelled", "quantity lowered", item.id)
+ assert printed["cancellations"] == []
+ r = client.post(url, headers=h, json={"quantity": 2, "print_cancellation": True})
+ assert printed["cancellations"] == [[r.json()["cancelled_item_id"]]]
+
+
+def test_only_unpaid_lines_in_pieces(client, db, shop, printed, login):
+ setting(db, "orders.quantity_change", "add_and_remove")
+ o = shop["order"]
+ paid = shop["items"][2]
+ boss = login(shop["owner"])
+ assert err(client.post(f"/api/orders/{o.id}/items/{paid.id}/quantity", headers=boss, json={"quantity": 2})) == "order.quantity_line"
+ item = shop["items"][0]
+ item.product.unit_type = "kg"
+ db.commit()
+ assert err(client.post(f"/api/orders/{o.id}/items/{item.id}/quantity", headers=boss, json={"quantity": 2})) == "order.quantity_line"
diff --git a/manager_dashboard/src/pages/Settings/sections/OperationSettings.jsx b/manager_dashboard/src/pages/Settings/sections/OperationSettings.jsx
index c7a5e7b..16daa0a 100644
--- a/manager_dashboard/src/pages/Settings/sections/OperationSettings.jsx
+++ b/manager_dashboard/src/pages/Settings/sections/OperationSettings.jsx
@@ -68,9 +68,27 @@ function OrderingSettings() {
itemLabel={o('quickNote')} placeholder={o('newQuickNote')} testId="settings-quick-notes" newTestId="quick-note" />
+
>)
}
+/** A sent line's quantity changed without a new ticket (6F.5). Who may: ordering.items.change_quantity;
+ * lowering also needs ordering.orders.cancel ("What each role may do", a person's permissions). */
+function QuantitySettings({ s }) {
+ const { t } = useTranslation('manager')
+ const q = k => t(`settings.quantity.${k}`)
+ const id = useId()
+ return (
+
+
+
+
+ )
+}
+
/** Prices changed by hand (6F.3): the venue's switch, the reason, the quick reasons. Who may: the
* keys ordering.prices.modify / modify_sent ("What each role may do", a person's permissions). */
function PriceChangeSettings({ s }) {
diff --git a/manager_dashboard/src/pages/products/editor/InfoTabs.jsx b/manager_dashboard/src/pages/products/editor/InfoTabs.jsx
index 8ce85f1..c2154fb 100644
--- a/manager_dashboard/src/pages/products/editor/InfoTabs.jsx
+++ b/manager_dashboard/src/pages/products/editor/InfoTabs.jsx
@@ -43,6 +43,7 @@ export function InfoTab({ form, set, setForm, categories, prepZones }) {
set('allergens', v)} />
set('is_available', v)} label={t('products.editor.available')} info={{t('products.editor.availableTip')}} description={t('products.editor.availableHint')} />
set('quick_add_enabled', v)} label={t('products.editor.quickAdd')} info={{t('products.editor.quickAddTip')}} description={t('products.editor.quickAddHint')} />
+ set('one_more_enabled', v)} label={t('products.editor.oneMore')} info={{t('products.editor.oneMoreTip')}} description={t('products.editor.oneMoreHint')} data-testid="product-one-more" />
set('image', image)} nameAfter={shownText(form.names, venue, form.name)} label={t('media.photo')} testid="product-photo" />
)
diff --git a/manager_dashboard/src/pages/products/editor/formLogic.js b/manager_dashboard/src/pages/products/editor/formLogic.js
index 61ba4d8..861191a 100644
--- a/manager_dashboard/src/pages/products/editor/formLogic.js
+++ b/manager_dashboard/src/pages/products/editor/formLogic.js
@@ -81,6 +81,7 @@ export function buildForm(p) {
cost_simple: p.cost_simple ?? '',
cost_breakdown: (p.cost_breakdown ?? []).map(e => ({ label: e.label, amount: e.amount })),
quick_add_enabled: p.quick_add_enabled ?? true,
+ one_more_enabled: !!p.one_more_enabled, // 6F.5
tags: [...(p.tags ?? [])],
is_service_item: !!p.is_service_item,
fiscal_name: p.fiscal_name ?? '',
@@ -143,6 +144,7 @@ export function buildBody(f, venue = 'el') {
cost_breakdown: f.cost_mode === 'detailed' && f.cost_breakdown.length
? f.cost_breakdown.map(e => ({ label: e.label, amount: num(e.amount) })) : null,
quick_add_enabled: f.quick_add_enabled,
+ one_more_enabled: !!f.one_more_enabled,
tags: f.tags,
is_service_item: f.is_service_item,
fiscal_name: f.fiscal_name.trim() || null,
diff --git a/manager_dashboard/tests/products.test.mjs b/manager_dashboard/tests/products.test.mjs
index f58d2ca..e789c3a 100644
--- a/manager_dashboard/tests/products.test.mjs
+++ b/manager_dashboard/tests/products.test.mjs
@@ -140,3 +140,11 @@ test('a category dropped above or below a row lands where the line showed (2026-
assert.equal(moveIdTo([1, 2, 3], 1, 2, false), null) // already there
assert.equal(moveIdTo([1, 2, 3], 2, 2, true), null)
})
+
+test('"One more" travels with the product, off unless set (6F.5)', () => {
+ assert.equal(buildForm({ name: 'Beer', base_price: 4 }).one_more_enabled, false)
+ const f = buildForm({ name: 'Beer', base_price: 4, one_more_enabled: true })
+ assert.equal(f.one_more_enabled, true)
+ assert.equal(buildBody(f).one_more_enabled, true)
+ assert.equal(buildBody({ ...f, one_more_enabled: false }).one_more_enabled, false)
+})
diff --git a/packages/i18n/locales/el/errors.json b/packages/i18n/locales/el/errors.json
index 7ea98a9..02fbc80 100644
--- a/packages/i18n/locales/el/errors.json
+++ b/packages/i18n/locales/el/errors.json
@@ -105,7 +105,13 @@
"product_unavailable": "Το προϊόν {{product_id}} δεν είναι διαθέσιμο.",
"price_change_off": "Η αλλαγή τιμής με το χέρι είναι κλειστή σε αυτό το κατάστημα.",
"price_change_sent_off": "Οι τιμές αλλάζουν μόνο πριν σταλούν τα είδη.",
- "price_reason_required": "Γράψτε γιατί αλλάζει η τιμή."
+ "price_reason_required": "Γράψτε γιατί αλλάζει η τιμή.",
+ "one_more_off": "Το «Άλλο ένα» δεν είναι ενεργό για αυτό το προϊόν.",
+ "one_more_line": "Αυτή η γραμμή δεν ξαναπαραγγέλνεται με ένα πάτημα.",
+ "quantity_change_off": "Η αλλαγή ποσότητας είναι κλειστή σε αυτό το κατάστημα.",
+ "quantity_remove_off": "Εδώ οι ποσότητες μόνο αυξάνονται.",
+ "quantity_invalid": "Διαλέξτε ακέραιο από 1 έως {{max}}.",
+ "quantity_line": "Η ποσότητα αυτής της γραμμής δεν αλλάζει εδώ."
},
"notification": {
"not_found": "Η ειδοποίηση {{notification_id}} δεν βρέθηκε."
diff --git a/packages/i18n/locales/el/manager.json b/packages/i18n/locales/el/manager.json
index 59bf06f..d465d41 100644
--- a/packages/i18n/locales/el/manager.json
+++ b/packages/i18n/locales/el/manager.json
@@ -759,6 +759,18 @@
"reasonsHint": "Με ένα πάτημα· το προσωπικό μπορεί και να γράψει δική του. Καμία: οι έτοιμες.",
"reasonItem": "Γρήγορη αιτία",
"newReason": "Νέα γρήγορη αιτία…"
+ },
+ "quantity": {
+ "title": "Αλλαγή ποσότητας σταλμένης γραμμής",
+ "intro": "Το προσωπικό διορθώνει πόσα είναι σε μια γραμμή χωρίς να ξαναστείλει στην κουζίνα. Κάθε αλλαγή κρατιέται στο ιστορικό της παραγγελίας.",
+ "when": "Το προσωπικό μπορεί",
+ "whenHint": "Ποιος: «Τι επιτρέπεται σε κάθε ρόλο» και τα δικαιώματα κάθε ατόμου.",
+ "whenTip": "Μόνο προσθήκη: η ποσότητα μόνο ανεβαίνει (μια μπίρα από το ψυγείο), δεν τυπώνεται τίποτα. Προσθήκη και αφαίρεση: όταν κατεβαίνει, η διαφορά ακυρώνεται ως ξεχωριστή γραμμή και ρωτά αν θα σταλεί ακύρωση στην κουζίνα. Η αφαίρεση θέλει και το δικαίωμα ακύρωσης.",
+ "modes": {
+ "off": "Καθόλου",
+ "add_only": "Μόνο προσθήκη",
+ "add_and_remove": "Προσθήκη και αφαίρεση"
+ }
}
},
"logs": {
@@ -2813,7 +2825,10 @@
"availableTip": "Όχι: εξαφανίζεται από τα μενού των σερβιτόρων και του ταμείου μέχρι να το ενεργοποιήσετε ξανά (τελείωσε για σήμερα). Τίποτε άλλο δεν αλλάζει.",
"quickAddTip": "Ναι: ένα πάτημα στη λίστα του σερβιτόρου το προσθέτει κατευθείαν, χωρίς να ανοίξουν οι επιλογές του. Αφήστε το κλειστό για προϊόντα που χρειάζονται επιλογή (ψήσιμο, συνοδευτικά).",
"vatGroupTip": "Ο συντελεστής ΦΠΑ που χρησιμοποιεί η φορολογική απόδειξη για το προϊόν. Χρειάζεται για να πληρωθεί όσο ο φορολογικός μηχανισμός είναι ενεργός.",
- "costTip": "Τι σας κοστίζει μία μονάδα (υλικά, συσκευασία). Οι αναφορές το χρησιμοποιούν για το κέρδος· προϊόντα χωρίς κόστος κάνουν το κέρδος κατώτερη εκτίμηση."
+ "costTip": "Τι σας κοστίζει μία μονάδα (υλικά, συσκευασία). Οι αναφορές το χρησιμοποιούν για το κέρδος· προϊόντα χωρίς κόστος κάνουν το κέρδος κατώτερη εκτίμηση.",
+ "oneMore": "Άλλο ένα (+1)",
+ "oneMoreHint": "Μια σταλμένη γραμμή αυτού του προϊόντος έχει κουμπί +1 στα κινητά και στο ταμείο.",
+ "oneMoreTip": "Για ό,τι τα τραπέζια ξαναπαραγγέλνουν (μπίρες, καφέδες). Το +1 παραγγέλνει το ίδιο ξανά, με τις ίδιες επιλογές και σημείωση, στη σημερινή τιμή, και το στέλνει στην κουζίνα ή στο μπαρ όπως κάθε νέα παραγγελία. Κλειστό αρχικά."
}
},
"menuTabletSettings": {
@@ -3392,7 +3407,9 @@
"ORDER_CANCELLED": "Ακύρωση",
"ITEM_CANCELLED": "Ακύρωση γραμμής",
"PRICE_CHANGED": "Αλλαγή τιμής",
- "PRICE_SET_BY_HAND": "Τιμή με το χέρι (εγκρίθηκε)"
+ "PRICE_SET_BY_HAND": "Τιμή με το χέρι (εγκρίθηκε)",
+ "QUANTITY_CHANGED": "Αλλαγή ποσότητας",
+ "ITEM_REORDERED": "Άλλο ένα"
},
"price": {
"modifier_applied": "Κανόνας τιμής",
diff --git a/packages/i18n/locales/el/modules.json b/packages/i18n/locales/el/modules.json
index 0eeaf17..c834e39 100644
--- a/packages/i18n/locales/el/modules.json
+++ b/packages/i18n/locales/el/modules.json
@@ -464,6 +464,9 @@
"refunds": "Επιστροφή χρημάτων για πληρωμές άλλων βαρδιών",
"payments": {
"revert": "Αναίρεση πληρωμής (πληρωμένα → απλήρωτα)"
+ },
+ "items": {
+ "change_quantity": "Αλλαγή ποσότητας σταλμένης γραμμής (χωρίς νέο δελτίο)"
}
}
},
diff --git a/packages/i18n/locales/el/terminal.json b/packages/i18n/locales/el/terminal.json
index 37b903c..87db9ca 100644
--- a/packages/i18n/locales/el/terminal.json
+++ b/packages/i18n/locales/el/terminal.json
@@ -466,6 +466,11 @@
},
"dialog": {
"close": "Κλείσιμο"
+ },
+ "oneMore": {
+ "send": "Αποστολή +{{count}}",
+ "label": "Άλλο ένα",
+ "sent": "Στάλθηκαν {{count}} ακόμη {{name}}"
}
},
"display": {
diff --git a/packages/i18n/locales/el/waiter.json b/packages/i18n/locales/el/waiter.json
index acafb20..9e9e441 100644
--- a/packages/i18n/locales/el/waiter.json
+++ b/packages/i18n/locales/el/waiter.json
@@ -529,7 +529,9 @@
"moveItems": "Σφάλμα μεταφοράς αντικειμένων",
"flags": "Σφάλμα αποθήκευσης σημαιών",
"combine": "Σφάλμα συνδυασμού",
- "price": "Η τιμή δεν άλλαξε."
+ "price": "Η τιμή δεν άλλαξε.",
+ "again": "Το «άλλο ένα» δεν στάλθηκε.",
+ "quantity": "Η ποσότητα δεν άλλαξε."
},
"openOrder": "Άνοιγμα Παραγγελίας",
"noPaid": "Δεν υπάρχουν πληρωμένα αντικείμενα",
@@ -896,5 +898,25 @@
"items_moved": "Μεταφορά γραμμών",
"orders_merged": "Ένωση τραπεζιών"
}
+ },
+ "oneMore": {
+ "label": "Άλλο ένα",
+ "send": "Αποστολή +{{count}}"
+ },
+ "quantity": {
+ "title": "Αλλαγή ποσότητας",
+ "actionSub": "Διόρθωση ποσότητας· δεν ξαναστέλνεται στην κουζίνα",
+ "now": "Τώρα",
+ "new": "Νέα",
+ "less": "Ένα λιγότερο",
+ "more": "Ένα ακόμη",
+ "save": "Αποθήκευση",
+ "upNote_one": "{{count}} ακόμη, χωρίς νέο δελτίο",
+ "upNote_other": "{{count}} ακόμη, χωρίς νέο δελτίο",
+ "downNote_one": "{{count}} θα ακυρωθεί",
+ "downNote_other": "{{count}} θα ακυρωθούν",
+ "noChange": "Αλλάξτε τη με − και +",
+ "onlyUp": "Σε αυτό το κατάστημα οι ποσότητες μόνο αυξάνονται.",
+ "sendCancel": "Αποστολή ακύρωσης στην κουζίνα"
}
}
diff --git a/packages/i18n/locales/en/errors.json b/packages/i18n/locales/en/errors.json
index ba4b8af..78007fa 100644
--- a/packages/i18n/locales/en/errors.json
+++ b/packages/i18n/locales/en/errors.json
@@ -105,7 +105,13 @@
"product_unavailable": "Product {{product_id}} isn't available.",
"price_change_off": "Changing prices by hand is turned off for this venue.",
"price_change_sent_off": "Prices can only be changed before the items are sent.",
- "price_reason_required": "Say why the price changes."
+ "price_reason_required": "Say why the price changes.",
+ "one_more_off": "\"One more\" isn't turned on for this product.",
+ "one_more_line": "This line can't be ordered again with one tap.",
+ "quantity_change_off": "Changing quantities is turned off for this venue.",
+ "quantity_remove_off": "Quantities can only go up at this venue.",
+ "quantity_invalid": "Choose a whole number from 1 to {{max}}.",
+ "quantity_line": "This line's quantity can't be changed here."
},
"notification": {
"not_found": "Notification {{notification_id}} not found."
diff --git a/packages/i18n/locales/en/manager.json b/packages/i18n/locales/en/manager.json
index 48499f1..b5d943c 100644
--- a/packages/i18n/locales/en/manager.json
+++ b/packages/i18n/locales/en/manager.json
@@ -759,6 +759,18 @@
"reasonsHint": "Offered with one tap; staff can still type their own. None: the built-in ones.",
"reasonItem": "Quick reason",
"newReason": "A new quick reason…"
+ },
+ "quantity": {
+ "title": "Changing a sent line's quantity",
+ "intro": "Staff correct how many of a line there are without sending it to the kitchen again. Every change is kept in the order's history.",
+ "when": "Staff may",
+ "whenHint": "Who may: \"What each role may do\" and each person's permissions.",
+ "whenTip": "Only add: the quantity can go up (a beer taken from the fridge), nothing is printed. Add and remove: lowering it also cancels the difference as its own cancelled line, and asks whether to send a cancellation to the kitchen. Removing needs the permission to cancel too.",
+ "modes": {
+ "off": "Not at all",
+ "add_only": "Only add",
+ "add_and_remove": "Add and remove"
+ }
}
},
"logs": {
@@ -2813,7 +2825,10 @@
"availableTip": "Off: it disappears from the waiters' and the counter's menus until you switch it back on (sold out today). Nothing else about it changes.",
"quickAddTip": "On: one tap in the waiter's product list adds it straight to the order without opening its choices. Leave it off for products whose choices must be picked (cooking, sides).",
"vatGroupTip": "The VAT rate the fiscal receipt uses for this product. Needed before it can be paid while the fiscal device is on.",
- "costTip": "What one unit costs you (ingredients, packaging). Reports use it for the profit; products without a cost make the profit a lower estimate."
+ "costTip": "What one unit costs you (ingredients, packaging). Reports use it for the profit; products without a cost make the profit a lower estimate.",
+ "oneMore": "One more (+1)",
+ "oneMoreHint": "A sent line of this product gets a +1 button on the phones and the counter.",
+ "oneMoreTip": "For what tables keep ordering again (beers, coffees). +1 orders the same again, with the same choices and note, at today's price, and sends it to the kitchen or bar like any new order. Off by default."
}
},
"menuTabletSettings": {
@@ -3392,7 +3407,9 @@
"ORDER_CANCELLED": "Cancelled",
"ITEM_CANCELLED": "Line cancelled",
"PRICE_CHANGED": "Price changed",
- "PRICE_SET_BY_HAND": "Price set by hand (approved)"
+ "PRICE_SET_BY_HAND": "Price set by hand (approved)",
+ "QUANTITY_CHANGED": "Quantity changed",
+ "ITEM_REORDERED": "One more"
},
"price": {
"modifier_applied": "Price rule",
diff --git a/packages/i18n/locales/en/modules.json b/packages/i18n/locales/en/modules.json
index 967a58e..c87dfce 100644
--- a/packages/i18n/locales/en/modules.json
+++ b/packages/i18n/locales/en/modules.json
@@ -464,6 +464,9 @@
"refunds": "Refund payments from other shifts",
"payments": {
"revert": "Turn paid items back to unpaid"
+ },
+ "items": {
+ "change_quantity": "Change a sent line's quantity (no new ticket)"
}
}
},
diff --git a/packages/i18n/locales/en/terminal.json b/packages/i18n/locales/en/terminal.json
index 54dbbc9..f27e754 100644
--- a/packages/i18n/locales/en/terminal.json
+++ b/packages/i18n/locales/en/terminal.json
@@ -466,6 +466,11 @@
},
"dialog": {
"close": "Close"
+ },
+ "oneMore": {
+ "send": "Send +{{count}}",
+ "label": "One more",
+ "sent": "{{count}} more {{name}} sent"
}
},
"display": {
diff --git a/packages/i18n/locales/en/waiter.json b/packages/i18n/locales/en/waiter.json
index ed0100a..c14bc68 100644
--- a/packages/i18n/locales/en/waiter.json
+++ b/packages/i18n/locales/en/waiter.json
@@ -529,7 +529,9 @@
"moveItems": "Couldn't move the items",
"flags": "Couldn't save the flags",
"combine": "Couldn't combine the lines",
- "price": "The price didn't change."
+ "price": "The price didn't change.",
+ "again": "One more wasn't sent.",
+ "quantity": "The quantity didn't change."
},
"openOrder": "Open an order",
"noPaid": "No paid items",
@@ -896,5 +898,25 @@
"items_moved": "Lines moved",
"orders_merged": "Tables joined"
}
+ },
+ "oneMore": {
+ "label": "One more",
+ "send": "Send +{{count}}"
+ },
+ "quantity": {
+ "title": "Change quantity",
+ "actionSub": "Correct how many; nothing is sent to the kitchen again",
+ "now": "Now",
+ "new": "New",
+ "less": "One less",
+ "more": "One more",
+ "save": "Save",
+ "upNote_one": "{{count}} more, without a new ticket",
+ "upNote_other": "{{count}} more, without a new ticket",
+ "downNote_one": "{{count}} will be cancelled",
+ "downNote_other": "{{count}} will be cancelled",
+ "noChange": "Use − and + to change it",
+ "onlyUp": "At this venue quantities only go up.",
+ "sendCancel": "Send a cancellation to the kitchen"
}
}
diff --git a/terminal/src/apps/pos/OneMore.jsx b/terminal/src/apps/pos/OneMore.jsx
new file mode 100644
index 0000000..448b0e6
--- /dev/null
+++ b/terminal/src/apps/pos/OneMore.jsx
@@ -0,0 +1,34 @@
+// "+1" on a sent line at the counter (plan 6F.5; the waiter app has the same): the first tap arms
+// it, more taps count up, "Send +N" sends one more of the same line (printed as new); 4 s without
+// a tap puts it back. Nothing is sent by one stray tap.
+import { useEffect, useRef, useState } from 'react'
+import { useTranslation } from '@xenia/i18n'
+import { Button } from '@xenia/ui'
+
+const WAIT_MS = 4000
+
+export default function OneMore({ onSend }) {
+ const { t } = useTranslation('terminal')
+ const [count, setCount] = useState(0)
+ const [busy, setBusy] = useState(false)
+ const timer = useRef(null)
+ useEffect(() => () => clearTimeout(timer.current), [])
+ const tap = () => {
+ if (busy) return
+ setCount(c => Math.min(c + 1, 20))
+ clearTimeout(timer.current)
+ timer.current = setTimeout(() => setCount(0), WAIT_MS)
+ }
+ const send = async () => {
+ if (busy || !count) return
+ clearTimeout(timer.current)
+ setBusy(true)
+ try { await onSend(count) } finally { setBusy(false); setCount(0) }
+ }
+ return (
+
+ {count > 0 && }
+
+
+ )
+}
diff --git a/terminal/src/apps/pos/TablePanel.jsx b/terminal/src/apps/pos/TablePanel.jsx
index 73af852..38a6a3e 100644
--- a/terminal/src/apps/pos/TablePanel.jsx
+++ b/terminal/src/apps/pos/TablePanel.jsx
@@ -12,6 +12,7 @@ import client from '../../api/client'
import CartLine from './CartLine'
import { setLineQty } from './logic/cart'
import { itemPayments, orderLines, orderSums, qtyLabel, tableState, toPay } from './logic/tables'
+import OneMore from './OneMore'
import PaymentDialog from './PaymentDialog'
import { PaidSummary } from './SaleCart'
import { useOrder, useQuote } from './usePos'
@@ -111,7 +112,14 @@ export default function TablePanel({ table, cart, setCart, byId, canDiscount, on
{t('pos.table.onOrder')}{formatMoney(sums.total)}
{lines.map(l => (
- toggle(l.id)} />
+