Skip to content

fix(i18n): fix SYP currency display and add Syria - #1591

Merged
khaira777 merged 3 commits into
mainfrom
fix/flocafe-syp-currency-display
Nov 15, 2026
Merged

khaira777 merged 3 commits into
mainfrom
fix/flocafe-syp-currency-display

Conversation

@khaira777

@khaira777 khaira777 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Fixes #1584

Fix #1584 so selecting Syrian Pound (SYP) displays ل.س. (in Arabic locales) or SYP (in non-Arabic locales) consistently across FloCafe and printed receipts instead of the generic narrow pound sign (£), add Syria (SY) to the country selection list, and preserve standard narrow symbol display ($, £, €, E£, L£, etc.) for currencies like CAD, AUD, USD, and Sterling-pegged pound currencies (GBP, FKP, GIP, SHP).

What Changed

  • Added resolveIntlCurrencyDisplay in main/countries.ts (re-exported via frontend/src/lib/countries.ts) and used it across getCurrencySymbol, formatCurrency, formatMoney, regionalCurrencyPosition, and frontend/src/lib/printer/web-print.ts so non-sterling pound currencies (SYP, SSP) resolve to symbol or code instead of bare £, while preserving narrowSymbol for other currencies.
  • Added isAmbiguousCurrencySymbol and 'ل.س': 'SYP' in shared/print/currency.ts, and updated main/printers/formatting-helpers.ts, frontend/src/lib/printer/receipt-encoder.ts, and frontend/src/lib/printer/tax-bill-encoder.ts so ESC/POS receipt encoding falls back from bare £ (when not GBP) and ¥/\uFFE5 (when not JPY) to the ISO currency code.
  • Added the Syria (SY, SYP, ar-SY, Asia/Damascus) country profile in main/countries.ts, mapped SY to SYP in frontend/src/lib/cart-price.ts, exported deriveCurrencySymbol in main/routes/settings.ts, updated README.md, and added coverage across the currency, receipt, cart-price, and country test suites.

Risk Assessment

✅ Low: The changes cleanly scope Intl symbol fallback to non-sterling pound currencies, add the Syria country profile consistently across backend, frontend, cart pricing, and print fallback paths, and preserve narrow symbols for other currencies.

Testing

