# v12.1 — POS update

**Consistent confirmations** — the last two browser `confirm()` pop-ups (clear order, change counter) now use the app's own confirm dialog. Removing a charge or payment method uses it too.

**Token number on/off** — Organization → Application mode & POS → *Bill & printing*. Off: no token is issued, none is printed, slips are identified by bill number, and the Sales table hides the column.

**Bill preview inside the app** — the "Sale complete" window and the bill window (Sales → click a bill) show the bill and slips as they will print, without pressing print. Same HTML/CSS as the printed paper. The settings page has a live sample bill.

**Sidebar** — grouped into *Point of Sale* (POS, Sales, Analytics, Menu & Prices), *Inventory* (Inventory … Reports), *Setup* and *Account*. POS-only / Inventory-only modes hide the other group, label included.

**Analytics** (new, POS → Analytics) and charts on Sales → Summary and the Overview strip. Hover tooltips, click-to-hide legends, dark mode. Colours mean the same everywhere: sales blue, profit green, cost amber, discounts rose, charges violet, voided grey. No chart library or CDN.

**Charges** — any number, any name (VAT, service charge, packaging …): percentage or fixed, included-in-price or added, optional "also on charges above", optional skip for tax-exempt items, ordered, with worked examples. Each bill stores its own copy, and reports break charges down by name.

**Payment methods** — any number, any name, reorderable, switch off without losing history, "Cash drawer" flag decides which methods ask for amount received / change. Bills keep the name used at the time.

**Also** — settings page reorganised into tabs; Sales filters re-laid out; amounts no longer wrap; profit now excludes charges (previously tax inflated item margin).

## Upgrading
Replace the files and restart. The database upgrades itself on start: new columns, a `pos_sale_charges` table, and existing bills get a matching charge row. Existing single-tax settings become one charge, and the old `cash/qr/card` list becomes named methods. Nothing is lost.

New files: `public/js/posPricing.js` (pricing, shared by server and till), `public/js/charts.js`, `tests/pricing-charges.test.js`.

**Item thumbnails (POS)** — each tile on the item-choosing screen shows a small square picture (the item's photo, cropped to fill). Items without a photo get a tinted initial-letter badge so tiles stay aligned.

**Fix** — donut charts with a single slice (100% in one category or payment method) drew a malformed ring that spilled over titles and hid the centre text. Full rings are now drawn as two half-arcs, and every chart is clipped to its own card.

**Till cart** — more compact and consistent: one row per cart line (name, quantity controls, amount), a single text/control scale, and payment methods that wrap into a grid instead of overflowing. **Thumbnails** are now cropped and smoothly pre-scaled once in the browser (then cached) instead of being shrunk from the full photo, which looked pixelated.

**Customer name** is optional. Left blank, the bill is saved (and printed) as "<payment method> Customer" — e.g. "eSewa Customer". The "Require a customer name" setting is removed.
