Renamed the template variables in the transaction views and forms and sorting form to be more meaningful in the accounting application.

This commit is contained in:
依瑪貓 2020-08-08 14:05:29 +08:00
parent fe1e4a40be
commit 651f527c86
8 changed files with 114 additions and 114 deletions

View File

@ -38,7 +38,7 @@ First written: 2020/7/23
{% include "accounting/include/summary-helper.html" %} {% include "accounting/include/summary-helper.html" %}
{% for message in item.non_field_errors %} {% for message in txn.non_field_errors %}
<div class="alert alert-danger alert-dismissible fade show"> <div class="alert alert-danger alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">&times;</button> <button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>{{ _("Error:")|force_escape }}</strong> {{ message }} <strong>{{ _("Error:")|force_escape }}</strong> {{ message }}
@ -46,7 +46,7 @@ First written: 2020/7/23
{% endfor %} {% endfor %}
<div class="btn-group btn-actions"> <div class="btn-group btn-actions">
<a class="btn btn-primary" role="button" href="{% if item.transaction %}{% url_keep_return "accounting:transactions.show" "expense" item.transaction %}{% elif request.GET.r %}{{ request.GET.r }}{% else %}{% url "accounting:home" %}{% endif %}"> <a class="btn btn-primary" role="button" href="{% if txn.transaction %}{% url_keep_return "accounting:transactions.show" "expense" txn.transaction %}{% elif request.GET.r %}{{ request.GET.r }}{% else %}{% url "accounting:home" %}{% endif %}">
<i class="fas fa-chevron-circle-left"></i> <i class="fas fa-chevron-circle-left"></i>
{{ _("Back")|force_escape }} {{ _("Back")|force_escape }}
</a> </a>
@ -55,22 +55,22 @@ First written: 2020/7/23
<input id="account-option-url" type="hidden" value="{% url "accounting:accounts.options" %}" /> <input id="account-option-url" type="hidden" value="{% url "accounting:accounts.options" %}" />
<input id="summary-categories" type="hidden" value="{{ summary_categories }}" /> <input id="summary-categories" type="hidden" value="{{ summary_categories }}" />
<input id="new-record-template" type="hidden" value="{{ new_record_template }}" /> <input id="new-record-template" type="hidden" value="{{ new_record_template }}" />
<form id="txn-form" action="{% if item.transaction %}{% url_keep_return "accounting:transactions.update" "expense" item.transaction %}{% else %}{% url_keep_return "accounting:transactions.store" "expense" %}{% endif %}" method="post"> <form id="txn-form" action="{% if txn.transaction %}{% url_keep_return "accounting:transactions.update" "expense" txn.transaction %}{% else %}{% url_keep_return "accounting:transactions.store" "expense" %}{% endif %}" method="post">
{% csrf_token %} {% csrf_token %}
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2"> <div class="col-sm-2">
<label for="txn-date">{{ _("Date:")|force_escape }}</label> <label for="txn-date">{{ _("Date:")|force_escape }}</label>
</div> </div>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="txn-date" class="form-control {% if should_validate and item.date.errors %} is-invalid {% endif %}" type="date" name="date" value="{{ item.date.value }}" required="required" /> <input id="txn-date" class="form-control {% if should_validate and txn.date.errors %} is-invalid {% endif %}" type="date" name="date" value="{{ txn.date.value }}" required="required" />
<div id="txn-date-error" class="invalid-feedback">{% if should_validate %}{{ item.date.errors.0|default:"" }}{% endif %}</div> <div id="txn-date-error" class="invalid-feedback">{% if should_validate %}{{ txn.date.errors.0|default:"" }}{% endif %}</div>
</div> </div>
</div> </div>
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<ul id="debit-records" class="list-group"> <ul id="debit-records" class="list-group">
{% for record in item.debit_records %} {% for record in txn.debit_records %}
{% with record_type="debit" no=forloop.counter order=forloop.counter %} {% with record_type="debit" no=forloop.counter order=forloop.counter %}
{% include "accounting/include/form-record-non-transfer.html" %} {% include "accounting/include/form-record-non-transfer.html" %}
{% endwith %} {% endwith %}
@ -85,7 +85,7 @@ First written: 2020/7/23
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center"> <div class="d-flex justify-content-between align-items-center">
{{ _("Total")|force_escape }} {{ _("Total")|force_escape }}
<span id="debit-total" class="amount">{{ item.debit_total }}</span> <span id="debit-total" class="amount">{{ txn.debit_total }}</span>
</div> </div>
</li> </li>
</ul> </ul>
@ -97,8 +97,8 @@ First written: 2020/7/23
<label for="txn-note">{{ _("Notes:")|force_escape }}</label> <label for="txn-note">{{ _("Notes:")|force_escape }}</label>
</div> </div>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea id="txn-note" class="form-control {% if should_validate and item.notes.errors %} is-invalid {% endif %}" name="notes">{{ item.notes.value|default:"" }}</textarea> <textarea id="txn-note" class="form-control {% if should_validate and txn.notes.errors %} is-invalid {% endif %}" name="notes">{{ txn.notes.value|default:"" }}</textarea>
<div id="txn-note-error" class="invalid-feedback">{% if should_validate %}{{ item.notes.errors.0|default:"" }}{% endif %}</div> <div id="txn-note-error" class="invalid-feedback">{% if should_validate %}{{ txn.notes.errors.0|default:"" }}{% endif %}</div>
</div> </div>
</div> </div>

View File

