Release notes

What changed in each version of NextPOS. Updates are free while your subscription is active.

1.46.0
2026-10-03

Online renewal, update notice, date-rollback guard, encrypted cloud backup

NextPOS 1.46.0 — Online renewal, update notice, date-rollback guard, encrypted cloud backup

No schema change (still 14500). The new settings live in app_settings. Existing licences, backups and backup settings keep working untouched.

Licence renewal without a file

  • NextPOS asks the NextPOS website for a newer licence for this PC at start-up and after each sign-in (at most once every 6 hours). When a payment has been approved on the site, the renewed licence is downloaded, verified and activated with no action from the shop.
  • Check online for a renewed license on the sign-in screen does the same on demand. An expired shop pays, clicks it, and signs in. Check online is also in Production › License.
  • The downloaded licence passes the same signature and Installation ID checks as a licence file. A working licence is only replaced by one that lasts longer; a perpetual licence is never replaced.
  • In the last 7 days of a dated licence, staff see one reminder after sign-in.
  • Offline shops are unaffected: the stored licence keeps working and the licence file route is unchanged.
  • The PC must be registered under My account on the website (Installation ID) for the server to answer; otherwise the message says so.

Update notice

After sign-in, administrators and managers see a small notice when the website publishes a newer version than the one installed: Download opens the download page and What's new opens the release notes in the browser. Nothing is downloaded or installed by NextPOS itself.

PC date set back

  • Trial and rental deadlines are now measured against the latest time NextPOS has recorded, so setting the Windows date back gains no time.
  • If the Windows date is more than a day behind that record, trial and rental installations stop at the sign-in screen with the reason (state CLOCK) until the date is corrected. Perpetual licences are not affected.
  • Check online resynchronises the record with the server's time. Use it if the PC's date was once set far in the future by mistake and NextPOS now reports the licence as expired.
  • The record is kept in the database and in a license-clock file beside it, so restoring an older backup does not move it back.

Encrypted cloud backup

Settings › Backups › Off-PC protection.

  • Choose the Google Drive or OneDrive folder on the PC (detected folders are suggested), set a recovery password, and save. NextPOS writes and verifies an encrypted copy immediately, so a wrong folder shows at once.
  • After that, every verified backup gets an encrypted copy in <folder>\NextPOS-Cloud-Backups\PC-<first 8 of Installation ID>\*.npbk. The cloud drive uploads it. The newest 14 copies are kept (3–365).
  • NextPOS now re-checks the daily backup every hour while it is open, so a PC that is never switched off still gets each day's backup and cloud copy.
  • A failed cloud copy never fails the local backup. It shows in the panel and as a notice to the administrator on the dashboard.
  • The plain .sqlite3 backups are never copied to the cloud folder. Do not point the older Secondary folder setting at a cloud drive; it copies unencrypted files.

Restoring on a replacement PC: install NextPOS, sign in to the same cloud drive, activate, create the administrator, then Settings › Backups › Restore from a cloud copy… › type the folder and the recovery password › Decrypt. The backup appears in the restore points list; Verify, then Restore as usual.

If the shop forgot the recovery password: each copy is also encrypted to the NextPOS licence issuer key. On the PC that holds issuer-private.pem:

npm run backup:recover -- --file "D:\from-shop\nextpos-daily-....npbk"

It writes a checked .recovered.sqlite3 next to the file. --info shows the shop, PC and date without needing the key. Whoever holds the issuer key can therefore read any shop's cloud backup; keep that key as protected as before.

Limits

  • The update notice only tells; installing is still a manual download and run. The installer is still unsigned, so Windows shows an unknown-publisher warning.
  • Someone who deletes the whole NextPOS data folder still gets a fresh trial.
  • Cloud backup depends on the shop's cloud drive app being signed in and syncing. NextPOS confirms the encrypted file was written to the folder, not that the drive uploaded it.
  • A recovery password change applies to new copies. Older copies still open with the password that was set when they were written.
