Repository navigation
One tile per payment method, however many times it is listed - #639
Merged
Merged
Conversation
Owner, with two identical Cash tiles on the payment panel, both showing the same 690: "two cash i am seeing. i added via setting already showing one." Cash is built into both payment screens, and the shop's own payment list from Settings was appended after it without anybody checking what was already there. A shop that had also added "Cash" got a second tile for it. That is not a cosmetic duplicate. Both tiles render id="Cash" on the radio and the same derived id on the amount box, and both read the same entry out of the stored split, so a 690 rupee bill showed 690 in each and typing into one never reached the other. The same went for a shop that listed Razorpay next to the built-in Qrpay button. Both screens now append through one guard that remembers what it has drawn. A built-in registers its id and its title, so Qrpay also answers to Razorpay. The match is deliberately loose, because these names are typed by hand: Cash, cash and CASH are one method. While here: SalePaymentType.leght was a typo for length, so the guard around that loop was always true and hid the fact that nothing checked the list at all. $.each handles an empty list, so the guard is gone and the list falls back to empty rather than throwing. tests/one-tile-per-payment-method.test.js pins the rule rather than the wording: one place appends, it is inside the guard, the built-ins register themselves, and the shop's list goes through the same door. Checked by removing the guard and watching it fail.
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 |
sridharkalaibala
added a commit
that referenced
this pull request
Sep 13, 2026
## Release: promote develop to main Everything since the last release, 150 commits. The printing work for the Azure site is the reason to ship this one. ### The printing fixes, in the order they matter - **The kitchen printer starts with the till** (#641). It was only ever started by opening Hardware Manager, so after any restart a kitchen printed nothing until somebody opened a settings window. Never, to about 250 ms. - **One PowerShell kept warm instead of one per copy** (#643). Measured 350 to 550 ms per copy before, 1 to 2 ms now. Most of that was recompiling the same C# class on every print. - **The printer list is cached** (#643). A 2.1 second spooler enumeration was sitting between the cashier and any receipt that used the Windows default. - **The floor bill goes to the receipt printer** (#640). It went to whatever Windows called the default, so in a two-printer restaurant the customer's bill came out beside the cook. - **A printer named POS-80C can be addressed** (#643). It was silently redirected to the Windows default. That is the factory name on most generic 80mm units. - **The kitchen ticket says what happened** (#642). Item Cancelled and Items Cancelled instead of calling every removal an order cancellation, Additional Order instead of Modified Order, and the table on its own line at double the size. ### Also in - One tile per payment method (#639): a shop that added Cash in Settings got two Cash tiles sharing element ids and one stored amount. - Sample data hides every kind of record when switched off, with a dashboard card and counts (#624). - The ordering assistant runs a whole order and talks like a waiter (#625), orders remember their device (#627), UPI from any app (#629), and a grace window on cancellation (#633). ### Merging Merge with a merge commit, **not squash**: each squash makes the next release conflict. ### After merging ```bash git checkout main && git pull git tag vX.Y.Z && git push origin vX.Y.Z ``` --------- Signed-off-by: Tyagiquamar <[email protected]> Signed-off-by: Sridhar Bala <[email protected]> Signed-off-by: Sridhar Bala <[email protected]> Co-authored-by: Tyagiquamar <[email protected]> Co-authored-by: Sridhar Bala <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
Owner, with two identical Cash tiles on the payment panel, both showing the same 690: "two cash i am seeing. i added via setting already showing one."
Why
Cash is built into both payment screens, and the shop's own list from Settings was appended after it with no check for what was already drawn:
A shop that also added "Cash" in Settings got a second tile. Not cosmetic: both render
id="Cash"on the radio and the same derived id on the amount box, and both read the same entry from the stored split. So the bill showed 690 in each, and typing into one never reached the other. A shop that listed "Razorpay" beside the built-in Qrpay button had the same problem.What changes
Both screens append through one guard that remembers what it has drawn. A built-in registers its id and its title, so Qrpay also answers to Razorpay. The match is loose on purpose, because these names are typed by hand:
Cash,cashandCASHare one method.Also,
SalePaymentType.leghtwas a typo forlength.undefined !== 0is always true, so that guard protected nothing and hid the fact that nothing here checked the list at all. It is gone, and the list falls back to empty instead of throwing.Tests
tests/one-tile-per-payment-method.test.jspins the rule, not the wording: exactly one place appends a tile, it sits inside the guard, both built-ins register themselves, and the shop's own list goes through the same door. Verified by removing the guard and watching the test fail. Desktop suite 1,909 passing.