From 6e2e92d0fb940f0204af8e62e9ed0cdd632e6186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 18 Apr 2023 08:46:23 +0800 Subject: [PATCH] Removed the redundant currency from the title of the reports when the currency is the default currency. --- .../templates/accounting/report/balance-sheet.html | 10 ++++++++-- .../templates/accounting/report/income-expenses.html | 2 +- .../templates/accounting/report/income-statement.html | 10 ++++++++-- src/accounting/templates/accounting/report/ledger.html | 2 +- .../templates/accounting/report/trial-balance.html | 10 ++++++++-- .../accounting/report/unapplied-accounts.html | 10 ++++++++-- .../templates/accounting/report/unapplied.html | 2 +- .../accounting/report/unmatched-accounts.html | 10 ++++++++-- .../templates/accounting/report/unmatched.html | 2 +- 9 files changed, 44 insertions(+), 14 deletions(-) diff --git a/src/accounting/templates/accounting/report/balance-sheet.html b/src/accounting/templates/accounting/report/balance-sheet.html index fcf5910..9491b60 100644 --- a/src/accounting/templates/accounting/report/balance-sheet.html +++ b/src/accounting/templates/accounting/report/balance-sheet.html @@ -26,7 +26,7 @@ First written: 2023/3/7 {% endblock %} -{% block header %}{% block title %}{{ A_("Balance Sheet of %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }}{% endblock %}{% endblock %} +{% block header %}{% block title %}{% if report.currency.code == accounting_default_currency_code() %}{{ A_("Balance Sheet %(period)s", period=report.period.desc|title) }}{% else %}{{ A_("Balance Sheet of %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }}{% endif %}{% endblock %}{% endblock %} {% block content %} @@ -46,7 +46,13 @@ First written: 2023/3/7 {% if report.has_data %}
-

{{ A_("Balance Sheet of %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }}

+

+ {% if report.currency.code == accounting_default_currency_code() %} + {{ A_("Balance Sheet %(period)s", period=report.period.desc|title) }} + {% else %} + {{ A_("Balance Sheet of %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }} + {% endif %} +

diff --git a/src/accounting/templates/accounting/report/income-expenses.html b/src/accounting/templates/accounting/report/income-expenses.html index eb45eef..8fbc2f7 100644 --- a/src/accounting/templates/accounting/report/income-expenses.html +++ b/src/accounting/templates/accounting/report/income-expenses.html @@ -26,7 +26,7 @@ First written: 2023/3/5 {% endblock %} -{% block header %}{% block title %}{{ A_("Income and Expenses Log of %(account)s in %(currency)s %(period)s", currency=report.currency.name|title, account=report.account.title|title, period=report.period.desc|title) }}{% endblock %}{% endblock %} +{% block header %}{% block title %}{% if report.currency.code == accounting_default_currency_code() %}{{ A_("Income and Expenses Log of %(account)s %(period)s", account=report.account.title|title, period=report.period.desc|title) }}{% else %}{{ A_("Income and Expenses Log of %(account)s in %(currency)s %(period)s", currency=report.currency.name|title, account=report.account.title|title, period=report.period.desc|title) }}{% endif %}{% endblock %}{% endblock %} {% block content %} diff --git a/src/accounting/templates/accounting/report/income-statement.html b/src/accounting/templates/accounting/report/income-statement.html index 5ce53f3..bca11d6 100644 --- a/src/accounting/templates/accounting/report/income-statement.html +++ b/src/accounting/templates/accounting/report/income-statement.html @@ -26,7 +26,7 @@ First written: 2023/3/7 {% endblock %} -{% block header %}{% block title %}{{ A_("Income Statement of %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }}{% endblock %}{% endblock %} +{% block header %}{% block title %}{% if report.currency.code == accounting_default_currency_code() %}{{ A_("Income Statement %(period)s", period=report.period.desc|title) }}{% else %}{{ A_("Income Statement of %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }}{% endif %}{% endblock %}{% endblock %} {% block content %} @@ -46,7 +46,13 @@ First written: 2023/3/7 {% if report.has_data %}
-

{{ A_("Income Statement of %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }}

+

+ {% if report.currency.code == accounting_default_currency_code() %} + {{ A_("Income Statement %(period)s", period=report.period.desc|title) }} + {% else %} + {{ A_("Income Statement of %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }} + {% endif %} +

diff --git a/src/accounting/templates/accounting/report/ledger.html b/src/accounting/templates/accounting/report/ledger.html index b709b98..4935fe5 100644 --- a/src/accounting/templates/accounting/report/ledger.html +++ b/src/accounting/templates/accounting/report/ledger.html @@ -26,7 +26,7 @@ First written: 2023/3/5 {% endblock %} -{% block header %}{% block title %}{{ A_("Ledger of %(account)s in %(currency)s %(period)s", currency=report.currency.name|title, account=report.account.title|title, period=report.period.desc|title) }}{% endblock %}{% endblock %} +{% block header %}{% block title %}{% if report.currency.code == accounting_default_currency_code() %}{{ A_("Ledger of %(account)s %(period)s", account=report.account.title|title, period=report.period.desc|title) }}{% else %}{{ A_("Ledger of %(account)s in %(currency)s %(period)s", currency=report.currency.name|title, account=report.account.title|title, period=report.period.desc|title) }}{% endif %}{% endblock %}{% endblock %} {% block content %} diff --git a/src/accounting/templates/accounting/report/trial-balance.html b/src/accounting/templates/accounting/report/trial-balance.html index 5d22dc5..b83930a 100644 --- a/src/accounting/templates/accounting/report/trial-balance.html +++ b/src/accounting/templates/accounting/report/trial-balance.html @@ -26,7 +26,7 @@ First written: 2023/3/5 {% endblock %} -{% block header %}{% block title %}{{ A_("Trial Balance of %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }}{% endblock %}{% endblock %} +{% block header %}{% block title %}{% if report.currency.code == accounting_default_currency_code() %}{{ A_("Trial Balance %(period)s", period=report.period.desc|title) }}{% else %}{{ A_("Trial Balance of %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }}{% endif %}{% endblock %}{% endblock %} {% block content %} @@ -46,7 +46,13 @@ First written: 2023/3/5 {% if report.has_data %}
-

{{ A_("Trial Balance of %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }}

+

+ {% if report.currency.code == accounting_default_currency_code() %} + {{ A_("Trial Balance %(period)s", period=report.period.desc|title) }} + {% else %} + {{ A_("Trial Balance of %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }} + {% endif %} +

diff --git a/src/accounting/templates/accounting/report/unapplied-accounts.html b/src/accounting/templates/accounting/report/unapplied-accounts.html index 60d6afe..2a8193a 100644 --- a/src/accounting/templates/accounting/report/unapplied-accounts.html +++ b/src/accounting/templates/accounting/report/unapplied-accounts.html @@ -26,7 +26,7 @@ First written: 2023/4/8 {% endblock %} -{% block header %}{% block title %}{{ A_("Accounts with Unapplied Items in %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }}{% endblock %}{% endblock %} +{% block header %}{% block title %}{% if report.currency.code == accounting_default_currency_code() %}{{ A_("Accounts with Unapplied Items %(period)s", period=report.period.desc|title) }}{% else %}{{ A_("Accounts with Unapplied Items in %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }}{% endif %}{% endblock %}{% endblock %} {% block content %} @@ -47,7 +47,13 @@ First written: 2023/4/8 {% if report.has_data %}
-

{{ A_("Accounts with Unapplied Items in %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }}

+

+ {% if report.currency.code == accounting_default_currency_code() %} + {{ A_("Accounts with Unapplied Items %(period)s", period=report.period.desc|title) }} + {% else %} + {{ A_("Accounts with Unapplied Items in %(currency)s %(period)s", currency=report.currency.name|title, period=report.period.desc|title) }} + {% endif %} +