1.44.0
2026-10-01

Wholesale exclusions, wholesale billing, website price list

Schema 14400 adds one column, sales.sale_type (RETAIL by default). Existing sales and price lists are untouched.

Exclude from the wholesale list

Wholesale prices › Exclude from wholesale list (admin / manager):

  • Categories (e.g. Tablet, Audio), Brands (e.g. Apple), Models (searchable list). Tick to exclude.
  • Excluded items leave the list, the PDF, the WhatsApp images, the website and wholesale billing. Excluded items stay in the picker even when out of stock.
  • Saved with the markup ("Save settings") and rebuilds today's list.

Today's price by hand

On today's list, click any price to type the day's wholesale price. The row shows set by hand and the automatic price; Use automatic puts it back. Hand-set prices survive Regenerate now and markup changes for that day. Every change is in the audit trail.

Wholesale billing

New sale › Retail | Wholesale switch on Sale items.

  • Wholesale: each IMEI is priced from today's list; no price prompt.
  • Phones not on the list (excluded or variant missing) are tagged NOT ON LIST and keep a retail price typed at the counter.
  • Switching back to Retail restores the retail prices (asks if none was typed).
  • Backend: on a wholesale bill a cashier cannot change a listed phone's price; admin / manager can. Lines sold at the list price skip the minimum-margin block (the markup is the approved margin).
  • Invoices print WHOLESALE INVOICE.

Website price list

Wholesale prices › Website (setup: admin; Publish: admin / manager).

  • Sends Brand, Model, RAM/ROM and Price only — never costs, markups or stock counts — to publish.php on the shop website (website/price/).
  • Requests are signed with HMAC-SHA256 over timestamp + body; the secret is never transmitted. The website rejects wrong keys and requests older than 5 minutes.
  • Automatic: after sign-in, every hour while NextPOS is open, and after any change to today's list. Failures never block the counter and retry after 10 minutes; the status line shows the last result.
  • Publish to website sends immediately and reports errors in plain words.
  • website/price/ contains the new page (index.php), receiver, config and install guide.

Tests

  • Rust wholesale::tests: exclusions by brand / model / category, normalised exclusion settings, hand-set price survives regeneration and is used at checkout, 1.43 lists get variant keys, HMAC RFC 4231 vector, website payload has prices only, endpoint validation; ignored live test publishes to a running price page and checks a wrong key is refused.
  • tests/wholesale.test.ts: sale type sent, retail prices restored, exclusions saved, secret never returned to the screen, website files verify signatures and block config/data, wholesale invoice titles.
1.43.0
2026-09-30

Wholesale price list

Adds a Wholesale prices page (Sales & service) and a wholesale module that can be switched off in the module registry. Schema 14300 adds one table, wholesale_price_lists; existing data is untouched.

How a price is made

For every Brand > Model > RAM/ROM variant with phones in stock:

wholesale price = average purchase cost of the in-stock units × (1 + markup %)

rounded to whole taka. Example: Redmi Note 14 8/256 at 21,000 / 22,000 / 23,000 → average 22,000 → +3% → 22,660. Sold units leave the average; gift cards are excluded.

Markup levels

  • Global percentage (default 3%).
  • Brand percentage overrides global.
  • Model percentage overrides brand.

Empty boxes fall back to the level above. Range −50% to 200%. Saving rebuilds today's list immediately and is recorded in the audit trail.

Daily list

  • The first time anyone opens the page each day, the list is built from that day's stock and saved. Everyone quotes the same prices all day.
  • Regenerate now (admin/manager) rebuilds today's list after new purchases.
  • Past days stay available from the List date picker (last 90 lists).

