A paid table is not an open one, and a printed bill is not the end of it - #906
Merged
Merged
Conversation
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.
Contributor
|
Merged to 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:3000When you have tested it, say what you did and what happened, and set Reporting that something is broken is as useful as fixing it. It is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three faults on the floor screen, reported in one message:
A tapped table listed settled orders
The grid of tables is
getTablesWithActiveOrders: branch,sale_processKOT,payment_statusUnpaid. 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.jsforces it back on every write - sopayment_statusis 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.jsand 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.afterPrintreset 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
refreshKOTDatabounced through#/dashboardand 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.