WFDASH-WEBAPP/public/pos
Dave bcd9b88dd4 fix(pos): revive the dead "Print cash-up" button, add 20c/10c denominations
The button has never worked. cashup.html wires it with an inline
onclick="printCashup()", but the page's whole script is IIFE-wrapped, so
printCashup was never a global — the click threw "ReferenceError:
printCashup is not defined" into the console and the button silently did
nothing. No alert, no dialog, no feedback.

Dead since 46d5d54 swapped the button from onclick="window.print()" (a
real global, so it worked) to the ePOS-Print path. receipt.html hit this
exact bug earlier and fixed it by exporting its handlers to window — with
a comment noting the buttons "all silently do nothing". cashup.html never
got the same line. It does now.

On the network transport the cash-up slip already mirrored the sale slip
(resolve 'cashup' blocks -> letterheadLogoRaster at 384 -> printViaNetwork),
so the export is the whole fix for a till on a network printer.

Also here:

- 20c and 10c added to the drawer count, with the total rounded to whole
  cents. Neither is exact in binary floating point, so 3x10c would
  otherwise have summed to 0.30000000000000004 and printed a variance
  that reads as a rounding bug on the slip.
- The button restored its label with textContent, which dropped its
  printer <svg> permanently on first use. Restores innerHTML instead.
- The Bluetooth branch quietly called window.print() (OS dialog, not the
  thermal printer). getSettings() DEFAULTS to bluetooth, so any till with
  cleared settings would land there and look dead all over again. It now
  fails loudly, matching EposPrint.printTest()'s stance. No ESC/POS
  cash-up renderer yet — only the sale slip speaks Bluetooth.

pos-app.js had the same defect in four more places: the edit-line modal's
Save / Cancel / Remove and the customer "Remove" chip are all inline
onclick handlers declared inside its IIFE, and only openEditLine was
exported — so the modal could be opened but not dismissed or committed.
Confirmed by parsing the file (one top-level statement, no top-level
function declarations), fixed with four additive export lines.

src/lib/pos-inline-handlers.test.ts guards the class across every POS
page: any identifier called from an inline on* attribute must be a
builtin, a namespaced call, or exported on window. It was red on exactly
these bugs and is green now.

SW cache bumped to pos-v26 so the tills pick the files up.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 07:30:11 +02:00
..
fa fix(pos): correct Font Awesome webfont URL in bundled CSS 2026-08-31 18:04:14 +02:00
cashup.html fix(pos): revive the dead "Print cash-up" button, add 20c/10c denominations 2026-09-19 07:30:11 +02:00
epos-print.js fix(pos): print the letterhead's own logo, and match delivery note to the sale slip 2026-09-06 23:03:24 +02:00
history.html feat(pos): wire history reprint to redirect to receipt page 2026-09-03 18:28:55 +02:00
index.html feat(pos): letterhead service + 2 API endpoints + vat_percent on Letterhead type 2026-09-04 09:13:53 +02:00
letterhead-config.js feat(pos): letterhead service + 2 API endpoints + vat_percent on Letterhead type 2026-09-04 09:13:53 +02:00
manifest.json chore(pos): bump SW cache to v13, skip /api/ caching, scope manifest to /pos/ 2026-08-31 01:48:49 +02:00
pos-app.js fix(pos): revive the dead "Print cash-up" button, add 20c/10c denominations 2026-09-19 07:30:11 +02:00
pos-config.js feat(pos): enhance POS configuration to handle missing API key prompts gracefully and add slip preview functionality in settings 2026-09-04 11:55:38 +02:00
pos.html feat(pos): letterhead service + 2 API endpoints + vat_percent on Letterhead type 2026-09-04 09:13:53 +02:00
receipt.html fix(pos): print the letterhead's own logo, and match delivery note to the sale slip 2026-09-06 23:03:24 +02:00
settings.html feat(pos): add slip-layout.html block editor, move preview out of settings.html 2026-09-04 13:42:01 +02:00
slip-layout.html fix(pos): print the letterhead's own logo, and match delivery note to the sale slip 2026-09-06 23:03:24 +02:00
slip-layout.js fix(pos): print the letterhead's own logo, and match delivery note to the sale slip 2026-09-06 23:03:24 +02:00
sw.js fix(pos): revive the dead "Print cash-up" button, add 20c/10c denominations 2026-09-19 07:30:11 +02:00
test-longpress.html feat(pos): enhance POS configuration to handle missing API key prompts gracefully and add slip preview functionality in settings 2026-09-04 11:55:38 +02:00
theme.js