Sharing

  • Export PDF: A4, shop name/address/phone, date, Brand > Model > RAM/ROM > Price, "Prices valid for <date> only". Preview, print or save.
  • Save WhatsApp image: 1080 px wide PNG (split into parts of 40 rows).
  • Copy image: puts the image on the clipboard to paste straight into WhatsApp.
  • Files go to Documents\NextPOS\Wholesale.
  • Purchase costs and markups never appear in the PDF or images.

Who sees what

  • Admin / manager: prices, units in stock, average cost, markup, settings.
  • Cashier: prices only. Costs are removed in the backend before the list is sent.
  • Inventory staff: no access.

Tests

  • Rust wholesale::tests: 21,000/22,000/23,000 + 3% = 22,660; model > brand > global; one saved list per day, regeneration replaces it; validation; cashiers never receive costs.
  • tests/wholesale.test.ts: grouping, exports contain no cost fields, access.
1.42.0
2026-09-29

Average purchase cost

No database schema change.

The rule

The same model is often bought at different prices, e.g. a Redmi Note 14 8/256 at ৳21,000, ৳22,000 and ৳23,000. Its average cost is ৳22,000.

  • Profit uses each phone's own purchase cost. Selling the ৳21,000 unit records ৳21,000 as its cost, exactly as before.
  • The average is shown next to it so the cashier sees that this unit was cheaper (green) or dearer (amber) than the rest.
  • Average = units still in stock of the same model and RAM/storage; colour is ignored. Sold units leave the average (after the ৳21,000 unit is sold the average becomes ৳22,500).
  • Warning: if the selling price is below the average cost (but still above this unit's cost), the sale line says "Below average cost by ৳…". It is a warning only; the margin rules still decide whether a sale is allowed.

Where it shows

  • New sale → device inspection: Purchase cost ৳21,000 · Avg ৳22,000 of 3 in stock · ৳1,000 below.
  • Selling price prompt: adds "Average cost: ৳22,000 (3 in stock)".
  • Sale line: Purchase ৳21,000 / Avg cost ৳22,000 · ৳1,000 below average.
  • Inventory → Inventory position: new Avg cost column with the in-stock cost range for phones.
  • Inventory → Available product finder: average and range per model group.

Accessories and other quantity items

Receiving stock used to overwrite the cost with the latest purchase price. It now keeps a weighted average: (on hand × current cost + received × new cost) ÷ (on hand + received). 10 chargers at ৳1,100 plus 10 at ৳1,200 → ৳1,150 each. When stock is at zero the next purchase price is used as is. Sales of quantity items use this average as their cost, so profit and stock value match what was actually paid. Existing products keep their current cost until the next purchase.

Tests

  • tests/average-cost.test.ts: 21,000/22,000/23,000 → 22,000; sold units leave the average; colour ignored, RAM/storage respected; quantity products.
  • Rust quantity_purchases_use_weighted_average_cost: 1,100 + 1,200 → 1,150; restocking from zero starts fresh.
1.41.0
2026-09-29

Studio: a fresh operator UI

No database schema change. New installs open in Studio; existing users keep their saved appearance and can switch under Appearance → Studio.

What Studio changes

  • Dark navigation rail, light workspace. Compact 34 px nav items, active item marked with an indigo bar, store and operator in the rail.
  • Slim sticky header (64 px). Page title and date on one line; the global IMEI scan, Appearance and New sale (F2) on the right.
  • One brand colour. Indigo #4353D6 for actions, deep ink #111827 for headings and secondary actions; green, amber and red only mean status. Classic's dark-green bands and buttons become deep indigo ink on every screen.
  • Type. Figtree throughout, tabular figures for money, IBM Plex Mono for IMEI, invoice and SKU numbers.
  • Overview. Flat KPI strip with the day's revenue highlighted, attention list with status dots, quieter shortcut tiles.
  • New sale. Larger monospace scan field, indigo Find item, ink payment rail with a 34 px total, one indigo Review invoice action.
  • Sales history. Monospace invoice numbers on one line, selected row highlighted, calmer invoice template picker and print actions.
  • Inventory. Flat stat cards, denser product finder filters and groups.
  • Tables, inputs, dialogs. 36 px headers, 48 px rows, 8 px radius controls with an indigo focus ring, blurred dialog backdrop.

Files

  • src/studio.css — hand-written Studio layer, scoped to :root[data-appearance="studio"], loaded last.
  • scripts/appearance-themes.mjs — Studio colour mapping for all other screens (regenerates src/appearance-themes.css).
  • src/appearance-model.ts, src-tauri/src/appearance.rs — Studio added and made the default for users without a saved choice.
  • preview/ — browser design preview with sample shop data (npx vite, then open /preview/index.html?theme=studio). Not shipped.
1.40.0
2026-09-28

Sharp printing and 80 mm receipts by default

No database schema change. Requires npm install once (new dependency: pdfjs-dist, used to render PDFs for printing).

Problems this fixes

  1. Print from the app came out blurry. The Print button called print() on the iframe that shows the PDF, so WebView2 printed the on-screen viewer at screen resolution and at the printer's default paper size. Saving the PDF and printing it from a PDF reader was sharp.
  2. **Thermal printer button said "Action required — Select a Windows printer first"** whenever no printer had been chosen in Settings.
  3. Thermal receipts were not 80 mm. The Thermal printer button sent a plain text receipt through PowerShell Out-Printer, which uses the driver's default font and page size. Printing the Thermal Roll invoice through the dialog also used the printer's default paper.

What changed

  • Print (every PDF: invoices, receipts, challans, reports, labels) now renders the PDF with pdf.js at printer resolution and opens the print dialog with pages at their real size: A4 at 300 dpi, receipts at 203 dpi (the dot pitch of 58/80 mm thermal heads) in pure black and white. src/pdf-print.ts.
  • Thermal printer button prints the same Thermal Roll receipt shown in the preview (logo, IMEI lines, QR) as a 203 dpi black-and-white image, directly on the receipt printer with no dialog, on a custom 80 mm (or 58 mm) paper size that matches the receipt length. src/receipt-print.ts, src-tauri/src/receipt_printer.rs, command print_receipt_image.
  • No printer chosen? NextPOS no longer refuses. It uses an installed printer whose name looks like a receipt printer (POS-80, XP-80C, TM-T82, Rongta, …), otherwise the Windows default printer (never "Print to PDF"/XPS/OneNote/Fax). The success message says which printer was used and suggests choosing it in Settings. Settings shows "Automatic — <printer>" in the printer list.
  • 80 mm by default. New installs default the printer format to 80 mm, and the thermal receipt always follows the receipt printer's paper width (80 mm unless set to 58 mm).
  • Print receipt automatically after checkout now prints the same 80 mm receipt from the app; the old text receipt in the checkout command was removed. If printing fails the sale is kept and a notice explains why.
  • Test print prints an 80/58 mm slip with left/right edge markers so the paper width can be checked.

Tests

  • Rust: printer selection (configured → detected receipt printer → Windows default, never a virtual printer), receipt size limits.
  • Rendered in Chromium: thermal receipt image is 639 × 1363 dots (80 mm at 203 dpi) with only black and white pixels; print document for Thermal Roll is one 80 × 170.6 mm page, Classic is one 210 × 297 mm page.
1.39.0
2026-09-28

New sale screen rebuilt for every screen size

No database schema change and no new backend commands. Checkout logic, IMEI verification, held sales, payment allocation and invoice review are unchanged; only the New sale layout and a few helpers around it changed.

The problem this fixes

On a 15.5" 1920×1080 laptop at Windows 125% scaling (1536 × 864 usable), the Customer and Warranty panels sat on top of Find item and Sale items, whatever Appearance was selected. The sale screen was styled by seven stacked stylesheets (checkout-phase45, checkout-production, checkout-refresh, mobile-checkout, phase76, phase78, checkout-redesign). The older ones still placed cards into named grid areas (imei, client, items, warranty) that no longer matched the markup, so cards shared cells. Breakpoints also measured the whole screen and ignored the sidebar.

What operators see

  • Two zones. Left: progress, Find or add item, device inspection, Sale items, then Customer and Warranty side by side. Right: a pinned payment panel with the total, payment method, account amounts, Received / Balance due, and Review invoice always at its foot.
  • Progress shows values, not just numbers: "1 item", the customer name, "As-is · No warranty", and "Fully paid" or "৳2,000.00 due". Completed steps show a check mark; an open balance shows in amber.
  • Warranty is a three-way choice. The invoice clause shows two lines with an Edit button that opens the full text box.
  • Device inspection uses a compact 4-column fact grid (2 columns when space is tight).
  • Keyboard: F2 scan (existing), and new on the sale screen: F4 Review invoice, F6 Hold sale, F8 Held sales.
  • Hold sale / Held sales / Clear sale sit in one row under Review invoice.

How it adapts

Layout is driven by container queries on the workspace (after the sidebar), not by the screen width:

Workspace widthLayout
over 1120 pxform + 368 px payment panel
900–1120 pxform + 330 px payment panel
under 900 pxsingle column; payment moves under the form and a compact total bar with Review invoice stays at the bottom

Inside the form: Customer and Warranty stack below 780 px; cart lines and warranty choices go compact below 560 px. On short screens (under 760 px high) the total header tightens and the shortcut hints hide.

Checked with no overlapping panels and no sideways scroll at 1920×1080, 1536×864 (1920 @125%), 1366×768, 1280×720 (1920 @150%) and 1100×700, in the Classic, Counter, Showroom and Ledger themes.

Files

  • src/sale-layout.css (new) — the only stylesheet that lays out the sale screen. Imported last; every rule is scoped under .sale-v2 and resets the legacy grid placement.
  • src/main.ts — new sale screen markup (same element IDs and data attributes), step values, clause editor toggle, compact pay bar, F4/F6/F8.
  • src/appearance-themes.css — regenerated.
1.38.0
2026-09-27

Redesigned Overview dashboard

No database schema change and no new backend commands. The dashboard reads the same get_dashboard_summary, get_report_summary and get_analytics_report data as 1.37.

What operators see

  • Overview is rebuilt around what a counter needs first:
  • Scan bar in the page header. The IMEI / serial scanner moved from a large block into the header. Ctrl+K focuses it from anywhere on the Overview. Results (device inspection, partial-IMEI matches, sold-unit lookup) appear directly under the greeting.
  • One KPI strip: revenue today with sale count and average ticket, gross profit today with margin, month to date (managers and admins), and stock health with low-stock and damaged-device tags.
  • Needs attention today: low stock, supplier payable, open warranty claims, customer dues and damaged devices, each with a severity mark and a one-click action (Reorder, Pay, Review, Collect, Resolve). Actions only show when the operator's role can open that page. When nothing is outstanding the card says so.
  • Start a task: compact shortcuts (New sale F2, Customer display, Display slideshow, Receive stock, Customer accounts, Cash management, Close the day, Suppliers, Reports), filtered by role and enabled modules.
  • Business performance (managers and admins): top products, payment channels (Cash, Mobile banking, Bank, Card), working capital with net profit, and capital by stock age with the two oldest buckets highlighted.
  • The separate "Management overview" block is gone; its figures now live in the KPI strip, attention list and working-capital card.
  • Sidebar: line icons replace the text symbols, the store name shows under the logo, and Lock / Sign out have icons. Groups still collapse and remember their state.
  • Header: the New sale button shows its F2 shortcut.
  • Works in all four appearances (Classic, Counter, Ledger, Showroom) and all three densities; the layout reflows down to the 1100 px minimum window width.

Cashier view

Cashiers see revenue and gross profit today, stock health, attention items that apply to them (low stock, warranty, customer dues, damaged devices) and their shortcuts. Month-to-date figures, supplier payable and business performance stay with managers and admins, as before.

Files

  • src/main.ts — shell() takes an optional header tool; renderDashboard() rewritten; sidebar uses pageIcon().
  • src/nav-icons.ts — new stroke icon set for pages and dashboard actions.
  • src/dashboard.css — new ov-* styles, now imported after the phase and theme stylesheets so older rules cannot override it.
  • src/appearance-themes.css — regenerated (npm run themes).
  • tests/role-conditional-controls.test.ts — updated chart test, new test for the scanner and role-aware attention list.

Build notes

This installer was cross-compiled from Linux for x86_64-pc-windows-gnu (MinGW) and bundled with NSIS. Earlier releases were built on Windows with the MSVC toolchain. The installer ships WebView2Loader.dll beside nextpos.exe; no other runtime is needed. Build on Windows with npm run build:windows to get the usual MSVC build from this same source.

Checks: tsc, vite build, 152 frontend tests, HTML escape audit and appearance-themes --check all pass.

1.37.0
2026-09-26

Invoice designs

No database schema change. Invoice settings live in the business profile JSON; profiles saved by 1.36.x load unchanged and switch to Classic Ledger.

What operators see

  • Sales → View now opens an invoice studio: six template buttons, a live PDF preview, and Download PDF, Print, Full preview and Thermal printer. Print uses the same PDF as the download, so the printout always matches.
  • The template a cashier picks stays selected for the rest of their session. Administrators also see Make this the shop default.
  • Settings → Business profile → Invoice design: default template, accent colour (five presets or any custom colour), and switches for the verification QR code, store logo, signature lines and amount in words.
TemplatePaperBest for
Classic Ledger (default)A4Formal invoices, corporate buyers, VAT / BIN
Sidebar StudioA4Premium look with a coloured side column
Ink SaverA4Black lines only; photocopies and low-ink printers
Bold BannerA4Phone sales; total card with PAID / PARTIAL / DUE stamp and IMEI chips
Invoice + Warranty CardA4Compact invoice plus a cut-off warranty card per serialized device
Thermal Roll80 / 58 mmCounter receipts; width follows Printer format, length fits the content

Every template carries the same data: store and customer details, items with IMEI 1 / IMEI 2 / serial / RAM-ROM-colour, item and invoice discount, VAT, split payments with references, paid / due, warranty with the end date read from the terms (for example "12 months"), a verification code and QR, and the amount in words using lakh and crore. A4 templates paginate long invoices with "Page x of y"; EMI sales attach the agreement and schedule pages in the template's colours, and the thermal receipt prints the schedule on the roll. Returned sales carry a RETURNED mark.

Removed

  • The Professional / Modern / Ultra-Modern PDF builders and the HTML invoice sheet with its inline print stylesheet (invoiceHtml, invoice-emi.css, the .invoice-sheet rules in documents.css and the theme rules in phase75.css).

For developers

  • src/invoice-templates/: catalog.ts (names, colours, defaults; no PDF code, safe to import at startup), kit.ts (shared drawing, formatting, pagination), one file per template, and emi.ts. src/invoice-pdf.ts stays the lazy entry.
  • PDFs use jsPDF built-in fonts and a vector QR, compressed.
  • Rust: BusinessProfile gains invoice_accent and four invoice_show_* flags with defaults; invoice_theme accepts the six template names; legacy values are normalised on load. save_business_profile validates the colour.
  • Tests: tests/invoice-templates.test.ts replaces invoice-themes.test.ts; Rust invoice_design_tests cover the migration.
1.36.0
2026-09-25

Personal appearance

Schema version: 13600 (per_user_appearance). Stores on 1.35.x upgrade in place, adding one column (users.appearance).

What operators see

  • The header's Appearance button opens a picker with four themes and three densities. Changes preview instantly; Save appearance stores the choice on the signed-in account, so it follows that person to any PC.
ThemeLook
------
ClassicThe previous NextPOS look, unchanged
CounterWarm neutrals and green, calm for the cash counter
LedgerDark, cool neutrals and blue, for long sessions
ShowroomWarm and bright with orange, suited to touch screens
DensityEffect
------
CompactWhole interface at 90%
Comfortable100%
Touch112%, and every control at least 44 px
  • Picking a theme suggests its matching density (Ledger → Compact, Showroom → Touch) until the user changes density themselves.
  • Administrators get Set role default in the same picker. Cashiers could, for example, start on Showroom · Touch. A user's own choice beats the role default, and Use my role default removes it. Role-default changes are written to the audit trail.
  • The sign-in screen opens in the last appearance used on that PC. The old Arctic Blue / Warm Pearl setting carries over as Classic / Counter.
  • These never change: printed documents, PDFs, the in-app invoice preview, and the customer display and online storefront windows.
  • Fonts are bundled inside the app: Figtree, Bricolage Grotesque, IBM Plex Sans and Mono, Hind Siliguri with Bengali, and Outfit. Nothing is downloaded at runtime, and the CSP is unchanged.

How it works

  • scripts/appearance-themes.mjs --migrate (run once) wrapped 1,571 colour and font literals across the 69 operator stylesheets in theme variables. The original value stays as the fallback, so Classic renders exactly as before. Each variable is named by role and colour, for example --k-fg-617188.
  • npm run themes derives each theme's value for all 1,031 variables in OKLCH:
  • Light themes: re-tint neutrals and move Classic's blue brand family to the theme's brand hue.
  • Ledger: remaps lightness by role, so surfaces go dark, text goes light, borders stay subtle and solid buttons keep white labels readable.
  • The result is src/appearance-themes.css, which applies to screens only (@media screen).
  • Variables read in a different role from the one they were defined for (for example color: var(--theme-action)) get role variants in the dark theme.
  • The paper preview resets every theme variable inside .invoice-sheet.
  • Density uses Tauri's webview.setZoom. The main window's capability gains core:webview:allow-set-webview-zoom.
  • Backend (src-tauri/src/appearance.rs):
  • Commands: get_appearance, save_my_appearance (any signed-in user) and save_role_appearance (admin only).
  • Values are validated against fixed lists, and corrupt stored values fall back to the default.
  • A fix in Classic as well: the sidebar New sale label was pale gold on a white sidebar. It now uses the theme's action colour.

Tests

Suite1.35.01.36.0
Frontend134142
Rust6569

New tests cover:

  • WCAG contrast for body text, secondary text, sidebar labels, the active nav item and primary buttons in every theme;
  • card and page separation in Ledger;
  • picker swatches matching the generated colours;
  • paper and print protection;
  • a stale-theme / raw-colour guard;
  • normalisation and migration of saved choices;
  • backend precedence (user over role over default), validation, clearing and auditing.

Every theme was checked visually in a browser with a simulated backend: Dashboard, New sale, sign-in, the picker and an invoice preview, including Showroom at Touch density.

Upgrade notes

  • The first launch applies the schema change. As before, it is preceded by the automatic pre-upgrade backup.
  • Every user starts on Classic · Comfortable until they, or an administrator's role default, choose otherwise.
  • After adding or changing colours in any CSS file, run npm run themes. The tests fail until you do.

Next (step 2)

The shared 5-section menu from design A, Ctrl+K quick search for everyone, and the optional status bar ("power tools").

1.35.0
2026-09-25

Engineering hardening

Schema version: 13500 (atomic_schema_and_reconciliation). Existing 1.34.x stores upgrade in place on first launch; the pre-upgrade backup still runs first.

1. Schema work runs once, atomically

Before: almost every command (206 call sites) re-ran the full ~880-line create_schema: every CREATE … IF NOT EXISTS, 23 column probes, three data backfills and a user_version write. A plain read therefore took the SQLite write lock and cost ~17 ms on a store with 20,000 devices and 50,000 payments. Nothing ran in a transaction, so a crash mid-upgrade could leave a half-migrated database.

Now:

  • create_schema checks compatibility, then applies the schema **at most once per database per process** (SCHEMA_READY). The cache is only trusted while PRAGMA user_version equals the current version, and restore_backup clears it.
  • Schema work runs inside a single BEGIN IMMEDIATE transaction with foreign-key enforcement suspended, the same as the legacy table rebuilds already expected. During an upgrade the foreign-key violation count is compared before and after, and an upgrade that would add violations is rolled back. Foreign-key enforcement is always restored.
  • Three backfills turned out to be live business logic, not migrations. Stock locations are only ever assigned this way; complete_sale and due collection insert payments without an account; direct supplier receipts rely on the accrual backfill. They moved to reconcile_operational_records, which still runs on every call but only writes when a read-only, index-backed probe finds pending rows.
  • New partial indexes support those probes: idx_payments_unassigned_method, idx_units_in_store and idx_units_direct_supplier.

Measured (release build, same 20k-unit / 50k-payment database, per command, including opening the connection): 17.3 ms → 1.9 ms. Reads no longer need the write lock.

2. Posting transactions lock up front

All 33 production transactions in lib.rs and emi_trade.rs now use TransactionBehavior::Immediate. A posting command either gets the write lock at the start (waiting up to the 5-second busy timeout) or fails before doing any work. It can no longer fail with SQLITE_BUSY halfway through. complete_sale re-checks its operation key inside the write lock, so two concurrent retries of the same checkout return the same sale instead of a unique-constraint error.

3. HTML-safe rendering

  • New src/html.ts exports the single escapeHtml. main.ts and phase53.ts import it.
  • 432 record-field interpolations in HTML templates were wrapped with escapeHtml, including customer, supplier and product names, IMEI/serial numbers, notes and addresses. The content security policy already blocked scripts, so the risk was HTML injection: layout breakage and fake controls.
  • scripts/html-escape-audit.mjs (npm run audit:html) uses the TypeScript compiler to find unescaped data-contract fields in HTML templates. Plain-text sinks (alert, confirm, prompt, textContent) are excluded, and values already inside escapeHtml, esc or safe are skipped. It can re-apply fixes with --fix. tests/html-escaping.test.ts fails the build if a new unescaped field appears.
  • Scope note: the audit covers typed record fields. Locally computed strings (for example a scanned identifier held in a local variable) are still a code-review item.

4. Operator-facing copy

Removed 63 internal "PHASE nn ·" labels from screens, PDFs and backend messages. Headings keep their descriptive part, for example "SUBLEDGER ACCOUNTING". tests/ui-copy.test.ts prevents them from returning.

Tests

Suite1.34.31.35.0
Frontend (npm run test:frontend)129134
Rust (cargo test)6065

New Rust tests exercise the database directly:

  • a schema gate that succeeds while another connection holds the write lock (with the old behaviour it fails with "database is locked");
  • reconciliation after caching;
  • payment account linking;
  • in-place upgrade of a 1.34.3 store;
  • full rollback of a failed upgrade.

tsc, vite build and cargo clippy pass with no new warnings.

Upgrade notes

  • Run the usual release gate on Windows: npm run release:verify, then npm run release:windows.
  • On a copy of a real store database, check the first launch after the upgrade. It is the one launch that runs the full schema and foreign-key comparison.
  1. Store money as integer paisa instead of REAL/f64. This needs a data migration and a rehearsal on a copy of a real store database.
  2. Split lib.rs and main.ts by domain, starting with sales.
  3. Replace source-text tests with behavioural tests for returns, exchanges, purchasing and restore.
  4. Consolidate the 74 layered CSS files.
WhatsApp Free trial