The bill agrees with itself, and stops talking to the restaurant - #746
Merged
Merged
Conversation
A printed bill read "Paneer Starter 2 x 240 480.00" above a subtotal of
400.00. Two faults were hiding each other: the line carried the tax-inclusive
amount while the subtotal added the exclusive ones, and the unit price was
never printed at all, so the only number a customer could check against the
menu had tax folded into it and the two halves of the document disagreed by
exactly the tax.
The line is now the pre-tax line, with a RATE column beside the quantity:
200.00 x 2 = 400.00, and the tax added once underneath where it can be seen
being added. The column appears only when the payload carries rates, so a
counter receipt is laid out exactly as before.
Three things the bill said that are not its business are now off by default:
UNPAID a document presented at a table asking for money is unpaid by
definition. Removed from both print paths - the browser view and
the main process - or a shop would see it come back depending on
who pressed print.
From: which device sent the order settles a dispute for the shop. The
kitchen ticket still prints it every time.
Table, order type, covers, item count
all of it is the restaurant talking to itself on the customer's
copy, and the kitchen ticket carries every one.
None of it is deleted. A hotel restaurant's tax invoice prints table, session,
steward and covers, so each is a switch: bill_print_source, bill_print_table,
bill_print_dine_type, bill_print_covers, bill_print_steward and
bill_print_total_qty. Absent means OFF, which is the direction that matters
with 90 shops printing today: a default of on would put new rows on every one
of their bills the morning this deploys.
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 was referenced Sep 15, 2026
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.
The bill that did not add up
Two faults, hiding each other. The line printed the tax-inclusive amount
while the subtotal below it added the tax-exclusive ones, and the unit
price was never printed at all. So the only number a customer could check
against the menu was the one with tax folded into it, and the two halves of
the document disagreed by exactly the tax.
Now:
Rate times quantity is the amount, the amounts add to the subtotal, and the
tax is added once underneath where it can be seen being added.
The RATE column appears only when the payload carries rates, so a counter
receipt is laid out exactly as it was - reserving five characters of a
48-character line to head a column of blanks would be a regression paid for by
every shop that is not a restaurant.
Three things the bill was saying that are not its business
UNPAIDunder the headingFrom: Captain appA document presented at a table asking for money is unpaid by definition, so
the stamp said nothing the heading did not, and a customer's copy stamped
UNPAID reads as an accusation rather than a request. It was removed from
both print paths - the browser view and the main process - because one
without the other means the shop sees it come back depending on who pressed
print.
The rest is the restaurant talking to itself on the customer's copy. The
kitchen ticket carries every one of them and is untouched, which is the whole
argument for taking them off the bill; there is a test that fails if the ticket
ever loses them.
None of it is deleted
A hotel restaurant's tax invoice prints table, session, steward and covers, so
each row is a switch rather than a decision taken for every shop at once:
Absent means OFF. That direction is the point: 90 shops are printing today
and a default of on would put new rows on every one of their bills the morning
this deploys. A shop that wants the hotel bill turns them on and gets it.
Read as the settings form stores them, a string, so a saved
'false'is a realvalue - reading it as a boolean is how a switched-off setting silently stays
on, which this codebase has been bitten by before.
Tests
tests/the-bill-adds-up.test.js, 13 cases, built on the sale off thephotographed bill. The arithmetic, the paper, each thing that no longer prints,
each switch that brings it back, a switch turned on for something the sale does
not have, the kitchen ticket keeping all of it, and no line wider than the roll.
The suites: POS 2413 pass / 0 fail, API 10619 pass / 0 fail.
Four existing tests pinned the old defaults and now pin the new ones, each with
the reversal written down rather than quietly edited.