Skip to content

The bill reads like a bill - #835

Merged
sridharkalaibala merged 17 commits into
developfrom
feat/the-bill-reads-like-a-bill
Sep 16, 2026
Merged

sridharkalaibala merged 17 commits into
developfrom
feat/the-bill-reads-like-a-bill

Conversation

@sridharkalaibala

Copy link
Copy Markdown
Contributor

From a printed bill off Azure's till:

"Table number, order type, covers, total quantity all these information can organize better as per international standards and may be two column or moving total quantity to bottom."

Two different mistakes, and right about both.

Four facts took four lines. Table, order type and covers are read at a glance, not down a list, and stacked one per line they pushed the items further down the paper than the things a guest is actually checking. Now two to a line:

Table               6A  Order type       Dine-in
Covers               4
Total Qty                                      5
Subtotal                                 2290.00

The two-character gutter is load bearing - without it the left value runs into the right label and prints 6AOrder type.

Narrow paper keeps one to a line on purpose. A 58mm roll is 32 characters; halved, that turns "Order type" into "Order ty.". Losing a word to save a line is the wrong trade on the one document the guest keeps.

The count was in the wrong place entirely. Total quantity is not a fact about the table, it is part of the arithmetic - how many things, what they came to. It sat in the header beside the table number, which is where the restaurant looks and not where the guest does. It now prints immediately above the subtotal, and a test pins that nothing is allowed between the two.

Tests

7 new, driven through the real renderer and read back out of the bytes with escpos-preview, so they assert on what the paper says rather than on the source.

The existing switch-liveness test (every switch actually changes the bill when it is turned on) needed teaching rather than loosening: it assumed every switch writes a header row. It now accepts a switch that changes the bill anywhere, and still refuses one that changes nothing.

2809 desktop tests pass.

Not from this branch

tests/unit/middleware/items.validation.test.js and tests/unit/routes/items.routes.test.js fail to load on main already - 2 suites, 0 tests run - and reproduce with this branch stashed. Worth someone looking, since main is the deploy source.

Release: nutrition that can be filled in, and filters that answer with something
Release: the nutrition chain works end to end
Release: the bill, a number nobody can ring, and the pass driven rather than read
Release: one tap says how hot, and the ordering page stops throwing away its dish facts
Release: the catalogue stops throwing away the market price, and the receipt tab stops throwing
Release: the kitchen says when it is behind, and the spice choice can actually be switched on
Release: a restaurant gets a restaurant, and a kitchen can say how long it takes
Release: an order says when it will usually be ready
Release: a table can call somebody over
Release: the browser download stops using a zip reader that trusts symlinks
Release: a call that was answered stops asking
Release: a shop can hide the busy-kitchen notice, and the demo has photographs
Release: an order that changed under you, and a guard that does not write what it was given
Owner, holding a printed bill from Azure: "Table number, order type,
covers, total quantity all these information can organize better as per
international standards and may be two column or moving total quantity
to bottom."

Two different mistakes, and he is right about both.

FOUR FACTS TOOK FOUR LINES. Table, order type and covers are read at a
glance, not down a list, and stacked one per line they pushed the items
further down the paper than the things a guest is actually checking.
They now sit two to a line with a two-character gutter, because without
one the left value runs straight into the right label and prints
"6AOrder type".

Narrow paper keeps one to a line on purpose. A 58mm roll is 32
characters; halved that turns "Order type" into "Order ty.", and losing
a word to save a line is the wrong trade on the document the guest
keeps.

THE COUNT WAS IN THE WRONG PLACE ENTIRELY. Total quantity is not a fact
about the table, it is part of the arithmetic: how many things, what
they came to. It sat in the header beside the table number, which is
where the restaurant looks and not where the guest does. It now prints
immediately above the subtotal, and the test pins that nothing is
allowed between the two.

7 new tests, driven through the real renderer and read back out of the
bytes with escpos-preview. The switch-liveness test learned where the
count went rather than being loosened - it still refuses a switch that
changes nothing, it just no longer assumes every switch writes a header
row.

2809 desktop tests pass. Two api suites fail to load on main already,
from an earlier merge, and are untouched by this.
It asserted the exact contents of serviceRows, including
{ label: 'Total Qty', value: '5' }, so moving the count down to the
totals read as a deletion.

Taught rather than loosened. It still pins every other service row
exactly, and now also asserts the count is on the payload as totalQty,
is NOT in serviceRows, and actually prints - so the row cannot quietly
disappear altogether, which is the thing the original assertion was
there to prevent.
@sridharkalaibala
sridharkalaibala merged commit 90cec1e into develop Sep 16, 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 16, 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