Skip to content

feat(bills): allow editing items and quantities on a running table's unpaid bill #1102

Closed

Description

@itsbkm

Problem

Staff need to edit the bill of a running (open) table. Reported by a user as very important.

Decisions

  • All four cases are in scope: edit quantity, replace an item, edit after the bill was printed, edit from the POS table checkout, and edit after a partial payment.
  • Only the owner may do it: new permission orders.item.edit (owner by default, configurable in the permission matrix).

Findings

  • Adding, cancelling, voiding and restoring items already re-sync unpaid bills (syncUnpaidBillsForOrder).
  • Item cancel already exists on the Orders screen for unpaid bills.
  • The real gap was that no endpoint changed an existing item's quantity or swapped the item.

Implementation (commit 22f0175 on fix/bill-cancelled-items-and-running-table-edit)

  • PATCH /orders/:orderId/items/:itemId/edit with quantity or replacement, optional reason.
  • The old line is cancelled with stock restored and a new line is inserted. A quantity edit keeps the original unit and add-on prices. A quantity increase on a line the kitchen already started adds only the extra units as a new pending line. A decrease keeps the line's kitchen status.
  • Unpaid and partially paid bills are re-synced. Refused with 409 on split, paid or refunded orders, and when the new total would fall below the amount already collected.
  • Audited as item_edited.
  • Edit dialog on the Orders list, the order detail panel and the POS table checkout.
  • Tests: tests/order-item-edit.test.ts.

Known limits

  • Replacement products with add-on groups are not offered in the dialog.
  • Editing an already-served line restores and re-deducts stock, so the net stock is right but the audit shows a cancel and a re-add.
  • The UI has not been exercised in the running app yet.

Activity

  1. added
    area:frontend
    area:backend
    priority:high
    type:bug
    type:feature
    and removed
    type:bug
    on Oct 12, 2026
  2. changed the title [-]fix(bills): keep unpaid bill in sync when items change on a running table and allow quantity edits[/-] [+]feat(bills): allow editing items and quantities on a running table's unpaid bill[/+] on Oct 12, 2026
  3. added
    state:needs-design
    and removed
    state:needs-design
    on Oct 12, 2026
  4. khaira777 commented on Oct 14, 2026

    @khaira777
    Contributor

    Work in progress on existing PR #1103 branch fix/bill-cancelled-items-and-running-table-edit: completing idempotent retry safety, expected_edit_version concurrency guard, started-item stock/waste handling, and superseded-line filtering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:backendarea:frontendpriority:hightype:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions