WFDASH-WEBAPP/public
Dave d98c263f45 feat(scan): standalone delivery-note scanner PWA at /scan
Scan the QR printed on a delivery note, see what it is, and act on it:
reprint, photograph the signed copy, or walk it toward invoicing. It is its
own route group outside `(app)` so it gets a clean full-bleed layout and its
own manifest — "add to home screen" should give the operator a scanner, not
the CRM. Mirrors the pattern `(counter)` already uses.

Two detectors, not one. `BarcodeDetector` is fast and allocation-free but is
Chrome-only: Safari/iOS still has it "Under Consideration" (WebKit bug
#254573) and Firefox does not ship it. A scanner that only used it would
simply not work on an iPhone. So native where it exists, jsQR everywhere
else — pure JS, so no 2 MB WASM payload on a weak warehouse signal, and the
delivery-note QR is always a QR code. Both run against the same canvas frame
so the caller never branches. Also requires HTTPS, which the page says
plainly when it isn't.

The QR carries the human number, so the first call is a new resolve endpoint
mapping number -> PB id. Everything after that speaks ids, which is what every
existing route already takes. The number is shape-validated before any network
call, so a supplier's packing label can't fire a lookup.

STATUS LADDER. mark-invoiced hard-refuses anything that isn't po_received, and
customer-po refuses a note that isn't sent/loaded — so rather than offering a
button that 500s, each action only appears when the server would accept it, and
the card shows which step comes next. It routes draft -> loaded -> po_received
-> invoiced via the existing load-dn, NOT draft -> sent, because draft -> sent
means "create a quote and email it" and a warehouse scan must never trigger
that silently.

The signed-copy upload deliberately uses the upload-only endpoint, not
/api/v1/deliveries/mark-signed-copy — that one flips the note to `completed`
in the same write, which would jump a note straight past invoicing.

Manual entry is always available, so the page works on a device with no camera
or a browser that won't scan.

Tests decode the REAL delivery-note QR through the production fallback path at
print size, and assert the shape check rejects a supplier QR, a random string
and an over-long number.
2026-10-04 13:15:56 +02:00
..
icons feat: add picking slips, bulk print tracking, supplier map 2026-07-10 10:47:11 +02:00
letterhead
pos feat(pos): raise a system delivery note on an account sale 2026-10-04 13:15:29 +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
globe.svg
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-scan.json feat(scan): standalone delivery-note scanner PWA at /scan 2026-10-04 13:15:56 +02:00
manifest.json feat(dashboard): add multi-theme system and supporting improvements 2026-06-26 17:59:40 +02:00
next.svg
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
twitter-image.png feat(dashboard): add multi-theme system and supporting improvements 2026-06-26 17:59:40 +02:00
vercel.svg
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