From 2050a127bcb44265b31a08b7a8db21cf3291d499 Mon Sep 17 00:00:00 2001 From: AarDG10 Date: Fri, 30 Jan 2026 09:19:47 +0530 Subject: [PATCH] fix(data): fix currency in words for Algerian compliance Co-authored-by: half-ware --- frappe/geo/country_info.json | 2 +- frappe/utils/data.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frappe/geo/country_info.json b/frappe/geo/country_info.json index 7a1a4fa3b2..3ea2815d74 100644 --- a/frappe/geo/country_info.json +++ b/frappe/geo/country_info.json @@ -27,7 +27,7 @@ "Algeria": { "code": "dz", "currency": "DZD", - "currency_fraction": "Santeem", + "currency_fraction": "Centime", "currency_fraction_units": 100, "currency_name": "Algerian Dinar", "currency_symbol": "\u062f.\u062c", diff --git a/frappe/utils/data.py b/frappe/utils/data.py index ff141ba048..981137c3e9 100644 --- a/frappe/utils/data.py +++ b/frappe/utils/data.py @@ -1558,10 +1558,16 @@ def money_in_words( elif main == "0": out = f"{fraction_in_words()} {fraction_currency}" else: - out = _(main_currency, context="Currency") + " " + in_words(main, in_million).title() + if main_currency == "DZD": + # Use Dinars for Algerian Compliance + out = in_words(main, in_million).title() + " " + _("Dinars", context="Currency") + else: + out = _(main_currency, context="Currency") + " " + in_words(main, in_million).title() if cint(fraction): out = out + " " + _("and") + " " + fraction_in_words() + " " + fraction_currency + if main_currency == "DZD": + return _("{0}.", context="Money in words").format(out) return _("{0} only.", context="Money in words").format(out)