From b8b51b34d35b1b5b5b4bf43610635894f857c900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Wed, 8 Mar 2023 07:30:28 +0800 Subject: [PATCH] Added the income-expenses-row-desktop.html and ledger-row-desktop.html templates to simplify templates of the income and expenses log and ledger. --- .../include/income-expenses-row-desktop.html | 27 +++++++++++++++++++ .../report/include/ledger-row-desktop.html | 26 ++++++++++++++++++ .../accounting/report/income-expenses.html | 14 ++-------- .../templates/accounting/report/ledger.html | 12 ++------- 4 files changed, 57 insertions(+), 22 deletions(-) create mode 100644 src/accounting/templates/accounting/report/include/income-expenses-row-desktop.html create mode 100644 src/accounting/templates/accounting/report/include/ledger-row-desktop.html diff --git a/src/accounting/templates/accounting/report/include/income-expenses-row-desktop.html b/src/accounting/templates/accounting/report/include/income-expenses-row-desktop.html new file mode 100644 index 0000000..d339f1c --- /dev/null +++ b/src/accounting/templates/accounting/report/include/income-expenses-row-desktop.html @@ -0,0 +1,27 @@ +{# +The Mia! Accounting Flask Project +income-expenses-row-desktop.html: The row in the income and expenses for the desktop computers + + Copyright (c) 2023 imacat. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +Author: imacat@mail.imacat.idv.tw (imacat) +First written: 2023/3/8 +#} +
{{ entry.date|accounting_format_date }}
+
{{ entry.account.title|title }}
+
{{ entry.summary|accounting_default }}
+
{{ entry.income|accounting_format_amount|accounting_default }}
+
{{ entry.expense|accounting_format_amount|accounting_default }}
+
{{ entry.balance|accounting_report_format_amount }}
diff --git a/src/accounting/templates/accounting/report/include/ledger-row-desktop.html b/src/accounting/templates/accounting/report/include/ledger-row-desktop.html new file mode 100644 index 0000000..b50a1cd --- /dev/null +++ b/src/accounting/templates/accounting/report/include/ledger-row-desktop.html @@ -0,0 +1,26 @@ +{# +The Mia! Accounting Flask Project +ledger-row-desktop.html: The row in the ledger for the desktop computers + + Copyright (c) 2023 imacat. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +Author: imacat@mail.imacat.idv.tw (imacat) +First written: 2023/3/8 +#} +
{{ entry.date|accounting_format_date }}
+
{{ entry.summary|accounting_default }}
+
{{ entry.debit|accounting_format_amount|accounting_default }}
+
{{ entry.credit|accounting_format_amount|accounting_default }}
+
{{ entry.balance|accounting_report_format_amount }}
diff --git a/src/accounting/templates/accounting/report/income-expenses.html b/src/accounting/templates/accounting/report/income-expenses.html index 7bebab9..95528ca 100644 --- a/src/accounting/templates/accounting/report/income-expenses.html +++ b/src/accounting/templates/accounting/report/income-expenses.html @@ -168,23 +168,13 @@ First written: 2023/3/5 {% if report.brought_forward %} {% with entry = report.brought_forward %}
-
{{ entry.date|accounting_format_date }}
-
{{ entry.account.title|title }}
-
{{ entry.summary|accounting_default }}
-
{{ entry.income|accounting_format_amount|accounting_default }}
-
{{ entry.expense|accounting_format_amount|accounting_default }}
-
{{ entry.balance|accounting_report_format_amount }}
+ {% include "accounting/report/include/income-expenses-row-desktop.html" %}
{% endwith %} {% endif %} {% for entry in report.entries %} -
{{ entry.date|accounting_format_date }}
-
{{ entry.account.title|title }}
-
{{ entry.summary|accounting_default }}
-
{{ entry.income|accounting_format_amount|accounting_default }}
-
{{ entry.expense|accounting_format_amount|accounting_default }}
-
{{ entry.balance|accounting_report_format_amount }}
+ {% include "accounting/report/include/income-expenses-row-desktop.html" %}
{% endfor %} diff --git a/src/accounting/templates/accounting/report/ledger.html b/src/accounting/templates/accounting/report/ledger.html index 5f98562..9350379 100644 --- a/src/accounting/templates/accounting/report/ledger.html +++ b/src/accounting/templates/accounting/report/ledger.html @@ -167,21 +167,13 @@ First written: 2023/3/5 {% if report.brought_forward %} {% with entry = report.brought_forward %}
-
{{ entry.date|accounting_format_date }}
-
{{ entry.summary|accounting_default }}
-
{{ entry.debit|accounting_format_amount|accounting_default }}
-
{{ entry.credit|accounting_format_amount|accounting_default }}
-
{{ entry.balance|accounting_report_format_amount }}
+ {% include "accounting/report/include/ledger-row-desktop.html" %}
{% endwith %} {% endif %} {% for entry in report.entries %} -
{{ entry.date|accounting_format_date }}
-
{{ entry.summary|accounting_default }}
-
{{ entry.debit|accounting_format_amount|accounting_default }}
-
{{ entry.credit|accounting_format_amount|accounting_default }}
-
{{ entry.balance|accounting_report_format_amount }}
+ {% include "accounting/report/include/ledger-row-desktop.html" %}
{% endfor %}