Renamed the template variables in the accounting reports to be more meaningful in the accounting application.
This commit is contained in:
@ -80,7 +80,7 @@ First written: 2020/7/16
|
||||
{% include "mia_core/include/period-chooser.html" %}
|
||||
{% endwith %}
|
||||
|
||||
{% if item_list %}
|
||||
{% if record_list %}
|
||||
{% include "mia_core/include/pagination.html" %}
|
||||
|
||||
{# The table for large screens #}
|
||||
@ -97,33 +97,33 @@ First written: 2020/7/16
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in item_list %}
|
||||
<tr class="{% if not item.is_balanced or item.has_order_hole or item.is_payable %} table-danger {% endif %}{% if item.is_existing_equipment %} table-info {% endif %}">
|
||||
<td>{{ item.transaction.date|smart_date }}</td>
|
||||
<td>{{ item.account.title|title_case }}</td>
|
||||
<td>{{ item.summary|default:"" }}{% if not item.is_balanced %}
|
||||
{% for record in record_list %}
|
||||
<tr class="{% if not record.is_balanced or record.has_order_hole or record.is_payable %} table-danger {% endif %}{% if record.is_existing_equipment %} table-info {% endif %}">
|
||||
<td>{{ record.transaction.date|smart_date }}</td>
|
||||
<td>{{ record.account.title|title_case }}</td>
|
||||
<td>{{ record.summary|default:"" }}{% if not record.is_balanced %}
|
||||
<span class="badge badge-danger badge-pill">
|
||||
{{ _("Unbalanced")|force_escape }}
|
||||
</span>
|
||||
{% endif %}{% if item.has_order_hole %}
|
||||
{% endif %}{% if record.has_order_hole %}
|
||||
<span class="badge badge-danger badge-pill">
|
||||
{{ _("Need Reorder")|force_escape }}
|
||||
</span>
|
||||
{% endif %}{% if item.is_payable %}
|
||||
{% endif %}{% if record.is_payable %}
|
||||
<span class="badge badge-danger badge-pill">
|
||||
{{ _("Payable")|force_escape }}
|
||||
</span>
|
||||
{% endif %}{% if item.is_existing_equipment %}
|
||||
{% endif %}{% if record.is_existing_equipment %}
|
||||
<span class="badge badge-info badge-pill">
|
||||
{{ _("Existing")|force_escape }}
|
||||
</span>
|
||||
{% endif %}</td>
|
||||
<td class="amount">{{ item.debit_amount|accounting_amount }}</td>
|
||||
<td class="amount">{{ item.credit_amount|accounting_amount }}</td>
|
||||
<td class="amount {% if item.balance < 0 %} text-danger {% endif %}">{{ item.balance|accounting_amount }}</td>
|
||||
<td class="amount">{{ record.debit_amount|accounting_amount }}</td>
|
||||
<td class="amount">{{ record.credit_amount|accounting_amount }}</td>
|
||||
<td class="amount {% if record.balance < 0 %} text-danger {% endif %}">{{ record.balance|accounting_amount }}</td>
|
||||
<td class="actions">
|
||||
{% if item.pk is not None %}
|
||||
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" class="btn btn-info" role="button">
|
||||
{% if record.pk is not None %}
|
||||
<a href="{% url_with_return "accounting:transactions.show" record.transaction.type record.transaction %}" class="btn btn-info" role="button">
|
||||
<i class="fas fa-eye"></i>
|
||||
<span class="d-none d-lg-inline">{{ _("View")|force_escape }}</span>
|
||||
</a>
|
||||
@ -136,75 +136,75 @@ First written: 2020/7/16
|
||||
|
||||
{# The list for small screens #}
|
||||
<ul class="list-group d-md-none">
|
||||
{% for item in item_list %}
|
||||
<li class="list-group-item {% if not item.is_balanced or item.has_order_hole or item.is_payable %} list-group-item-danger {% endif %}{% if item.is_existing_equipment %} list-group-item-info {% endif %}">
|
||||
{% if item.pk is not None %}
|
||||
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}">
|
||||
{% for record in record_list %}
|
||||
<li class="list-group-item {% if not record.is_balanced or record.has_order_hole or record.is_payable %} list-group-item-danger {% endif %}{% if record.is_existing_equipment %} list-group-item-info {% endif %}">
|
||||
{% if record.pk is not None %}
|
||||
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" record.transaction.type record.transaction %}">
|
||||
<div class="date-account-line">
|
||||
{{ item.transaction.date|smart_date }} {{ item.account.title|title_case }}
|
||||
{{ record.transaction.date|smart_date }} {{ record.account.title|title_case }}
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
{{ item.summary|default:"" }}
|
||||
{% if not item.is_balanced %}
|
||||
{{ record.summary|default:"" }}
|
||||
{% if not record.is_balanced %}
|
||||
<span class="badge badge-danger badge-pill">
|
||||
{{ _("Unbalanced")|force_escape }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if item.has_order_hole %}
|
||||
{% if record.has_order_hole %}
|
||||
<span class="badge badge-danger badge-pill">
|
||||
{{ _("Need Reorder")|force_escape }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if item.is_payable %}
|
||||
{% if record.is_payable %}
|
||||
<span class="badge badge-danger badge-pill">
|
||||
{{ _("Payable")|force_escape }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if item.is_existing_equipment %}
|
||||
{% if record.is_existing_equipment %}
|
||||
<span class="badge badge-info badge-pill">
|
||||
{{ _("Existing")|force_escape }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
{% if item.debit_amount is not None %}
|
||||
{% if record.debit_amount is not None %}
|
||||
<span class="badge badge-success badge-pill">
|
||||
{{ item.debit_amount|intcomma:False }}
|
||||
{{ record.debit_amount|intcomma:False }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if item.credit_amount is not None %}
|
||||
{% if record.credit_amount is not None %}
|
||||
<span class="badge badge-warning badge-pill">
|
||||
{{ item.credit_amount|intcomma:False }}
|
||||
{{ record.credit_amount|intcomma:False }}
|
||||
</span>
|
||||
{% endif %}
|
||||
<span class="badge {% if item.balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
||||
{{ item.balance|intcomma:False }}
|
||||
<span class="badge {% if record.balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
||||
{{ record.balance|intcomma:False }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{% else %}
|
||||
<div class="date-account-line">
|
||||
{{ item.transaction.date|smart_date }} {{ item.account.title|title_case }}
|
||||
{{ record.transaction.date|smart_date }} {{ record.account.title|title_case }}
|
||||
</div>
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
{{ item.summary|default:"" }}
|
||||
{{ record.summary|default:"" }}
|
||||
</div>
|
||||
<div>
|
||||
{% if item.debit_amount is not None %}
|
||||
{% if record.debit_amount is not None %}
|
||||
<span class="badge badge-success badge-pill">
|
||||
{{ item.debit_amount|intcomma:False }}
|
||||
{{ record.debit_amount|intcomma:False }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% if item.credit_amount is not None %}
|
||||
{% if record.credit_amount is not None %}
|
||||
<span class="badge badge-warning badge-pill">
|
||||
{{ item.credit_amount|intcomma:False }}
|
||||
{{ record.credit_amount|intcomma:False }}
|
||||
</span>
|
||||
{% endif %}
|
||||
<span class="badge {% if item.balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
||||
{{ item.balance|intcomma:False }}
|
||||
<span class="badge {% if record.balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
||||
{{ record.balance|intcomma:False }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user