feat: printable daily sales summary with localized receipt - #236
Open
pagcoinbr wants to merge 1 commit into
Open
feat: printable daily sales summary with localized receipt#236pagcoinbr wants to merge 1 commit into
pagcoinbr wants to merge 1 commit into
Conversation
Add a "Print daily summary" action to the last-payments dialog that
totals a day of sales (count, sats, and per-fiat-currency amounts) and
prints a formatted receipt.
- New endpoints GET/POST /api/v1/tposs/{id}/summary[/print]; the POST
variant emits a receipt_print websocket event so a wrapper/companion
print app can drive an ESC/POS printer, while the plain page falls
back to window.print().
- render_summary_text() with English and Portuguese (pt-BR) templates,
locale-normalized so LNbits UI locales (en-US, pt-BR, pt_br, ...) map
correctly and unknown languages fall back to English.
- The button label and the printed receipt both follow the LNbits UI
language the operator has selected.
- Add a paid_at settlement timestamp (migration m025, backfilled from
updated_at) so summaries range on when a sale settled, not when the
invoice was created.
- Unit tests for render_summary_text.
talvasconcelos
self-requested a review
July 22, 2026 07:37
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.
What
Adds a Print daily summary action to the last-payments dialog. It totals a day of sales — count, total sats, and per-fiat-currency amounts — and prints a formatted receipt.
How
GET/POST /api/v1/tposs/{id}/summary[/print].GETreturns the computed summary (JSON + renderedprint_text).POST .../printemits areceipt_printwebsocket event so a wrapper/companion print app can drive an ESC/POS printer. The plain browser page falls back towindow.print().render_summary_text()with English and Portuguese (pt-BR) templates, locale-normalized so LNbits UI locales (en-US,pt-BR,pt_br, …) map correctly and unknown languages fall back to English.paid_atsettlement timestamp (migrationm025, backfilled fromupdated_at) so summaries range on when a sale settled, not when the invoice was created.render_summary_text.Notes
The
POST .../printpath is designed for kiosk/terminal setups where a companion app listens on the TPoS websocket and forwardsreceipt_printevents to a physical printer. On a normal browser the summary is available viaGETand printed with the browser print dialog, so the feature degrades gracefully without any wrapper.