All 5 focused automated suites and all 4 live Chromium E2E scenarios across isolated FloCafe instances passed after building backend and desktop frontend artifacts, with 10 screenshots and thermal/currency transcript evidence saved and verified.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Select Syria (SY) in first-run Setup and Store Settings (including Arabic UI) and verify auto-selected SYP currency, Asia/Damascus timezone, +963 phone placeholder, and Syria country label ✅ pass live 01-setup-syria-country-selection.png, 02-settings-store-syria-syp.png, 05-settings-arabic-ui-syria.png, and thermal-and-currency-checks.txt (autoCurrency=SYP, autoTimezone=Asia/Damascus, currencySymbo…
Create and pay an order in an isolated Syria (SY) + SYP store across POS, Prepaid Checkout modal, Orders reprint flow, rendered Browser Receipt HTML, and ESC/POS thermal receipt previews without displ… ✅ pass live 03-pos-checkout-syria-syp.png, 03b-checkout-modal-syria-syp.png, 04-browser-receipt-syria-syp.png, and thermal-and-currency-checks.txt (Scenario 1 & 2 thermal ASCII and Unicode previews showing SYP15,…
Override currency to SYP under a non-Arabic locale (United States / US) and verify POS, Checkout modal, Browser Receipt HTML, and thermal receipt preview display SYP instead of £ or GBP ✅ pass live 06-pos-us-syp-non-arabic.png, 06b-checkout-modal-us-syp.png, 07-browser-receipt-us-syp.png, and thermal-and-currency-checks.txt (Scenario 3 currency_symbol=SYP and thermal ASCII SYP1,500)
Preserve narrow currency symbols ($, £, €, E£, L£) for UK/GBP, USD, CAD, AUD, FKP, GIP, SHP, EUR, EGP, and LBP while disambiguating non-Sterling SYP and SSP from £ ✅ pass live 08-browser-receipt-gbp-preserved.png and thermal-and-currency-checks.txt (GBP Browser Receipt £4.50 and Chromium Intl Currency Matrix)

Setup country search and selection for Syria (SYP, ar-SY, Asia/Damascus)
Store Settings persisted for Syria and SYP (+963 placeholder, Asia/Damascus)
POS menu and cart displaying SYP as ل.س. for Syria tenant
Prepaid Checkout modal displaying ل.س. across items, quick-tender pills, totals, and Confirm Payment button
Rendered Browser Receipt HTML for Syria + SYP displaying ل.س. with no £
Store Settings switched to Arabic RTL UI showing سوريا for country SY
POS menu and cart for non-Arabic US tenant using SYP displaying SYP 1,500 with no £
Prepaid Checkout modal for non-Arabic US + SYP displaying SYP across items, quick-tender, totals, and button
Rendered Browser Receipt HTML for US + SYP displaying SYP 1,500 with no £
Rendered Browser Receipt HTML for UK + GBP preserving narrow £4.50 display

Evidence: Thermal receipt previews (ASCII & Unicode) and Chromium Intl currency matrix transcript
=== Scenario 1 & 2: SY + SYP ===

Setup autoCurrency=SYP, autoTimezone=Asia/Damascus, currencySymbol=ل.س.

Arabic UI SY option: سوريا

--- Thermal ASCII (useUnicode: false) ---
Cafe Damascus
------------------------------------------
#ORD-20261115-0001
Invoice #: INV-20261115-0001
------------------------------------------
Item                        Qty     Amount
------------------------------------------
Damascus Arabic Coffee      1    SYP15,000
------------------------------------------
Subtotal                         SYP15,000
TOTAL                            SYP15,000
Cash                             SYP15,000


Powered by FloPOS (flopos.com)

--- Thermal Unicode (useUnicode: true) ---
Cafe Damascus
------------------------------------------
#ORD-20261115-0001
Invoice #: INV-20261115-0001
------------------------------------------
Item                        Qty     Amount
------------------------------------------
Damascus Arabic Coffee      1    SYP15,000
------------------------------------------
Subtotal                         SYP15,000
TOTAL                            SYP15,000
Cash                             SYP15,000


Powered by FloPOS (flopos.com)


=== Scenario 3: US + SYP (non-Arabic) ===

currency_symbol=SYP

--- Thermal ASCII (useUnicode: false) ---
Damascus Roasters US
------------------------------------------
#ORD-20261115-0001
Invoice #: INV-20261115-0001
11/15/2026 2:31:11 PM
------------------------------------------
Item                        Qty     Amount
------------------------------------------
Damascus Blend              1     SYP1,500
------------------------------------------
Subtotal                          SYP1,500
TOTAL                             SYP1,500
Cash                              SYP1,500


Powered by FloPOS (flopos.com)


=== Scenario 4: Preservation (GB + GBP) & Currency Matrix ===

GBP currency_symbol=£

--- GBP Browser Receipt ---
London Tea House
#ORD-20261115-0001
Bill # INV-20261115-0001	Date Nov 15, 2026, 07:31 PM
Item
Qty
Rate
Amount
Earl Grey
1
£4.50
£4.50
Subtotal	£4.50
Grand Total	£4.50
Payments
Cash	£4.50

Thank you for your visit!

Powered by FloPOS (flopos.com)

Print Bill

--- Chromium Intl Currency Matrix ---
{
  "USD": "$10.00",
  "CAD": "$10.00",
  "AUD": "$10.00",
  "GBP": "£10.00",
  "FKP": "£10.00",
  "GIP": "£10.00",
  "SHP": "£10.00",
  "EUR": "10,00 €",
  "EGP": "E£10.00",
  "LBP": "L£10",
  "SSP_en": "SSP 10.00",
  "SSP_ar": "‏١٠٫٠٠ SSP",
  "SYP_en": "SYP 10",
  "SYP_ar": "‏١٠ ل.س.‏"
}

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed ✅
  • ⚠️ main/countries.ts:245 - main/countries.ts:245 adds SY (SYP, which has 0 fraction digits in Intl.NumberFormat), but the sibling country-to-currency map NON_TWO_DECIMAL_COUNTRY_CURRENCIES in frontend/src/lib/cart-price.ts:11-40 (which lists every other non-2-decimal country such as IQ, JO, LB, YE) does not include SY: 'SYP'. When currencyFractionDigits('SY'), resolveActiveCurrencyDecimals('SY'), or decimalsFromTenantRecord({ country: 'SY' }) is called without an explicit currency / currency_fraction_digits, frontend/src/lib/cart-price.ts:46-49 falls through with 2-letter 'SY' and returns 2 decimal places instead of 0. Add SY: 'SYP' to NON_TWO_DECIMAL_COUNTRY_CURRENCIES.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Select Syria (SY) in first-run Setup and Store Settings (including Arabic UI) and verify auto-selected SYP currency, Asia/Damascus timezone, +963 phone placeholder, and Syria country label ✅ pass live 01-setup-syria-country-selection.png, 02-settings-store-syria-syp.png, 05-settings-arabic-ui-syria.png, and thermal-and-currency-checks.txt (autoCurrency=SYP, autoTimezone=Asia/Damascus, currencySymbo…
Create and pay an order in an isolated Syria (SY) + SYP store across POS, Prepaid Checkout modal, Orders reprint flow, rendered Browser Receipt HTML, and ESC/POS thermal receipt previews without displ… ✅ pass live 03-pos-checkout-syria-syp.png, 03b-checkout-modal-syria-syp.png, 04-browser-receipt-syria-syp.png, and thermal-and-currency-checks.txt (Scenario 1 & 2 thermal ASCII and Unicode previews showing SYP15,…
Override currency to SYP under a non-Arabic locale (United States / US) and verify POS, Checkout modal, Browser Receipt HTML, and thermal receipt preview display SYP instead of £ or GBP ✅ pass live 06-pos-us-syp-non-arabic.png, 06b-checkout-modal-us-syp.png, 07-browser-receipt-us-syp.png, and thermal-and-currency-checks.txt (Scenario 3 currency_symbol=SYP and thermal ASCII SYP1,500)
Preserve narrow currency symbols ($, £, €, E£, L£) for UK/GBP, USD, CAD, AUD, FKP, GIP, SHP, EUR, EGP, and LBP while disambiguating non-Sterling SYP and SSP from £ ✅ pass live 08-browser-receipt-gbp-preserved.png and thermal-and-currency-checks.txt (GBP Browser Receipt £4.50 and Chromium Intl Currency Matrix)
  • npm run build && npm run build:frontend (exit 0)
  • npm run test:currency (exit 0: currency.test.ts 18/18, country-profile.test.ts 2/2, locale-iran.test.ts 30/30, regional-snapshot, split-checks, minor-units, reset, currency-print-fallback 17 counted / 0 failed)
  • npm run test:country-localization (exit 0)
  • npm run test:browser-receipts (exit 0)
  • npm run test:issue-266-currency-symbol-print (exit 0: 24/24 passed)
  • npm run test:cart-price-override (exit 0)
  • Live Chromium Playwright + isolated FloCafe server validation suite (task-275, exit 0, ALL LIVE SCENARIOS PASSED)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4fbf2c2 and 4e528ca.

Files selected for processing: 18

  • README.md
  • frontend/src/lib/cart-price.ts
  • frontend/src/lib/countries.ts
  • frontend/src/lib/printer/receipt-encoder.ts
  • frontend/src/lib/printer/tax-bill-encoder.ts
  • frontend/src/lib/printer/unicode.ts
  • frontend/src/lib/printer/web-print.ts
  • main/countries.ts
  • main/printers/formatting-helpers.ts
  • main/routes/settings.ts
  • shared/print/currency.ts
  • tests/browser-receipts.test.ts
  • tests/cart-price-override.test.ts
  • tests/country-localization.test.ts
  • tests/country-profile.test.ts
  • tests/currency-print-fallback.test.ts
  • tests/currency.test.ts
  • tests/issue-266-currency-symbol-print.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@khaira777 khaira777 changed the title fix: add Syria profile and fix SYP currency display fix(i18n): fix SYP currency display and add Syria Nov 15, 2026
@khaira777

Copy link
Copy Markdown
Contributor Author

@greptile review

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Adds Syria to country selection and fixes Syrian pound display across the app and receipts.

  • SYP and SSP show a clear currency mark instead of a bare pound sign.
  • Thermal receipts use the currency code when a symbol could mean more than one currency.
  • Syria is selectable with SYP, Arabic locale, and Damascus time.
  • Formatting and a test export change leave runtime behavior unchanged.

No actionable issues found.

Reviews (1) · Last reviewed commit: "no-mistakes(document): Update Syria coun..." · Reviewed by Greptile

@khaira777
khaira777 merged commit b50b674 into main Nov 15, 2026
24 checks passed
@khaira777
khaira777 deleted the fix/flocafe-syp-currency-display branch November 15, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Selecting SYP does not update currency display across FloCafe

1 participant