@ -32,7 +32,7 @@ First written: 2020/7/23
{% block content %} {% block content %}
{% if item.has_order_hole %} {% if txn.has_order_hole %}
<div class="alert alert-danger alert-dismissible fade show"> <div class="alert alert-danger alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">&times;</button> <button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>{{ _("Error:") }}</strong> {{ _("The transactions on this day are not well-ordered. Please reorder them.")|force_escape }} <strong>{{ _("Error:") }}</strong> {{ _("The transactions on this day are not well-ordered. Please reorder them.")|force_escape }}
@ -40,7 +40,7 @@ First written: 2020/7/23
{% endif %} {% endif %}
<!-- the delete confirmation dialog --> <!-- the delete confirmation dialog -->
<form action="{% url_keep_return "accounting:transactions.delete" item %}" method="post"> <form action="{% url_keep_return "accounting:transactions.delete" txn %}" method="post">
{% csrf_token %} {% csrf_token %}
<!-- The Modal --> <!-- The Modal -->
<div class="modal" id="del-modal"> <div class="modal" id="del-modal">
@ -71,22 +71,22 @@ First written: 2020/7/23
<i class="fas fa-chevron-circle-left"></i> <i class="fas fa-chevron-circle-left"></i>
{{ _("Back")|force_escape }} {{ _("Back")|force_escape }}
</a> </a>
<a class="btn btn-primary" role="button" href="{% url_keep_return "accounting:transactions.edit" "expense" item %}"> <a class="btn btn-primary" role="button" href="{% url_keep_return "accounting:transactions.edit" "expense" txn %}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
{{ _("Edit")|force_escape }} {{ _("Edit")|force_escape }}
</a> </a>
{% if not item.has_many_same_day %} {% if not txn.has_many_same_day %}
<button type="button" class="btn btn-secondary d-none d-sm-inline" disabled="disabled" title="{{ _("There is no other transaction at the same day.")|force_escape }}"> <button type="button" class="btn btn-secondary d-none d-sm-inline" disabled="disabled" title="{{ _("There is no other transaction at the same day.")|force_escape }}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{{ _("Sort")|force_escape }} {{ _("Sort")|force_escape }}
</button> </button>
{% else %} {% else %}
<a class="btn btn-primary d-none d-sm-inline" role="button" href="{% url_with_return "accounting:transactions.sort" item.date %}"> <a class="btn btn-primary d-none d-sm-inline" role="button" href="{% url_with_return "accounting:transactions.sort" txn.date %}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{{ _("Sort")|force_escape }} {{ _("Sort")|force_escape }}
</a> </a>
{% endif %} {% endif %}
<a class="btn btn-primary d-none d-sm-inline" href="{% url_keep_return "accounting:transactions.show" "transfer" item %}"> <a class="btn btn-primary d-none d-sm-inline" href="{% url_keep_return "accounting:transactions.show" "transfer" txn %}">
<i class="fas fa-exchange-alt"></i> <i class="fas fa-exchange-alt"></i>
{{ _("To Transfer")|force_escape }} {{ _("To Transfer")|force_escape }}
</a> </a>
@ -95,18 +95,18 @@ First written: 2020/7/23
<i class="fas fa-bars"></i> <i class="fas fa-bars"></i>
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
{% if not item.has_many_same_day %} {% if not txn.has_many_same_day %}
<span class="dropdown-item disabled" title="{{ _("There is no other transaction at the same day.")|force_escape }}"> <span class="dropdown-item disabled" title="{{ _("There is no other transaction at the same day.")|force_escape }}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{{ _("Sort")|force_escape }} {{ _("Sort")|force_escape }}
</span> </span>
{% else %} {% else %}
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.sort" item.date %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.sort" txn.date %}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{{ _("Sort")|force_escape }} {{ _("Sort")|force_escape }}
</a> </a>
{% endif %} {% endif %}
<a class="dropdown-item" href="{% url_keep_return "accounting:transactions.show" "transfer" item %}"> <a class="dropdown-item" href="{% url_keep_return "accounting:transactions.show" "transfer" txn %}">
<i class="fas fa-exchange-alt"></i> <i class="fas fa-exchange-alt"></i>
{{ _("To Transfer")|force_escape }} {{ _("To Transfer")|force_escape }}
</a> </a>
@ -120,7 +120,7 @@ First written: 2020/7/23
<div class="row"> <div class="row">
<div class="col-sm-2">{{ _("Date:")|force_escape }}</div> <div class="col-sm-2">{{ _("Date:")|force_escape }}</div>
<div class="col-sm-10">{{ item.date|smart_date }}</div> <div class="col-sm-10">{{ txn.date|smart_date }}</div>
</div> </div>
<table class="table table-striped table-hover d-none d-sm-table"> <table class="table table-striped table-hover d-none d-sm-table">
@ -132,7 +132,7 @@ First written: 2020/7/23
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for x in item.debit_records %} {% for x in txn.debit_records %}
<tr> <tr>
<td>{{ x.account.title|title_case }}</td> <td>{{ x.account.title|title_case }}</td>
<td>{{ x.summary|default:"" }}</td> <td>{{ x.summary|default:"" }}</td>
@ -143,13 +143,13 @@ First written: 2020/7/23
<tfoot> <tfoot>
<tr> <tr>
<td colspan="2">{{ _("Total")|force_escape }}</td> <td colspan="2">{{ _("Total")|force_escape }}</td>
<td class="amount">{{ item.debit_total|accounting_amount }}</td> <td class="amount">{{ txn.debit_total|accounting_amount }}</td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
<ul class="list-group d-sm-none"> <ul class="list-group d-sm-none">
{% for x in item.debit_records %} {% for x in txn.debit_records %}
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center account-line"> <div class="d-flex justify-content-between align-items-center account-line">
{{ x.account.title|title_case }} {{ x.account.title|title_case }}
@ -161,36 +161,36 @@ First written: 2020/7/23
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center account-line"> <div class="d-flex justify-content-between align-items-center account-line">
{{ _("Total")|force_escape }} {{ _("Total")|force_escape }}
<span class="badge badge-info">{{ item.debit_total|accounting_amount }}</span> <span class="badge badge-info">{{ txn.debit_total|accounting_amount }}</span>
</div> </div>
</li> </li>
</ul> </ul>
{% if item.notes %} {% if txn.notes %}
<div class="row"> <div class="row">
<div class="col-sm-2">{{ _("Notes:")|force_escape }}</div> <div class="col-sm-2">{{ _("Notes:")|force_escape }}</div>
<div class="col-sm-10">{{ item.notes }}</div> <div class="col-sm-10">{{ txn.notes }}</div>
</div> </div>
{% endif %} {% endif %}
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2">{{ _("Created at:")|force_escape }}</div> <div class="col-sm-2">{{ _("Created at:")|force_escape }}</div>
<div class="col-sm-10">{{ item.created_at }}</div> <div class="col-sm-10">{{ txn.created_at }}</div>
</div> </div>
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2">{{ _("Created by:")|force_escape }}</div> <div class="col-sm-2">{{ _("Created by:")|force_escape }}</div>
<div class="col-sm-10">{{ item.created_by.name }}</div> <div class="col-sm-10">{{ txn.created_by.name }}</div>
</div> </div>
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2">{{ _("Updated at:")|force_escape }}</div> <div class="col-sm-2">{{ _("Updated at:")|force_escape }}</div>
<div class="col-sm-10">{{ item.updated_at }}</div> <div class="col-sm-10">{{ txn.updated_at }}</div>
</div> </div>
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2">{{ _("Updated by:")|force_escape }}</div> <div class="col-sm-2">{{ _("Updated by:")|force_escape }}</div>
<div class="col-sm-10">{{ item.updated_by.name }}</div> <div class="col-sm-10">{{ txn.updated_by.name }}</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -38,7 +38,7 @@ First written: 2020/7/23
{% include "accounting/include/summary-helper.html" %} {% include "accounting/include/summary-helper.html" %}
{% for message in item.non_field_errors %} {% for message in txn.non_field_errors %}
<div class="alert alert-danger alert-dismissible fade show"> <div class="alert alert-danger alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">&times;</button> <button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>{{ _("Error:")|force_escape }}</strong> {{ message }} <strong>{{ _("Error:")|force_escape }}</strong> {{ message }}
@ -46,7 +46,7 @@ First written: 2020/7/23
{% endfor %} {% endfor %}
<div class="btn-group btn-actions"> <div class="btn-group btn-actions">
<a class="btn btn-primary" role="button" href="{% if item.transaction %}{% url_keep_return "accounting:transactions.show" "income" item.transaction %}{% elif request.GET.r %}{{ request.GET.r }}{% else %}{% url "accounting:home" %}{% endif %}"> <a class="btn btn-primary" role="button" href="{% if txn.transaction %}{% url_keep_return "accounting:transactions.show" "income" txn.transaction %}{% elif request.GET.r %}{{ request.GET.r }}{% else %}{% url "accounting:home" %}{% endif %}">
<i class="fas fa-chevron-circle-left"></i> <i class="fas fa-chevron-circle-left"></i>
{{ _("Back")|force_escape }} {{ _("Back")|force_escape }}
</a> </a>
@ -55,22 +55,22 @@ First written: 2020/7/23
<input id="account-option-url" type="hidden" value="{% url "accounting:accounts.options" %}" /> <input id="account-option-url" type="hidden" value="{% url "accounting:accounts.options" %}" />
<input id="summary-categories" type="hidden" value="{{ summary_categories }}" /> <input id="summary-categories" type="hidden" value="{{ summary_categories }}" />
<input id="new-record-template" type="hidden" value="{{ new_record_template }}" /> <input id="new-record-template" type="hidden" value="{{ new_record_template }}" />
<form id="txn-form" action="{% if item.transaction %}{% url_keep_return "accounting:transactions.update" "income" item.transaction %}{% else %}{% url_keep_return "accounting:transactions.store" "income" %}{% endif %}" method="post"> <form id="txn-form" action="{% if txn.transaction %}{% url_keep_return "accounting:transactions.update" "income" txn.transaction %}{% else %}{% url_keep_return "accounting:transactions.store" "income" %}{% endif %}" method="post">
{% csrf_token %} {% csrf_token %}
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2"> <div class="col-sm-2">
<label for="txn-date">{{ _("Date:")|force_escape }}</label> <label for="txn-date">{{ _("Date:")|force_escape }}</label>
</div> </div>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="txn-date" class="form-control {% if should_validate and item.date.errors %} is-invalid {% endif %}" type="date" name="date" value="{{ item.date.value }}" required="required" /> <input id="txn-date" class="form-control {% if should_validate and txn.date.errors %} is-invalid {% endif %}" type="date" name="date" value="{{ txn.date.value }}" required="required" />
<div id="txn-date-error" class="invalid-feedback">{% if should_validate %}{{ item.date.errors.0|default:"" }}{% endif %}</div> <div id="txn-date-error" class="invalid-feedback">{% if should_validate %}{{ txn.date.errors.0|default:"" }}{% endif %}</div>
</div> </div>
</div> </div>
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<ul id="credit-records" class="list-group"> <ul id="credit-records" class="list-group">
{% for record in item.credit_records %} {% for record in txn.credit_records %}
{% with record_type="credit" no=forloop.counter order=forloop.counter %} {% with record_type="credit" no=forloop.counter order=forloop.counter %}
{% include "accounting/include/form-record-non-transfer.html" %} {% include "accounting/include/form-record-non-transfer.html" %}
{% endwith %} {% endwith %}
@ -85,7 +85,7 @@ First written: 2020/7/23
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center"> <div class="d-flex justify-content-between align-items-center">
{{ _("Total")|force_escape }} {{ _("Total")|force_escape }}
<span id="credit-total" class="amount">{{ item.credit_total }}</span> <span id="credit-total" class="amount">{{ txn.credit_total }}</span>
</div> </div>
</li> </li>
</ul> </ul>
@ -97,8 +97,8 @@ First written: 2020/7/23
<label for="txn-note">{{ _("Notes:")|force_escape }}</label> <label for="txn-note">{{ _("Notes:")|force_escape }}</label>
</div> </div>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea id="txn-note" class="form-control {% if should_validate and item.notes.errors %} is-invalid {% endif %}" name="notes">{{ item.notes.value|default:"" }}</textarea> <textarea id="txn-note" class="form-control {% if should_validate and txn.notes.errors %} is-invalid {% endif %}" name="notes">{{ txn.notes.value|default:"" }}</textarea>
<div id="txn-note-error" class="invalid-feedback">{% if should_validate %}{{ item.notes.errors.0|default:"" }}{% endif %}</div> <div id="txn-note-error" class="invalid-feedback">{% if should_validate %}{{ txn.notes.errors.0|default:"" }}{% endif %}</div>
</div> </div>
</div> </div>

