From 19c1e8b586b86ff56af52b0afd3432f6514a2af5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sun, 9 Aug 2020 12:21:01 +0800 Subject: [PATCH] Renamed the variable txn to form in the transaction forms in the accounting application. --- .../accounting/transaction_form-expense.html | 18 +++++------ .../accounting/transaction_form-income.html | 18 +++++------ .../accounting/transaction_form-transfer.html | 30 +++++++++---------- accounting/views.py | 2 +- 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/accounting/templates/accounting/transaction_form-expense.html b/accounting/templates/accounting/transaction_form-expense.html index 32931de..a591f77 100644 --- a/accounting/templates/accounting/transaction_form-expense.html +++ b/accounting/templates/accounting/transaction_form-expense.html @@ -38,7 +38,7 @@ First written: 2020/7/23 {% include "accounting/include/summary-helper.html" %} -{% for message in txn.non_field_errors %} +{% for message in form.non_field_errors %}
{{ _("Error:")|force_escape }} {{ message }} @@ -46,7 +46,7 @@ First written: 2020/7/23 {% endfor %}
- + {{ _("Back")|force_escape }} @@ -55,22 +55,22 @@ First written: 2020/7/23 -
+ {% csrf_token %}
- -
{% if should_validate %}{{ txn.date.errors.0|default:"" }}{% endif %}
+ +
{% if should_validate %}{{ form.date.errors.0|default:"" }}{% endif %}
    - {% for record in txn.debit_records %} + {% for record in form.debit_records %} {% with record_type="debit" no=forloop.counter order=forloop.counter %} {% include "accounting/include/form-record-non-transfer.html" %} {% endwith %} @@ -85,7 +85,7 @@ First written: 2020/7/23
  • {{ _("Total")|force_escape }} - {{ txn.debit_total }} + {{ form.debit_total }}
@@ -97,8 +97,8 @@ First written: 2020/7/23
- -
{% if should_validate %}{{ txn.notes.errors.0|default:"" }}{% endif %}
+ +
{% if should_validate %}{{ form.notes.errors.0|default:"" }}{% endif %}
diff --git a/accounting/templates/accounting/transaction_form-income.html b/accounting/templates/accounting/transaction_form-income.html index c8657d4..3e567fc 100644 --- a/accounting/templates/accounting/transaction_form-income.html +++ b/accounting/templates/accounting/transaction_form-income.html @@ -38,7 +38,7 @@ First written: 2020/7/23 {% include "accounting/include/summary-helper.html" %} -{% for message in txn.non_field_errors %} +{% for message in form.non_field_errors %}
{{ _("Error:")|force_escape }} {{ message }} @@ -46,7 +46,7 @@ First written: 2020/7/23 {% endfor %}
- + {{ _("Back")|force_escape }} @@ -55,22 +55,22 @@ First written: 2020/7/23 - + {% csrf_token %}
- -
{% if should_validate %}{{ txn.date.errors.0|default:"" }}{% endif %}
+ +
{% if should_validate %}{{ form.date.errors.0|default:"" }}{% endif %}
    - {% for record in txn.credit_records %} + {% for record in form.credit_records %} {% with record_type="credit" no=forloop.counter order=forloop.counter %} {% include "accounting/include/form-record-non-transfer.html" %} {% endwith %} @@ -85,7 +85,7 @@ First written: 2020/7/23
  • {{ _("Total")|force_escape }} - {{ txn.credit_total }} + {{ form.credit_total }}
@@ -97,8 +97,8 @@ First written: 2020/7/23
- -
{% if should_validate %}{{ txn.notes.errors.0|default:"" }}{% endif %}
+ +
{% if should_validate %}{{ form.notes.errors.0|default:"" }}{% endif %}
diff --git a/accounting/templates/accounting/transaction_form-transfer.html b/accounting/templates/accounting/transaction_form-transfer.html index fda1c41..2359a26 100644 --- a/accounting/templates/accounting/transaction_form-transfer.html +++ b/accounting/templates/accounting/transaction_form-transfer.html @@ -38,7 +38,7 @@ First written: 2020/7/23 {% include "accounting/include/summary-helper.html" %} -{% for message in txn.non_field_errors %} +{% for message in form.non_field_errors %}
{{ _("Error:")|force_escape }} {{ message }} @@ -46,7 +46,7 @@ First written: 2020/7/23 {% endfor %}
- + {{ _("Back")|force_escape }} @@ -55,15 +55,15 @@ First written: 2020/7/23 - + {% csrf_token %}
- -
{% if should_validate %}{{ txn.date.errors.0|default:"" }}{% endif %}
+ +
{% if should_validate %}{{ form.date.errors.0|default:"" }}{% endif %}
@@ -72,7 +72,7 @@ First written: 2020/7/23

{{ _("Debit")|force_escape }}

    - {% for record in txn.debit_records %} + {% for record in form.debit_records %} {% with record_type="debit" no=forloop.counter order=forloop.counter %} {% include "accounting/include/form-record-transfer.html" %} {% endwith %} @@ -85,11 +85,11 @@ First written: 2020/7/23
  • -
    +
    {{ _("Total")|force_escape }} - {{ txn.debit_total }} + {{ form.debit_total }}
    -
    {% if should_validate %}{{ txn.balance_error|default:"" }}{% endif %}
    +
    {% if should_validate %}{{ form.balance_error|default:"" }}{% endif %}
@@ -98,7 +98,7 @@ First written: 2020/7/23

{{ _("Credit")|force_escape }}

    - {% for record in txn.credit_records %} + {% for record in form.credit_records %} {% with record_type="credit" no=forloop.counter order=forloop.counter %} {% include "accounting/include/form-record-transfer.html" %} {% endwith %} @@ -111,11 +111,11 @@ First written: 2020/7/23
  • -
    +
    {{ _("Total")|force_escape }} - {{ txn.credit_total }} + {{ form.credit_total }}
    -
    {% if should_validate %}{{ txn.balance_error|default:"" }}{% endif %}
    +
    {% if should_validate %}{{ form.balance_error|default:"" }}{% endif %}
@@ -126,8 +126,8 @@ First written: 2020/7/23
- -
{% if should_validate %}{{ txn.notes.errors.0|default:"" }}{% endif %}
+ +
{% if should_validate %}{{ form.notes.errors.0|default:"" }}{% endif %}
diff --git a/accounting/views.py b/accounting/views.py index 2fdba7b..1f24a8c 100644 --- a/accounting/views.py +++ b/accounting/views.py @@ -852,7 +852,7 @@ def txn_form(request, txn_type, txn=None): "accounting/include/form-record-non-transfer.html", new_record_context)) return render(request, F"accounting/transaction_form-{txn_type}.html", { - "txn": form, + "form": form, "summary_categories": get_summary_categories, "should_validate": should_validate, "new_record_template": new_record_template,