From 3c294ffcb848d1cbda5ff62f0690bd8b51ad9337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 21 Jul 2020 11:58:50 +0800 Subject: [PATCH] Updated the template variables in the balance sheet in the accounting application. --- .../templates/accounting/balance-sheet.html | 56 +++++++++---------- accounting/views/reports.py | 6 +- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/accounting/templates/accounting/balance-sheet.html b/accounting/templates/accounting/balance-sheet.html index ab3a695..1330fcf 100644 --- a/accounting/templates/accounting/balance-sheet.html +++ b/accounting/templates/accounting/balance-sheet.html @@ -85,11 +85,11 @@ First written: 2020/7/20 - + - {% for group in section_1.groups %} + {% for group in assets.groups %} @@ -116,11 +116,11 @@ First written: 2020/7/20
{{ section_1.title|title }}{{ assets.title|title }}
{{ group.title|title }}
- + - {% for group in section_2.groups %} + {% for group in liabilities.groups %} @@ -143,8 +143,8 @@ First written: 2020/7/20 - @@ -153,11 +153,11 @@ First written: 2020/7/20
{{ section_2.title|title }}{{ liabilities.title|title }}
{{ group.title|title }}
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} - {{ section_2.balance|accounting_amount }} + + {{ liabilities.balance|accounting_amount }}
- + - {% for group in section_3.groups %} + {% for group in owners_equity.groups %} @@ -180,8 +180,8 @@ First written: 2020/7/20 - @@ -195,8 +195,8 @@ First written: 2020/7/20 - @@ -208,8 +208,8 @@ First written: 2020/7/20 - @@ -228,9 +228,9 @@ First written: 2020/7/20
@@ -259,9 +259,9 @@ First written: 2020/7/20
  • - {{ section_2.title|title }} + {{ liabilities.title|title }}
  • - {% for group in section_2.groups %} + {% for group in liabilities.groups %}
  • {{ group.title|title }}
  • @@ -280,17 +280,17 @@ First written: 2020/7/20 {% endfor %}
  • {% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} - - {{ section_2.balance|accounting_amount }} + + {{ liabilities.balance|accounting_amount }}
  • - {{ section_3.title|title }} + {{ owners_equity.title|title }}
  • - {% for group in section_3.groups %} + {% for group in owners_equity.groups %}
  • {{ group.title|title }}
  • @@ -310,8 +310,8 @@ First written: 2020/7/20 {% endfor %}
  • {% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} - - {{ section_3.balance|accounting_amount }} + + {{ owners_equity.balance|accounting_amount }}
@@ -319,8 +319,8 @@ First written: 2020/7/20
  • {% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} - - {{ section_2.balance|add:section_3.balance|accounting_amount }} + + {{ liabilities.balance|add:owners_equity.balance|accounting_amount }}
diff --git a/accounting/views/reports.py b/accounting/views/reports.py index 6e3ab76..13a010a 100644 --- a/accounting/views/reports.py +++ b/accounting/views/reports.py @@ -784,9 +784,9 @@ def balance_sheet(request, period_spec): section.balance = sum([x.balance for x in section.groups]) by_code = {x.code: x for x in sections} return render(request, "accounting/balance-sheet.html", { - "section_1": by_code["1"], - "section_2": by_code["2"], - "section_3": by_code["3"], + "assets": by_code["1"], + "liabilities": by_code["2"], + "owners_equity": by_code["3"], "reports": ReportUrl(period=period), "period": period, })
{{ section_3.title|title }}{{ owners_equity.title|title }}
{{ group.title|title }}
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} - {{ section_3.balance|accounting_amount }} + + {{ owners_equity.balance|accounting_amount }}
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} - {{ section_1.balance|accounting_amount }} + + {{ assets.balance|accounting_amount }}
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }} - {{ section_2.balance|add:section_3.balance|accounting_amount }} + + {{ liabilities.balance|add:owners_equity.balance|accounting_amount }}