From e377eac407be756b643105b282270e25e0b27253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Mon, 20 Mar 2023 23:45:17 +0800 Subject: [PATCH] Fixed the capitalization of the currencies, base accounts, and accounts. --- src/accounting/models.py | 6 +++--- src/accounting/templates/accounting/account/detail.html | 2 +- .../templates/accounting/base-account/detail.html | 2 +- src/accounting/templates/accounting/currency/detail.html | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/accounting/models.py b/src/accounting/models.py index d4cc0b9..e965f33 100644 --- a/src/accounting/models.py +++ b/src/accounting/models.py @@ -53,7 +53,7 @@ class BaseAccount(db.Model): :return: The string representation of the base account. """ - return f"{self.code} {self.title}" + return f"{self.code} {self.title.title()}" @property def title(self) -> str: @@ -155,7 +155,7 @@ class Account(db.Model): :return: The string representation of this account. """ - return f"{self.base_code}-{self.no:03d} {self.title}" + return f"{self.base_code}-{self.no:03d} {self.title.title()}" @property def code(self) -> str: @@ -373,7 +373,7 @@ class Currency(db.Model): :return: The string representation of the currency. """ - return f"{self.name} ({self.code})" + return f"{self.name.title()} ({self.code})" @property def name(self) -> str: diff --git a/src/accounting/templates/accounting/account/detail.html b/src/accounting/templates/accounting/account/detail.html index ec7057d..44ae963 100644 --- a/src/accounting/templates/accounting/account/detail.html +++ b/src/accounting/templates/accounting/account/detail.html @@ -83,7 +83,7 @@ First written: 2023/1/31 {% endif %}
-
{{ obj.title }}
+
{{ obj.title|title }}
{{ obj.code }}
{% if obj.is_need_offset %}
diff --git a/src/accounting/templates/accounting/base-account/detail.html b/src/accounting/templates/accounting/base-account/detail.html index 5e15a1a..d2d66b5 100644 --- a/src/accounting/templates/accounting/base-account/detail.html +++ b/src/accounting/templates/accounting/base-account/detail.html @@ -33,7 +33,7 @@ First written: 2023/2/1
-
{{ obj.title }}
+
{{ obj.title|title }}
{{ obj.code }}
{% if obj.accounts %}
diff --git a/src/accounting/templates/accounting/currency/detail.html b/src/accounting/templates/accounting/currency/detail.html index 5b97b4f..3817562 100644 --- a/src/accounting/templates/accounting/currency/detail.html +++ b/src/accounting/templates/accounting/currency/detail.html @@ -79,7 +79,7 @@ First written: 2023/2/6 {% endif %}
-
{{ obj.name }}
+
{{ obj.name|title }}
{{ obj.code }}
{{ A_("Created") }} {{ obj.created_at }} {{ obj.created_by }}