View File

@ -32,7 +32,7 @@ First written: 2020/7/23
{% block content %} {% block content %}
{% if item.has_order_hole %} {% if txn.has_order_hole %}
<div class="alert alert-danger alert-dismissible fade show"> <div class="alert alert-danger alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">&times;</button> <button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>{{ _("Error:") }}</strong> {{ _("The transactions on this day are not well-ordered. Please reorder them.")|force_escape }} <strong>{{ _("Error:") }}</strong> {{ _("The transactions on this day are not well-ordered. Please reorder them.")|force_escape }}
@ -40,7 +40,7 @@ First written: 2020/7/23
{% endif %} {% endif %}
<!-- the delete confirmation dialog --> <!-- the delete confirmation dialog -->
<form action="{% url_keep_return "accounting:transactions.delete" item %}" method="post"> <form action="{% url_keep_return "accounting:transactions.delete" txn %}" method="post">
{% csrf_token %} {% csrf_token %}
<!-- The Modal --> <!-- The Modal -->
<div class="modal" id="del-modal"> <div class="modal" id="del-modal">
@ -71,22 +71,22 @@ First written: 2020/7/23
<i class="fas fa-chevron-circle-left"></i> <i class="fas fa-chevron-circle-left"></i>
{{ _("Back")|force_escape }} {{ _("Back")|force_escape }}
</a> </a>
<a class="btn btn-primary" role="button" href="{% url_keep_return "accounting:transactions.edit" "income" item %}"> <a class="btn btn-primary" role="button" href="{% url_keep_return "accounting:transactions.edit" "income" txn %}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
{{ _("Edit")|force_escape }} {{ _("Edit")|force_escape }}
</a> </a>
{% if not item.has_many_same_day %} {% if not txn.has_many_same_day %}
<button type="button" class="btn btn-secondary d-none d-sm-inline" disabled="disabled" title="{{ _("There is no other transaction at the same day.")|force_escape }}"> <button type="button" class="btn btn-secondary d-none d-sm-inline" disabled="disabled" title="{{ _("There is no other transaction at the same day.")|force_escape }}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{{ _("Sort")|force_escape }} {{ _("Sort")|force_escape }}
</button> </button>
{% else %} {% else %}
<a class="btn btn-primary d-none d-sm-inline" role="button" href="{% url_with_return "accounting:transactions.sort" item.date %}"> <a class="btn btn-primary d-none d-sm-inline" role="button" href="{% url_with_return "accounting:transactions.sort" txn.date %}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{{ _("Sort")|force_escape }} {{ _("Sort")|force_escape }}
</a> </a>
{% endif %} {% endif %}
<a class="btn btn-primary d-none d-sm-inline" href="{% url_keep_return "accounting:transactions.show" "transfer" item %}"> <a class="btn btn-primary d-none d-sm-inline" href="{% url_keep_return "accounting:transactions.show" "transfer" txn %}">
<i class="fas fa-exchange-alt"></i> <i class="fas fa-exchange-alt"></i>
{{ _("To Transfer")|force_escape }} {{ _("To Transfer")|force_escape }}
</a> </a>
@ -95,18 +95,18 @@ First written: 2020/7/23
<i class="fas fa-bars"></i> <i class="fas fa-bars"></i>
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
{% if not item.has_many_same_day %} {% if not txn.has_many_same_day %}
<span class="dropdown-item disabled" title="{{ _("There is no other transaction at the same day.")|force_escape }}"> <span class="dropdown-item disabled" title="{{ _("There is no other transaction at the same day.")|force_escape }}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{{ _("Sort")|force_escape }} {{ _("Sort")|force_escape }}
</span> </span>
{% else %} {% else %}
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.sort" item.date %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.sort" txn.date %}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{{ _("Sort")|force_escape }} {{ _("Sort")|force_escape }}
</a> </a>
{% endif %} {% endif %}
<a class="dropdown-item" href="{% url_keep_return "accounting:transactions.show" "transfer" item %}"> <a class="dropdown-item" href="{% url_keep_return "accounting:transactions.show" "transfer" txn %}">
<i class="fas fa-exchange-alt"></i> <i class="fas fa-exchange-alt"></i>
{{ _("To Transfer")|force_escape }} {{ _("To Transfer")|force_escape }}
</a> </a>
@ -120,7 +120,7 @@ First written: 2020/7/23
<div class="row"> <div class="row">
<div class="col-sm-2">{{ _("Date:")|force_escape }}</div> <div class="col-sm-2">{{ _("Date:")|force_escape }}</div>
<div class="col-sm-10">{{ item.date|smart_date }}</div> <div class="col-sm-10">{{ txn.date|smart_date }}</div>
</div> </div>
<table class="table table-striped table-hover d-none d-sm-table"> <table class="table table-striped table-hover d-none d-sm-table">
@ -132,7 +132,7 @@ First written: 2020/7/23
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for x in item.credit_records %} {% for x in txn.credit_records %}
<tr> <tr>
<td>{{ x.account.title|title_case }}</td> <td>{{ x.account.title|title_case }}</td>
<td>{{ x.summary|default:"" }}</td> <td>{{ x.summary|default:"" }}</td>
@ -143,13 +143,13 @@ First written: 2020/7/23
<tfoot> <tfoot>
<tr> <tr>
<td colspan="2">{{ _("Total")|force_escape }}</td> <td colspan="2">{{ _("Total")|force_escape }}</td>
<td class="amount">{{ item.credit_total|accounting_amount }}</td> <td class="amount">{{ txn.credit_total|accounting_amount }}</td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
<ul class="list-group d-sm-none"> <ul class="list-group d-sm-none">
{% for x in item.credit_records %} {% for x in txn.credit_records %}
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center account-line"> <div class="d-flex justify-content-between align-items-center account-line">
{{ x.account.title|title_case }} {{ x.account.title|title_case }}
@ -161,36 +161,36 @@ First written: 2020/7/23
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center account-line"> <div class="d-flex justify-content-between align-items-center account-line">
{{ _("Total")|force_escape }} {{ _("Total")|force_escape }}
<span class="badge badge-info">{{ item.credit_total|accounting_amount }}</span> <span class="badge badge-info">{{ txn.credit_total|accounting_amount }}</span>
</div> </div>
</li> </li>
</ul> </ul>
{% if item.notes %} {% if txn.notes %}
<div class="row"> <div class="row">
<div class="col-sm-2">{{ _("Notes:")|force_escape }}</div> <div class="col-sm-2">{{ _("Notes:")|force_escape }}</div>
<div class="col-sm-10">{{ item.notes }}</div> <div class="col-sm-10">{{ txn.notes }}</div>
</div> </div>
{% endif %} {% endif %}
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2">{{ _("Created at:")|force_escape }}</div> <div class="col-sm-2">{{ _("Created at:")|force_escape }}</div>
<div class="col-sm-10">{{ item.created_at }}</div> <div class="col-sm-10">{{ txn.created_at }}</div>
</div> </div>
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2">{{ _("Created by:")|force_escape }}</div> <div class="col-sm-2">{{ _("Created by:")|force_escape }}</div>
<div class="col-sm-10">{{ item.created_by.name }}</div> <div class="col-sm-10">{{ txn.created_by.name }}</div>
</div> </div>
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2">{{ _("Updated at:")|force_escape }}</div> <div class="col-sm-2">{{ _("Updated at:")|force_escape }}</div>
<div class="col-sm-10">{{ item.updated_at }}</div> <div class="col-sm-10">{{ txn.updated_at }}</div>
</div> </div>
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2">{{ _("Updated by:")|force_escape }}</div> <div class="col-sm-2">{{ _("Updated by:")|force_escape }}</div>
<div class="col-sm-10">{{ item.updated_by.name }}</div> <div class="col-sm-10">{{ txn.updated_by.name }}</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -54,7 +54,7 @@ First written: 2020/8/6
</div> </div>
</div> </div>
{% if item_list|length > 1 %} {% if txn_list|length > 1 %}
<form action="{% url_keep_return "accounting:transactions.sort" date %}" method="post"> <form action="{% url_keep_return "accounting:transactions.sort" date %}" method="post">
{% csrf_token %} {% csrf_token %}
<table class="table general-journal-table"> <table class="table general-journal-table">
@ -68,63 +68,63 @@ First written: 2020/8/6
</tr> </tr>
</thead> </thead>
<tbody id="transactions"> <tbody id="transactions">
{% for item in item_list %} {% for txn in txn_list %}
<tr id="transaction-{{ item.pk }}" class="transaction {% if not item.is_balanced %} table-danger {% endif %}"> <tr id="transaction-{{ txn.pk }}" class="transaction {% if not txn.is_balanced %} table-danger {% endif %}">
<td class="actions"> <td class="actions">
<div class="btn-group"> <div class="btn-group">
<button class="btn btn-outline-secondary" type="button"> <button class="btn btn-outline-secondary" type="button">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
</button> </button>
<a class="btn btn-primary" role="button" href="{% url_with_return "accounting:transactions.show" item.type item %}"> <a class="btn btn-primary" role="button" href="{% url_with_return "accounting:transactions.show" txn.type txn %}">
<i class="fas fa-eye"></i> <i class="fas fa-eye"></i>
</a> </a>
</div> </div>
</td> </td>
<td> <td>
{% if item.is_cash_expense %} {% if txn.is_cash_expense %}
{{ _("Cash Expense")|force_escape }} {{ _("Cash Expense")|force_escape }}
{% elif item.is_cash_income %} {% elif txn.is_cash_income %}
{{ _("Cash Income")|force_escape }} {{ _("Cash Income")|force_escape }}
{% else %} {% else %}
{{ _("Transfer")|force_escape }} {{ _("Transfer")|force_escape }}
{% endif %} {% endif %}
</td> </td>
<td> <td>
<input id="transaction-{{ item.pk }}-ord" type="hidden" name="transaction-{{ item.pk }}-ord" value="{{ forloop.counter }}" /> <input id="transaction-{{ txn.pk }}-ord" type="hidden" name="transaction-{{ txn.pk }}-ord" value="{{ forloop.counter }}" />
{% if item.is_cash_expense %} {% if txn.is_cash_expense %}
<ul class="txn-content-expense"> <ul class="txn-content-expense">
{% for summary in item.debit_sumaries %} {% for summary in txn.debit_sumaries %}
<li>{{ summary }}</li> <li>{{ summary }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% elif item.is_cash_income %} {% elif txn.is_cash_income %}
<ul class="txn-content-income"> <ul class="txn-content-income">
{% for summary in item.credit_summaries %} {% for summary in txn.credit_summaries %}
<li>{{ summary }}</li> <li>{{ summary }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% else %} {% else %}
<ul class="txn-content-expense"> <ul class="txn-content-expense">
{% for summary in item.debit_sumaries %} {% for summary in txn.debit_sumaries %}
<li>{{ summary }}</li> <li>{{ summary }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
<ul class="txn-content-income"> <ul class="txn-content-income">
{% for summary in item.credit_summaries %} {% for summary in txn.credit_summaries %}
<li>{{ summary }}</li> <li>{{ summary }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
{% if not item.is_balanced %} {% if not txn.is_balanced %}
<span class="badge badge-danger badge-pill"> <span class="badge badge-danger badge-pill">
{{ _("Unbalanced")|force_escape }} {{ _("Unbalanced")|force_escape }}
</span> </span>
{% endif %} {% endif %}
</td> </td>
<td class="amount"> <td class="amount">
{{ item.amount|accounting_amount }} {{ txn.amount|accounting_amount }}
</td> </td>
<td>{{ item.notes|default:"" }}</td> <td>{{ txn.notes|default:"" }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>

View File

@ -38,7 +38,7 @@ First written: 2020/7/23
{% include "accounting/include/summary-helper.html" %} {% include "accounting/include/summary-helper.html" %}
{% for message in item.non_field_errors %} {% for message in txn.non_field_errors %}
<div class="alert alert-danger alert-dismissible fade show"> <div class="alert alert-danger alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">&times;</button> <button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>{{ _("Error:")|force_escape }}</strong> {{ message }} <strong>{{ _("Error:")|force_escape }}</strong> {{ message }}
@ -46,7 +46,7 @@ First written: 2020/7/23
{% endfor %} {% endfor %}
<div class="btn-group btn-actions"> <div class="btn-group btn-actions">
<a class="btn btn-primary" role="button" href="{% if item.transaction %}{% url_keep_return "accounting:transactions.show" "transfer" item.transaction %}{% elif request.GET.r %}{{ request.GET.r }}{% else %}{% url "accounting:home" %}{% endif %}"> <a class="btn btn-primary" role="button" href="{% if txn.transaction %}{% url_keep_return "accounting:transactions.show" "transfer" txn.transaction %}{% elif request.GET.r %}{{ request.GET.r }}{% else %}{% url "accounting:home" %}{% endif %}">
<i class="fas fa-chevron-circle-left"></i> <i class="fas fa-chevron-circle-left"></i>
{{ _("Back")|force_escape }} {{ _("Back")|force_escape }}
</a> </a>
@ -55,15 +55,15 @@ First written: 2020/7/23
<input id="account-option-url" type="hidden" value="{% url "accounting:accounts.options" %}" /> <input id="account-option-url" type="hidden" value="{% url "accounting:accounts.options" %}" />
<input id="summary-categories" type="hidden" value="{{ summary_categories }}" /> <input id="summary-categories" type="hidden" value="{{ summary_categories }}" />
<input id="new-record-template" type="hidden" value="{{ new_record_template }}" /> <input id="new-record-template" type="hidden" value="{{ new_record_template }}" />
<form id="txn-form" action="{% if item.transaction %}{% url_keep_return "accounting:transactions.update" "transfer" item.transaction %}{% else %}{% url_keep_return "accounting:transactions.store" "transfer" %}{% endif %}" method="post"> <form id="txn-form" action="{% if txn.transaction %}{% url_keep_return "accounting:transactions.update" "transfer" txn.transaction %}{% else %}{% url_keep_return "accounting:transactions.store" "transfer" %}{% endif %}" method="post">
{% csrf_token %} {% csrf_token %}
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2"> <div class="col-sm-2">
<label for="txn-date">{{ _("Date:")|force_escape }}</label> <label for="txn-date">{{ _("Date:")|force_escape }}</label>
</div> </div>
<div class="col-sm-10"> <div class="col-sm-10">
<input id="txn-date" class="form-control {% if should_validate and item.date.errors %} is-invalid {% endif %}" type="date" name="date" value="{{ item.date.value }}" required="required" /> <input id="txn-date" class="form-control {% if should_validate and txn.date.errors %} is-invalid {% endif %}" type="date" name="date" value="{{ txn.date.value }}" required="required" />
<div id="txn-date-error" class="invalid-feedback">{% if should_validate %}{{ item.date.errors.0|default:"" }}{% endif %}</div> <div id="txn-date-error" class="invalid-feedback">{% if should_validate %}{{ txn.date.errors.0|default:"" }}{% endif %}</div>
</div> </div>
</div> </div>
@ -72,7 +72,7 @@ First written: 2020/7/23
<h2>{{ _("Debit")|force_escape }}</h2> <h2>{{ _("Debit")|force_escape }}</h2>
<ul id="debit-records" class="list-group"> <ul id="debit-records" class="list-group">
{% for record in item.debit_records %} {% for record in txn.debit_records %}
{% with record_type="debit" no=forloop.counter order=forloop.counter %} {% with record_type="debit" no=forloop.counter order=forloop.counter %}
{% include "accounting/include/form-record-transfer.html" %} {% include "accounting/include/form-record-transfer.html" %}
{% endwith %} {% endwith %}
@ -85,11 +85,11 @@ First written: 2020/7/23
</button> </button>
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<div id="debit-total-row" class="d-flex justify-content-between align-items-center form-control {% if should_validate and item.balance_error %} is-invalid {% endif %} balance-row"> <div id="debit-total-row" class="d-flex justify-content-between align-items-center form-control {% if should_validate and txn.balance_error %} is-invalid {% endif %} balance-row">
{{ _("Total")|force_escape }} {{ _("Total")|force_escape }}
<span id="debit-total" class="amount">{{ item.debit_total }}</span> <span id="debit-total" class="amount">{{ txn.debit_total }}</span>
</div> </div>
<div id="debit-total-error" class="invalid-feedback balance-error">{% if should_validate %}{{ item.balance_error|default:"" }}{% endif %}</div> <div id="debit-total-error" class="invalid-feedback balance-error">{% if should_validate %}{{ txn.balance_error|default:"" }}{% endif %}</div>
</li> </li>
</ul> </ul>
</div> </div>
@ -98,7 +98,7 @@ First written: 2020/7/23
<h2>{{ _("Credit")|force_escape }}</h2> <h2>{{ _("Credit")|force_escape }}</h2>
<ul id="credit-records" class="list-group"> <ul id="credit-records" class="list-group">
{% for record in item.credit_records %} {% for record in txn.credit_records %}
{% with record_type="credit" no=forloop.counter order=forloop.counter %} {% with record_type="credit" no=forloop.counter order=forloop.counter %}
{% include "accounting/include/form-record-transfer.html" %} {% include "accounting/include/form-record-transfer.html" %}
{% endwith %} {% endwith %}
@ -111,11 +111,11 @@ First written: 2020/7/23
</button> </button>
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
<div id="credit-total-row" class="d-flex justify-content-between align-items-center form-control {% if should_validate and item.balance_error %} is-invalid {% endif %} balance-row"> <div id="credit-total-row" class="d-flex justify-content-between align-items-center form-control {% if should_validate and txn.balance_error %} is-invalid {% endif %} balance-row">
{{ _("Total")|force_escape }} {{ _("Total")|force_escape }}
<span id="credit-total" class="amount">{{ item.credit_total }}</span> <span id="credit-total" class="amount">{{ txn.credit_total }}</span>
</div> </div>
<div id="credit-total-error" class="invalid-feedback balance-error">{% if should_validate %}{{ item.balance_error|default:"" }}{% endif %}</div> <div id="credit-total-error" class="invalid-feedback balance-error">{% if should_validate %}{{ txn.balance_error|default:"" }}{% endif %}</div>
</li> </li>
</ul> </ul>
</div> </div>
@ -126,8 +126,8 @@ First written: 2020/7/23
<label for="txn-note">{{ _("Notes:")|force_escape }}</label> <label for="txn-note">{{ _("Notes:")|force_escape }}</label>
</div> </div>
<div class="col-sm-10"> <div class="col-sm-10">
<textarea id="txn-note" class="form-control {% if should_validate and item.notes.errors %} is-invalid {% endif %}" name="notes">{{ item.notes.value|default:"" }}</textarea> <textarea id="txn-note" class="form-control {% if should_validate and txn.notes.errors %} is-invalid {% endif %}" name="notes">{{ txn.notes.value|default:"" }}</textarea>
<div id="txn-note-error" class="invalid-feedback">{% if should_validate %}{{ item.notes.errors.0|default:"" }}{% endif %}</div> <div id="txn-note-error" class="invalid-feedback">{% if should_validate %}{{ txn.notes.errors.0|default:"" }}{% endif %}</div>
</div> </div>
</div> </div>

View File

@ -32,7 +32,7 @@ First written: 2020/7/23
{% block content %} {% block content %}
{% if item.has_order_hole %} {% if txn.has_order_hole %}
<div class="alert alert-danger alert-dismissible fade show"> <div class="alert alert-danger alert-dismissible fade show">
<button type="button" class="close" data-dismiss="alert">&times;</button> <button type="button" class="close" data-dismiss="alert">&times;</button>
<strong>{{ _("Error:") }}</strong> {{ _("The transactions on this day are not well-ordered. Please reorder them.")|force_escape }} <strong>{{ _("Error:") }}</strong> {{ _("The transactions on this day are not well-ordered. Please reorder them.")|force_escape }}
@ -40,7 +40,7 @@ First written: 2020/7/23
{% endif %} {% endif %}
<!-- the delete confirmation dialog --> <!-- the delete confirmation dialog -->
<form action="{% url_keep_return "accounting:transactions.delete" item %}" method="post"> <form action="{% url_keep_return "accounting:transactions.delete" txn %}" method="post">
{% csrf_token %} {% csrf_token %}
<!-- The Modal --> <!-- The Modal -->
<div class="modal" id="del-modal"> <div class="modal" id="del-modal">
@ -71,17 +71,17 @@ First written: 2020/7/23
<i class="fas fa-chevron-circle-left"></i> <i class="fas fa-chevron-circle-left"></i>
{{ _("Back")|force_escape }} {{ _("Back")|force_escape }}
</a> </a>
<a class="btn btn-primary" role="button" href="{% url_keep_return "accounting:transactions.edit" "transfer" item %}"> <a class="btn btn-primary" role="button" href="{% url_keep_return "accounting:transactions.edit" "transfer" txn %}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
{{ _("Edit")|force_escape }} {{ _("Edit")|force_escape }}
</a> </a>
{% if not item.has_many_same_day %} {% if not txn.has_many_same_day %}
<button type="button" class="btn btn-secondary d-none d-sm-inline" disabled="disabled" title="{{ _("There is no other transaction at the same day.")|force_escape }}"> <button type="button" class="btn btn-secondary d-none d-sm-inline" disabled="disabled" title="{{ _("There is no other transaction at the same day.")|force_escape }}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{{ _("Sort")|force_escape }} {{ _("Sort")|force_escape }}
</button> </button>
{% else %} {% else %}
<a class="btn btn-primary d-none d-sm-inline" role="button" href="{% url_with_return "accounting:transactions.sort" item.date %}"> <a class="btn btn-primary d-none d-sm-inline" role="button" href="{% url_with_return "accounting:transactions.sort" txn.date %}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{{ _("Sort")|force_escape }} {{ _("Sort")|force_escape }}
</a> </a>
@ -91,13 +91,13 @@ First written: 2020/7/23
<i class="fas fa-bars"></i> <i class="fas fa-bars"></i>
</button> </button>
<div class="dropdown-menu"> <div class="dropdown-menu">
{% if not item.has_many_same_day %} {% if not txn.has_many_same_day %}
<span class="dropdown-item disabled" title="{{ _("There is no other transaction at the same day.")|force_escape }}"> <span class="dropdown-item disabled" title="{{ _("There is no other transaction at the same day.")|force_escape }}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{{ _("Sort")|force_escape }} {{ _("Sort")|force_escape }}
</span> </span>
{% else %} {% else %}
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.sort" item.date %}"> <a class="dropdown-item" href="{% url_with_return "accounting:transactions.sort" txn.date %}">
<i class="fas fa-sort"></i> <i class="fas fa-sort"></i>
{{ _("Sort")|force_escape }} {{ _("Sort")|force_escape }}
</a> </a>
@ -112,7 +112,7 @@ First written: 2020/7/23
<div class="row"> <div class="row">
<div class="col-sm-2">{{ _("Date:")|force_escape }}</div> <div class="col-sm-2">{{ _("Date:")|force_escape }}</div>
<div class="col-sm-10">{{ item.date|smart_date }}</div> <div class="col-sm-10">{{ txn.date|smart_date }}</div>
</div> </div>
<div class="row"> <div class="row">
@ -128,7 +128,7 @@ First written: 2020/7/23
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for x in item.debit_records %} {% for x in txn.debit_records %}
<tr> <tr>
<td>{{ x.account.title|title_case }}</td> <td>{{ x.account.title|title_case }}</td>
<td>{{ x.summary|default:"" }}</td> <td>{{ x.summary|default:"" }}</td>
@ -139,13 +139,13 @@ First written: 2020/7/23
<tfoot> <tfoot>
<tr> <tr>
<td colspan="2">{{ _("Total")|force_escape }}</td> <td colspan="2">{{ _("Total")|force_escape }}</td>
<td class="amount">{{ item.debit_total|accounting_amount }}</td> <td class="amount">{{ txn.debit_total|accounting_amount }}</td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
<ul class="list-group d-lg-none"> <ul class="list-group d-lg-none">
{% for x in item.debit_records %} {% for x in txn.debit_records %}
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center account-line"> <div class="d-flex justify-content-between align-items-center account-line">
{{ x.account.title|title_case }} {{ x.account.title|title_case }}
@ -157,7 +157,7 @@ First written: 2020/7/23
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center account-line"> <div class="d-flex justify-content-between align-items-center account-line">
{{ _("Total")|force_escape }} {{ _("Total")|force_escape }}
<span class="badge badge-info">{{ item.debit_total|accounting_amount }}</span> <span class="badge badge-info">{{ txn.debit_total|accounting_amount }}</span>
</div> </div>
</li> </li>
</ul> </ul>
@ -175,7 +175,7 @@ First written: 2020/7/23
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for x in item.credit_records %} {% for x in txn.credit_records %}
<tr> <tr>
<td>{{ x.account.title|title_case }}</td> <td>{{ x.account.title|title_case }}</td>
<td>{{ x.summary|default:"" }}</td> <td>{{ x.summary|default:"" }}</td>
@ -186,13 +186,13 @@ First written: 2020/7/23
<tfoot> <tfoot>
<tr> <tr>
<td colspan="2">{{ _("Total")|force_escape }}</td> <td colspan="2">{{ _("Total")|force_escape }}</td>
<td class="amount">{{ item.credit_total|accounting_amount }}</td> <td class="amount">{{ txn.credit_total|accounting_amount }}</td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
<ul class="list-group d-lg-none"> <ul class="list-group d-lg-none">
{% for x in item.credit_records %} {% for x in txn.credit_records %}
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center account-line"> <div class="d-flex justify-content-between align-items-center account-line">
{{ x.account.title|title_case }} {{ x.account.title|title_case }}
@ -205,38 +205,38 @@ First written: 2020/7/23
<li class="list-group-item"> <li class="list-group-item">
<div class="d-flex justify-content-between align-items-center account-line"> <div class="d-flex justify-content-between align-items-center account-line">
{{ _("Total")|force_escape }} {{ _("Total")|force_escape }}
<span class="badge badge-info">{{ item.credit_total|accounting_amount }}</span> <span class="badge badge-info">{{ txn.credit_total|accounting_amount }}</span>
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
{% if item.notes %} {% if txn.notes %}
<div class="row"> <div class="row">
<div class="col-sm-2">{{ _("Notes:")|force_escape }}</div> <div class="col-sm-2">{{ _("Notes:")|force_escape }}</div>
<div class="col-sm-10">{{ item.notes }}</div> <div class="col-sm-10">{{ txn.notes }}</div>
</div> </div>
{% endif %} {% endif %}
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2">{{ _("Created at:")|force_escape }}</div> <div class="col-sm-2">{{ _("Created at:")|force_escape }}</div>
<div class="col-sm-10">{{ item.created_at }}</div> <div class="col-sm-10">{{ txn.created_at }}</div>
</div> </div>
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2">{{ _("Created by:")|force_escape }}</div> <div class="col-sm-2">{{ _("Created by:")|force_escape }}</div>
<div class="col-sm-10">{{ item.created_by.name }}</div> <div class="col-sm-10">{{ txn.created_by.name }}</div>
</div> </div>
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2">{{ _("Updated at:")|force_escape }}</div> <div class="col-sm-2">{{ _("Updated at:")|force_escape }}</div>
<div class="col-sm-10">{{ item.updated_at }}</div> <div class="col-sm-10">{{ txn.updated_at }}</div>
</div> </div>
<div class="row form-group"> <div class="row form-group">
<div class="col-sm-2">{{ _("Updated by:")|force_escape }}</div> <div class="col-sm-2">{{ _("Updated by:")|force_escape }}</div>
<div class="col-sm-10">{{ item.updated_by.name }}</div> <div class="col-sm-10">{{ txn.updated_by.name }}</div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -813,7 +813,7 @@ def txn_show(request, txn_type, txn):
HttpResponse: The response. HttpResponse: The response.
""" """
return render(request, F"accounting/transactions/{txn_type}/view.html", { return render(request, F"accounting/transactions/{txn_type}/view.html", {
"item": txn, "txn": txn,
}) })
@ -854,7 +854,7 @@ def txn_edit(request, txn_type, txn=None):
"accounting/include/form-record-non-transfer.html", "accounting/include/form-record-non-transfer.html",
new_record_context)) new_record_context))
return render(request, F"accounting/transactions/{txn_type}/form.html", { return render(request, F"accounting/transactions/{txn_type}/form.html", {
"item": form, "txn": form,
"summary_categories": get_summary_categories, "summary_categories": get_summary_categories,
"should_validate": should_validate, "should_validate": should_validate,
"new_record_template": new_record_template, "new_record_template": new_record_template,
@ -997,7 +997,7 @@ def txn_sort(request, date):
raise Http404 raise Http404
if request.method != "POST": if request.method != "POST":
return render(request, "accounting/transactions/sort.html", { return render(request, "accounting/transactions/sort.html", {
"item_list": transactions, "txn_list": transactions,
"date": date, "date": date,
}) })
else: else: