Skip to content

A paid table is not an open one, and a printed bill is not the end of it - #906

Merged
sridharkalaibala merged 1 commit into
developfrom
fix/a-paid-table-is-not-an-open-one
Sep 18, 2026
Merged

sridharkalaibala merged 1 commit into
developfrom
fix/a-paid-table-is-not-an-open-one

Conversation

@sridharkalaibala

Copy link
Copy Markdown
Contributor

Three faults on the floor screen, reported in one message:

after pyament still have issue i think when table clicked its howing old order. next after print bill that right display closed. it mean page refreshed and selected table not selected more. if i click print bill then i need success message bill printed and show same page. if i click take payment and payment is over then remove that table from screen and also clear from that able.

A tapped table listed settled orders

The grid of tables is getTablesWithActiveOrders: branch, sale_process KOT, payment_status Unpaid. The panel beside it asked for the same table without the payment clause, so the two disagreed.

That matters because a Table-Order sale keeps sale_process: 'KOT' after it is paid - sale.service.js forces it back on every write - so payment_status is the only thing separating a live table from a finished one. A table stayed on screen on the strength of one open ticket, and tapping it then listed every KOT that table had ever had, each with a live Take Payment button beside it.

There are three copies of that query in kot.js and only one is reached today. All three take the clause; the two nothing calls are exactly how this comes back wrong.

Printing a bill deselected the table

A selected table is #/kot/6. afterPrint reset the address to its first part, which is #/kot - the same screen with nothing on the right of it. The paper came out and the order vanished, so the waiter had to find the table again to take the money.

Printing a bill is not the end of that table. Settling is, and settling already clears it.

The success message asked for is already there from #7: the desktop print path names the printer the bill went to, from the main process's per-printer report. It was being shown and then immediately buried by the page reset.

Settling rebuilt the whole app

refreshKOTData bounced through #/dashboard and back to #/kot "to force change detection". That tore the page down, drew the dashboard for a frame and rebuilt the floor from nothing, twice per settlement.

There is nothing to force: both halves of the screen are filled by a request, so asking again is the refresh. The selection is dropped, the panel returns to its prompt straight away, and the grid is re-read - at which point a settled table is simply not in it any more, which is the whole of "remove that table from screen".

Tests

tests/a-settled-table-leaves-the-floor.test.js. The payment clause is swept rather than named, the way the branch-write stamp test sweeps, so a fourth copy of the query added next month is checked too. Each of the four behavioural assertions was confirmed to fail against the previous code and pass now. Full suite: 2996 passing, 0 failing.

Three faults reported together, all on the floor screen.

Tapping a table listed orders that had already been settled. The grid of
tables is getTablesWithActiveOrders - branch, sale_process KOT,
payment_status Unpaid - and the panel beside it asked for the same table
without the payment clause. A Table-Order sale keeps sale_process 'KOT'
after it is paid, because sale.service.js forces it back, so
payment_status is the only thing separating a live table from a finished
one. The table stayed on screen on the strength of one open ticket and
then showed every KOT it had ever had, each with a live Take Payment
button. There are three copies of that query in the file; all three take
the clause, because the two nothing calls today are exactly how it would
come back wrong.

Printing a bill deselected the table. A selected table is #/kot/6 and
afterPrint reset the address to its first part, which is the same screen
with nothing on the right of it. The paper came out and the order
vanished, so the waiter had to find the table again to take the money.
Printing is not the end of that table - settling is, and that already
clears it.

Settling rebuilt the whole app. refreshKOTData bounced through
#/dashboard and back "to force change detection", drawing the wrong page
for a frame and rebuilding the floor from nothing. Both halves of the
screen are filled by a request, so asking again is the refresh: the
selection is dropped, the panel returns to its prompt, and the grid is
re-read, at which point a settled table is simply not in it any more.
@sridharkalaibala
sridharkalaibala merged commit 4b96708 into develop Sep 18, 2026
9 checks passed
@github-actions github-actions Bot added the ready for QA Merged to develop and live on develop.posnic.io - anyone can test it label Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Merged to develop. Anyone can test this - you do not need write access.

Try it at https://develop.posnic.io, or run it yourself:

git fetch origin develop && git checkout develop
npm install && npm --prefix api install
npm run dev   # then http://localhost:3000

When you have tested it, say what you did and what happened, and set
QA passed or QA failed. If you cannot set labels, just comment -
a maintainer will.

Reporting that something is broken is as useful as fixing it. It is
better found here than by a shopkeeper.

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

Labels

ready for QA Merged to develop and live on develop.posnic.io - anyone can test it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant