Repository navigation
Description
Parent epic
Part of #264 (Morocco / MAD currency support).
Bug
Changing an existing store's country/currency in Settings persists country and currency, but does not update the derived currency_symbol. The Electron thermal-print path reads the stored symbol, so receipts can continue printing a stale symbol such as ₹ after the store is changed to MAD. Frontend/browser printing derives from the current tenant currency, creating inconsistent output between print paths.
Relevant current paths:
main/routes/settings.ts- Settings business update persists country/currency but notcurrency_symbol.main/routes/printers.ts- Electron print request uses persistedcurrency_symbol.main/printers/thermal.ts- thermal formatting uses that prefix.- Frontend printer paths derive from tenant currency/country.
Reproduction outline
- Start with an existing store configured as INR / India.
- Change the store country/currency in Settings to Morocco / MAD and save.
- Print or preview the same bill through the Electron thermal path and the frontend/browser path.
- Observe that the Electron path can retain the old INR symbol while the frontend path uses the new currency.
Expected behavior
All print paths use one coherent current currency profile after a Settings change, including after reload, logout/login, app restart, reprint, and offline operation.
Acceptance criteria
- Add a regression test covering an existing-store country/currency change and Electron print preparation.
- Electron thermal previews/receipts no longer use a stale
currency_symbol. - Frontend/browser and Electron print paths agree on the approved MAD representation.
- Existing INR/ARS and ASCII/non-Unicode thermal fallback behavior remains unchanged.
- A failed Settings save does not update the in-memory tenant or print profile.
- No currency conversion or database schema migration is introduced.
Suggested fix direction
Prefer deriving the print prefix from the authoritative current currency + country profile at print time, or otherwise synchronize currency_symbol atomically whenever business settings change. Avoid leaving two independently mutable currency sources.
PR workflow
Implement in a focused bug-fix PR and use Fixes #<this issue number> plus Part of #264 in the PR description. This can be developed independently of the country-registry feature, but should be validated together before closing the parent epic.
Activity
fix(printers): derive receipt currency symbols (#266)
itsbkm commentedon Aug 14, 2026
Fixed in 8e80e80 on main.\n\nWhat changed:\n- Settings business/tax saves now derive and persist currency_symbol when country/currency changes, without adding a schema migration or currency conversion.\n- Electron print-bill preparation now derives the receipt currency prefix from current currency + country locale, so stale stored symbols do not leak into thermal previews/receipts.\n- Added a regression test for MAD after a stale INR symbol, plus the existing INR ASCII fallback.\n\nVerification:\n- npm run test:issue-266-currency-symbol-print\n- npm run test:e2e-argentina-flow\n- npm run test:currency\n- npm run lint (passes; existing backend warning backlog remains)\n- npm run build\n- git diff --check\n\nPart of #264.