WFDASH-WEBAPP/public
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
..
icons feat: add picking slips, bulk print tracking, supplier map 2026-07-10 10:47:11 +02:00
letterhead feat: add branded quote PDF generation and in-app viewer 2026-06-23 08:30:38 +02:00
pos fix(pos): revive the dead "Print cash-up" button, add 20c/10c denominations 2026-09-19 07:30:11 +02:00
android-chrome-192x192.png feat(dashboard): add multi-theme system and supporting improvements 2026-06-26 17:59:40 +02:00
android-chrome-512x512.png feat(dashboard): add multi-theme system and supporting improvements 2026-06-26 17:59:40 +02:00
apple-touch-icon.png feat(dashboard): add multi-theme system and supporting improvements 2026-06-26 17:59:40 +02:00
favicon-16x16.png feat(dashboard): add multi-theme system and supporting improvements 2026-06-26 17:59:40 +02:00
favicon-32x32.png feat(dashboard): add multi-theme system and supporting improvements 2026-06-26 17:59:40 +02:00
favicon-96x96.png feat(dashboard): add multi-theme system and supporting improvements 2026-06-26 17:59:40 +02:00
favicon.ico feat(dashboard): add multi-theme system and supporting improvements 2026-06-26 17:59:40 +02:00
file.svg feat: add UI components for separator, sheet, sonner, switch, table, tabs, textarea, tooltip 2026-05-24 16:31:01 +02:00
globe.svg feat: add UI components for separator, sheet, sonner, switch, table, tabs, textarea, tooltip 2026-05-24 16:31:01 +02:00
manifest-counter.json feat(counter): add standalone counter order PWA 2026-08-13 09:27:20 +02:00
manifest-mobile.json fix(boss-dashboard): make /m installable as a PWA 2026-08-31 22:14:48 +02:00
manifest-rep.json feat(rep): visit check-in PWA — phone GPS, offline outbox 2026-09-06 21:09:27 +02:00
manifest.json feat(dashboard): add multi-theme system and supporting improvements 2026-06-26 17:59:40 +02:00
next.svg feat: add UI components for separator, sheet, sonner, switch, table, tabs, textarea, tooltip 2026-05-24 16:31:01 +02:00
og-image.png feat(dashboard): add multi-theme system and supporting improvements 2026-06-26 17:59:40 +02:00
og-square.png feat(dashboard): add multi-theme system and supporting improvements 2026-06-26 17:59:40 +02:00
sw-counter.js feat(counter): add standalone counter order PWA 2026-08-13 09:27:20 +02:00
sw-mobile.js feat: implement per-route service worker selection 2026-09-02 07:49:38 +02:00
sw-rep.js feat(rep): visit check-in PWA — phone GPS, offline outbox 2026-09-06 21:09:27 +02:00
sw.js chore: standardize line endings and add full test + config scaffolding 2026-06-11 20:30:02 +02:00
twitter-image.png feat(dashboard): add multi-theme system and supporting improvements 2026-06-26 17:59:40 +02:00
vercel.svg feat: add UI components for separator, sheet, sonner, switch, table, tabs, textarea, tooltip 2026-05-24 16:31:01 +02:00
wfdash-logo-icon.png chore: add logos, opencode config and build assets 2026-07-27 08:21:20 +02:00
wfdash-logo-mark.png chore: add logos, opencode config and build assets 2026-07-27 08:21:20 +02:00
wfdash-logo.png chore: add logos, opencode config and build assets 2026-07-27 08:21:20 +02:00
window.svg feat: add UI components for separator, sheet, sonner, switch, table, tabs, textarea, tooltip 2026-05-24 16:31:01 +02:00