Renamed the template variables in the accounting reports to be more meaningful in the accounting application.
This commit is contained in:
parent
c7e1fd323d
commit
fe1e4a40be
@ -88,12 +88,12 @@ First written: 2020/7/20
|
|||||||
<td class="amount"></td>
|
<td class="amount"></td>
|
||||||
<td class="actions"></td>
|
<td class="actions"></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% for item in group.details %}
|
{% for account in group.details %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><div class="account">{{ item.title|title_case }}</div></td>
|
<td><div class="account">{{ account.title|title_case }}</div></td>
|
||||||
<td class="amount {% if item.amount < 0 %} text-danger {% endif %}">{{ item.amount|accounting_amount }}</td>
|
<td class="amount {% if account.amount < 0 %} text-danger {% endif %}">{{ account.amount|accounting_amount }}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<a href="{{ item.url }}" class="btn btn-info" role="button">
|
<a href="{{ account.url }}" class="btn btn-info" role="button">
|
||||||
<i class="fas fa-eye"></i>
|
<i class="fas fa-eye"></i>
|
||||||
{{ _("View")|force_escape }}
|
{{ _("View")|force_escape }}
|
||||||
</a>
|
</a>
|
||||||
@ -119,12 +119,12 @@ First written: 2020/7/20
|
|||||||
<td class="amount"></td>
|
<td class="amount"></td>
|
||||||
<td class="actions"></td>
|
<td class="actions"></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% for item in group.details %}
|
{% for account in group.details %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><div class="account">{{ item.title|title_case }}</div></td>
|
<td><div class="account">{{ account.title|title_case }}</div></td>
|
||||||
<td class="amount {% if item.amount < 0 %} text-danger {% endif %}">{{ item.amount|accounting_amount }}</td>
|
<td class="amount {% if account.amount < 0 %} text-danger {% endif %}">{{ account.amount|accounting_amount }}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<a href="{{ item.url }}" class="btn btn-info" role="button">
|
<a href="{{ account.url }}" class="btn btn-info" role="button">
|
||||||
<i class="fas fa-eye"></i>
|
<i class="fas fa-eye"></i>
|
||||||
{{ _("View")|force_escape }}
|
{{ _("View")|force_escape }}
|
||||||
</a>
|
</a>
|
||||||
@ -156,12 +156,12 @@ First written: 2020/7/20
|
|||||||
<td class="amount"></td>
|
<td class="amount"></td>
|
||||||
<td class="actions"></td>
|
<td class="actions"></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% for item in group.details %}
|
{% for account in group.details %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><div class="account">{{ item.title|title_case }}</div></td>
|
<td><div class="account">{{ account.title|title_case }}</div></td>
|
||||||
<td class="amount {% if item.amount < 0 %} text-danger {% endif %}">{{ item.amount|accounting_amount }}</td>
|
<td class="amount {% if account.amount < 0 %} text-danger {% endif %}">{{ account.amount|accounting_amount }}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<a href="{{ item.url }}" class="btn btn-info" role="button">
|
<a href="{{ account.url }}" class="btn btn-info" role="button">
|
||||||
<i class="fas fa-eye"></i>
|
<i class="fas fa-eye"></i>
|
||||||
{{ _("View")|force_escape }}
|
{{ _("View")|force_escape }}
|
||||||
</a>
|
</a>
|
||||||
@ -227,13 +227,13 @@ First written: 2020/7/20
|
|||||||
<li class="list-group-item d-flex justify-content-between align-items-center group-title">
|
<li class="list-group-item d-flex justify-content-between align-items-center group-title">
|
||||||
{{ group.title|title_case }}
|
{{ group.title|title_case }}
|
||||||
</li>
|
</li>
|
||||||
{% for item in group.details %}
|
{% for account in group.details %}
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center account">
|
<li class="list-group-item d-flex justify-content-between align-items-center account">
|
||||||
<a class="list-group-item-action" href="{{ item.url }}">
|
<a class="list-group-item-action" href="{{ account.url }}">
|
||||||
{{ item.title|title_case }}
|
{{ account.title|title_case }}
|
||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<span class="badge {% if item.amount < 0 %} badge-warning {% else %} badge-secondary {% endif %} badge-pill">
|
<span class="badge {% if account.amount < 0 %} badge-warning {% else %} badge-secondary {% endif %} badge-pill">
|
||||||
{{ item.amount|accounting_amount }}
|
{{ account.amount|accounting_amount }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
@ -258,13 +258,13 @@ First written: 2020/7/20
|
|||||||
<li class="list-group-item d-flex justify-content-between align-items-center group-title">
|
<li class="list-group-item d-flex justify-content-between align-items-center group-title">
|
||||||
{{ group.title|title_case }}
|
{{ group.title|title_case }}
|
||||||
</li>
|
</li>
|
||||||
{% for item in group.details %}
|
{% for account in group.details %}
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center account">
|
<li class="list-group-item d-flex justify-content-between align-items-center account">
|
||||||
<a class="list-group-item-action" href="{{ item.url }}">
|
<a class="list-group-item-action" href="{{ account.url }}">
|
||||||
{{ item.title|title_case }}
|
{{ account.title|title_case }}
|
||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<span class="badge {% if item.amount < 0 %} badge-warning {% else %} badge-secondary {% endif %} badge-pill">
|
<span class="badge {% if account.amount < 0 %} badge-warning {% else %} badge-secondary {% endif %} badge-pill">
|
||||||
{{ item.amount|accounting_amount }}
|
{{ account.amount|accounting_amount }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
@ -287,13 +287,13 @@ First written: 2020/7/20
|
|||||||
<li class="list-group-item d-flex justify-content-between align-items-center group-title">
|
<li class="list-group-item d-flex justify-content-between align-items-center group-title">
|
||||||
{{ group.title|title_case }}
|
{{ group.title|title_case }}
|
||||||
</li>
|
</li>
|
||||||
{% for item in group.details %}
|
{% for account in group.details %}
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center account">
|
<li class="list-group-item d-flex justify-content-between align-items-center account">
|
||||||
<a class="list-group-item-action" href="{{ item.url }}">
|
<a class="list-group-item-action" href="{{ account.url }}">
|
||||||
{{ item.title|title_case }}
|
{{ account.title|title_case }}
|
||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<span class="badge {% if item.amount < 0 %} badge-warning {% else %} badge-secondary {% endif %} badge-pill">
|
<span class="badge {% if account.amount < 0 %} badge-warning {% else %} badge-secondary {% endif %} badge-pill">
|
||||||
{{ item.amount|accounting_amount }}
|
{{ account.amount|accounting_amount }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
@ -77,7 +77,7 @@ First written: 2020/7/15
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if item_list %}
|
{% if month_list %}
|
||||||
{% include "mia_core/include/pagination.html" %}
|
{% include "mia_core/include/pagination.html" %}
|
||||||
|
|
||||||
{# The table for large screens #}
|
{# The table for large screens #}
|
||||||
@ -93,16 +93,16 @@ First written: 2020/7/15
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for item in item_list %}
|
{% for month in month_list %}
|
||||||
<tr class="{% if item.balance < 0 %} table-danger {% endif %}">
|
<tr class="{% if month.balance < 0 %} table-danger {% endif %}">
|
||||||
<td>{{ item.label }}</td>
|
<td>{{ month.label }}</td>
|
||||||
<td class="amount">{{ item.credit|accounting_amount }}</td>
|
<td class="amount">{{ month.credit|accounting_amount }}</td>
|
||||||
<td class="amount">{{ item.debit|accounting_amount }}</td>
|
<td class="amount">{{ month.debit|accounting_amount }}</td>
|
||||||
<td class="amount {% if item.balance < 0 %} text-danger {% endif %}">{{ item.balance|accounting_amount }}</td>
|
<td class="amount {% if month.balance < 0 %} text-danger {% endif %}">{{ month.balance|accounting_amount }}</td>
|
||||||
<td class="amount {% if item.cumulative_balance < 0 %} text-danger {% endif %}">{{ item.cumulative_balance|accounting_amount }}</td>
|
<td class="amount {% if month.cumulative_balance < 0 %} text-danger {% endif %}">{{ month.cumulative_balance|accounting_amount }}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{% if item.month is not None %}
|
{% if month.month is not None %}
|
||||||
<a class="btn btn-info" role="button" href="{% url "accounting:cash" request.resolver_match.kwargs.account item.month|date:"Y-m" %}">
|
<a class="btn btn-info" role="button" href="{% url "accounting:cash" request.resolver_match.kwargs.account month.month|date:"Y-m" %}">
|
||||||
<i class="fas fa-eye"></i>
|
<i class="fas fa-eye"></i>
|
||||||
<span class="d-none d-lg-inline">{{ _("View")|force_escape }}</span>
|
<span class="d-none d-lg-inline">{{ _("View")|force_escape }}</span>
|
||||||
</a>
|
</a>
|
||||||
@ -115,41 +115,41 @@ First written: 2020/7/15
|
|||||||
|
|
||||||
{# The list for small screens #}
|
{# The list for small screens #}
|
||||||
<ul class="list-group d-sm-none">
|
<ul class="list-group d-sm-none">
|
||||||
{% for item in item_list %}
|
{% for month in month_list %}
|
||||||
<li class="list-group-item {% if item.balance < 0 %} list-group-item-danger {% endif %}">
|
<li class="list-group-item {% if month.balance < 0 %} list-group-item-danger {% endif %}">
|
||||||
{% if item.month is not None %}
|
{% if month.month is not None %}
|
||||||
<a class="list-group-item-action d-flex justify-content-between align-items-center" href="{% url "accounting:cash" request.resolver_match.kwargs.account item.month|date:"Y-m" %}">
|
<a class="list-group-item-action d-flex justify-content-between align-items-center" href="{% url "accounting:cash" request.resolver_match.kwargs.account month.month|date:"Y-m" %}">
|
||||||
{{ item.label }}
|
{{ month.label }}
|
||||||
<div>
|
<div>
|
||||||
<span class="badge badge-success badge-pill">
|
<span class="badge badge-success badge-pill">
|
||||||
{{ item.credit|accounting_amount }}
|
{{ month.credit|accounting_amount }}
|
||||||
</span>
|
</span>
|
||||||
<span class="badge badge-warning badge-pill">
|
<span class="badge badge-warning badge-pill">
|
||||||
{{ item.debit|accounting_amount }}
|
{{ month.debit|accounting_amount }}
|
||||||
</span>
|
</span>
|
||||||
<span class="badge {% if item.balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
<span class="badge {% if month.balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
||||||
{{ item.balance|intcomma:False }}
|
{{ month.balance|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
<span class="badge {% if item.cumulative_balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
<span class="badge {% if month.cumulative_balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
||||||
{{ item.cumulative_balance|intcomma:False }}
|
{{ month.cumulative_balance|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
{{ item.label }}
|
{{ month.label }}
|
||||||
<div>
|
<div>
|
||||||
<span class="badge badge-success badge-pill">
|
<span class="badge badge-success badge-pill">
|
||||||
{{ item.credit|accounting_amount }}
|
{{ month.credit|accounting_amount }}
|
||||||
</span>
|
</span>
|
||||||
<span class="badge badge-warning badge-pill">
|
<span class="badge badge-warning badge-pill">
|
||||||
{{ item.debit|accounting_amount }}
|
{{ month.debit|accounting_amount }}
|
||||||
</span>
|
</span>
|
||||||
<span class="badge {% if item.balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
<span class="badge {% if month.balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
||||||
{{ item.balance|intcomma:False }}
|
{{ month.balance|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
<span class="badge {% if item.cumulative_balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
<span class="badge {% if month.cumulative_balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
||||||
{{ item.cumulative_balance|intcomma:False }}
|
{{ month.cumulative_balance|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -87,7 +87,7 @@ First written: 2020/7/1
|
|||||||
{% include "mia_core/include/period-chooser.html" %}
|
{% include "mia_core/include/period-chooser.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
{% if item_list %}
|
{% if record_list %}
|
||||||
{% include "mia_core/include/pagination.html" %}
|
{% include "mia_core/include/pagination.html" %}
|
||||||
|
|
||||||
{# The table for large screens #}
|
{# The table for large screens #}
|
||||||
@ -104,25 +104,25 @@ First written: 2020/7/1
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for item in item_list %}
|
{% for record in record_list %}
|
||||||
<tr class="{% if not item.is_balanced or item.has_order_hole %} table-danger {% endif %}">
|
<tr class="{% if not record.is_balanced or record.has_order_hole %} table-danger {% endif %}">
|
||||||
<td>{{ item.transaction.date|smart_date }}</td>
|
<td>{{ record.transaction.date|smart_date }}</td>
|
||||||
<td>{{ item.account.title|title_case }}</td>
|
<td>{{ record.account.title|title_case }}</td>
|
||||||
<td>{{ item.summary|default:"" }}{% if not item.is_balanced %}
|
<td>{{ record.summary|default:"" }}{% if not record.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 %}{% if item.has_order_hole %}
|
{% endif %}{% if record.has_order_hole %}
|
||||||
<span class="badge badge-danger badge-pill">
|
<span class="badge badge-danger badge-pill">
|
||||||
{{ _("Need Reorder")|force_escape }}
|
{{ _("Need Reorder")|force_escape }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}</td>
|
{% endif %}</td>
|
||||||
<td class="amount">{{ item.credit_amount|accounting_amount }}</td>
|
<td class="amount">{{ record.credit_amount|accounting_amount }}</td>
|
||||||
<td class="amount">{{ item.debit_amount|accounting_amount }}</td>
|
<td class="amount">{{ record.debit_amount|accounting_amount }}</td>
|
||||||
<td class="amount {% if item.balance < 0 %} text-danger {% endif %}">{{ item.balance|accounting_amount }}</td>
|
<td class="amount {% if record.balance < 0 %} text-danger {% endif %}">{{ record.balance|accounting_amount }}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{% if item.pk is not None %}
|
{% if record.pk is not None %}
|
||||||
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" class="btn btn-info" role="button">
|
<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>
|
<i class="fas fa-eye"></i>
|
||||||
<span class="d-none d-lg-inline">{{ _("View")|force_escape }}</span>
|
<span class="d-none d-lg-inline">{{ _("View")|force_escape }}</span>
|
||||||
</a>
|
</a>
|
||||||
@ -135,22 +135,22 @@ First written: 2020/7/1
|
|||||||
|
|
||||||
{# The list for small screens #}
|
{# The list for small screens #}
|
||||||
<ul class="list-group d-md-none">
|
<ul class="list-group d-md-none">
|
||||||
{% for item in item_list %}
|
{% for record in record_list %}
|
||||||
<li class="list-group-item {% if not item.is_balanced or item.has_order_hole %} list-group-item-danger {% endif %}">
|
<li class="list-group-item {% if not record.is_balanced or record.has_order_hole %} list-group-item-danger {% endif %}">
|
||||||
{% if item.pk is not None %}
|
{% if record.pk is not None %}
|
||||||
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}">
|
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" record.transaction.type record.transaction %}">
|
||||||
<div class="date-account-line d-flex justify-content-between align-items-center">
|
<div class="date-account-line d-flex justify-content-between align-items-center">
|
||||||
{{ item.transaction.date|smart_date }} {{ item.account.title|title_case }}
|
{{ record.transaction.date|smart_date }} {{ record.account.title|title_case }}
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div>
|
<div>
|
||||||
{{ item.summary|default:"" }}
|
{{ record.summary|default:"" }}
|
||||||
{% if not item.is_balanced %}
|
{% if not record.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 %}
|
||||||
{% if item.has_order_hole %}
|
{% if record.has_order_hole %}
|
||||||
<span class="badge badge-danger badge-pill">
|
<span class="badge badge-danger badge-pill">
|
||||||
{{ _("Need Reorder")|force_escape }}
|
{{ _("Need Reorder")|force_escape }}
|
||||||
</span>
|
</span>
|
||||||
@ -158,41 +158,41 @@ First written: 2020/7/1
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{% if item.credit_amount is not None %}
|
{% if record.credit_amount is not None %}
|
||||||
<span class="badge badge-success badge-pill">
|
<span class="badge badge-success badge-pill">
|
||||||
{{ item.credit_amount|intcomma:False }}
|
{{ record.credit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.debit_amount is not None %}
|
{% if record.debit_amount is not None %}
|
||||||
<span class="badge badge-warning badge-pill">
|
<span class="badge badge-warning badge-pill">
|
||||||
-{{ item.debit_amount|intcomma:False }}
|
-{{ record.debit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span class="badge {% if item.balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
<span class="badge {% if record.balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
||||||
{{ item.balance|intcomma:False }}
|
{{ record.balance|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="date-account-line d-flex justify-content-between align-items-center">
|
<div class="date-account-line d-flex justify-content-between align-items-center">
|
||||||
{{ item.transaction.date|smart_date }} {{ item.account.title }}
|
{{ record.transaction.date|smart_date }} {{ record.account.title }}
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div>{{ item.summary|default:"" }}</div>
|
<div>{{ record.summary|default:"" }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{% if item.credit_amount is not None %}
|
{% if record.credit_amount is not None %}
|
||||||
<span class="badge badge-success badge-pill">
|
<span class="badge badge-success badge-pill">
|
||||||
{{ item.credit_amount|intcomma:False }}
|
{{ record.credit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.debit_amount is not None %}
|
{% if record.debit_amount is not None %}
|
||||||
<span class="badge badge-warning badge-pill">
|
<span class="badge badge-warning badge-pill">
|
||||||
-{{ item.debit_amount|intcomma:False }}
|
-{{ record.debit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span class="badge {% if item.balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
<span class="badge {% if record.balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
||||||
{{ item.balance|intcomma:False }}
|
{{ record.balance|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -84,7 +84,7 @@ First written: 2020/7/19
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for section in item_list %}
|
{% for section in section_list %}
|
||||||
<tr class="section-title">
|
<tr class="section-title">
|
||||||
<td><div>{{ section.title|title_case }}</div></td>
|
<td><div>{{ section.title|title_case }}</div></td>
|
||||||
<td class="amount"></td>
|
<td class="amount"></td>
|
||||||
@ -99,13 +99,13 @@ First written: 2020/7/19
|
|||||||
<td class="amount"></td>
|
<td class="amount"></td>
|
||||||
<td class="actions"></td>
|
<td class="actions"></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% for item in group.details %}
|
{% for account in group.details %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><div class="account">{{ item.title|title_case }}</div></td>
|
<td><div class="account">{{ account.title|title_case }}</div></td>
|
||||||
<td class="amount {% if item.amount < 0 %} text-danger {% endif %}">{{ item.amount|accounting_amount }}</td>
|
<td class="amount {% if account.amount < 0 %} text-danger {% endif %}">{{ account.amount|accounting_amount }}</td>
|
||||||
<td class="amount"></td>
|
<td class="amount"></td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<a href="{% url "accounting:ledger" item request.resolver_match.kwargs.period %}" class="btn btn-info" role="button">
|
<a href="{% url "accounting:ledger" account request.resolver_match.kwargs.period %}" class="btn btn-info" role="button">
|
||||||
<i class="fas fa-eye"></i>
|
<i class="fas fa-eye"></i>
|
||||||
<span class="d-none d-lg-inline">{{ _("View")|force_escape }}</span>
|
<span class="d-none d-lg-inline">{{ _("View")|force_escape }}</span>
|
||||||
</a>
|
</a>
|
||||||
@ -154,7 +154,7 @@ First written: 2020/7/19
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<ul class="list-group income-statement-list">
|
<ul class="list-group income-statement-list">
|
||||||
{% for section in item_list %}
|
{% for section in section_list %}
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center section-title">
|
<li class="list-group-item d-flex justify-content-between align-items-center section-title">
|
||||||
{{ section.title|title_case }}
|
{{ section.title|title_case }}
|
||||||
</li>
|
</li>
|
||||||
@ -163,13 +163,13 @@ First written: 2020/7/19
|
|||||||
<li class="list-group-item d-flex justify-content-between align-items-center group-title">
|
<li class="list-group-item d-flex justify-content-between align-items-center group-title">
|
||||||
{{ group.title|title_case }}
|
{{ group.title|title_case }}
|
||||||
</li>
|
</li>
|
||||||
{% for item in group.details %}
|
{% for account in group.details %}
|
||||||
<li class="list-group-item d-flex justify-content-between align-items-center account">
|
<li class="list-group-item d-flex justify-content-between align-items-center account">
|
||||||
<a class="list-group-item-action" href="{% url "accounting:ledger" item request.resolver_match.kwargs.period %}">
|
<a class="list-group-item-action" href="{% url "accounting:ledger" account request.resolver_match.kwargs.period %}">
|
||||||
{{ item.title|title_case }}
|
{{ account.title|title_case }}
|
||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<span class="badge {% if item.amount < 0 %} badge-warning {% else %} badge-secondary {% endif %} badge-pill">
|
<span class="badge {% if account.amount < 0 %} badge-warning {% else %} badge-secondary {% endif %} badge-pill">
|
||||||
{{ item.amount|accounting_amount }}
|
{{ account.amount|accounting_amount }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
@ -67,7 +67,7 @@ First written: 2020/7/17
|
|||||||
{% include "mia_core/include/period-chooser.html" %}
|
{% include "mia_core/include/period-chooser.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
{% if item_list %}
|
{% if record_list %}
|
||||||
{% include "mia_core/include/pagination.html" %}
|
{% include "mia_core/include/pagination.html" %}
|
||||||
|
|
||||||
{# The table for large screens #}
|
{# The table for large screens #}
|
||||||
@ -84,25 +84,25 @@ First written: 2020/7/17
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for item in item_list %}
|
{% for record in record_list %}
|
||||||
<tr class="{% if not item.is_balanced or item.has_order_hole %} table-danger {% endif %}">
|
<tr class="{% if not record.is_balanced or record.has_order_hole %} table-danger {% endif %}">
|
||||||
<td>{{ item.transaction.date|smart_date }}</td>
|
<td>{{ record.transaction.date|smart_date }}</td>
|
||||||
<td>{{ item.account.title|title_case }}</td>
|
<td>{{ record.account.title|title_case }}</td>
|
||||||
<td><div class="{% if item.is_credit %} journal-credit {% else %} journal-debit {% endif %}">{{ item.summary|default:"" }}{% if not item.is_balanced %}
|
<td><div class="{% if record.is_credit %} journal-credit {% else %} journal-debit {% endif %}">{{ record.summary|default:"" }}{% if not record.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 %}{% if item.has_order_hole %}
|
{% endif %}{% if record.has_order_hole %}
|
||||||
<span class="badge badge-danger badge-pill">
|
<span class="badge badge-danger badge-pill">
|
||||||
{{ _("Need Reorder")|force_escape }}
|
{{ _("Need Reorder")|force_escape }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}</div></td>
|
{% endif %}</div></td>
|
||||||
<td class="amount">{{ item.debit_amount|accounting_amount }}</td>
|
<td class="amount">{{ record.debit_amount|accounting_amount }}</td>
|
||||||
<td class="amount">{{ item.credit_amount|accounting_amount }}</td>
|
<td class="amount">{{ record.credit_amount|accounting_amount }}</td>
|
||||||
<td>{{ item.transaction.note|default:"" }}</td>
|
<td>{{ record.transaction.note|default:"" }}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{% if item.pk is not None %}
|
{% if record.pk is not None %}
|
||||||
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" class="btn btn-info" role="button">
|
<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>
|
<i class="fas fa-eye"></i>
|
||||||
{{ _("View")|force_escape }}
|
{{ _("View")|force_escape }}
|
||||||
</a>
|
</a>
|
||||||
@ -115,72 +115,72 @@ First written: 2020/7/17
|
|||||||
|
|
||||||
{# The list for small screens #}
|
{# The list for small screens #}
|
||||||
<ul class="list-group d-lg-none">
|
<ul class="list-group d-lg-none">
|
||||||
{% for item in item_list %}
|
{% for record in record_list %}
|
||||||
<li class="list-group-item {% if not item.is_balanced or item.has_order_hole %} list-group-item-danger {% endif %}">
|
<li class="list-group-item {% if not record.is_balanced or record.has_order_hole %} list-group-item-danger {% endif %}">
|
||||||
{% if item.pk is not None %}
|
{% if record.pk is not None %}
|
||||||
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}">
|
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" record.transaction.type record.transaction %}">
|
||||||
<div class="{% if item.is_credit %} journal-credit {% else %} journal-debit {% endif %}">
|
<div class="{% if record.is_credit %} journal-credit {% else %} journal-debit {% endif %}">
|
||||||
<div class="date-account-line">
|
<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>
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div>
|
<div>
|
||||||
{{ item.summary|default:"" }}
|
{{ record.summary|default:"" }}
|
||||||
{% if not item.is_balanced %}
|
{% if not record.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 %}
|
||||||
{% if item.has_order_hole %}
|
{% if record.has_order_hole %}
|
||||||
<span class="badge badge-danger badge-pill">
|
<span class="badge badge-danger badge-pill">
|
||||||
{{ _("Need Reorder")|force_escape }}
|
{{ _("Need Reorder")|force_escape }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{% if item.debit_amount is not None %}
|
{% if record.debit_amount is not None %}
|
||||||
<span class="badge badge-success badge-pill">
|
<span class="badge badge-success badge-pill">
|
||||||
{{ item.debit_amount|intcomma:False }}
|
{{ record.debit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.credit_amount is not None %}
|
{% if record.credit_amount is not None %}
|
||||||
<span class="badge badge-warning badge-pill">
|
<span class="badge badge-warning badge-pill">
|
||||||
{{ item.credit_amount|intcomma:False }}
|
{{ record.credit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>{{ item.transaction.note|default:"" }}</div>
|
<div>{{ record.transaction.note|default:"" }}</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="{% if item.is_credit %} journal-credit {% else %} journal-debit {% endif %}">
|
<div class="{% if record.is_credit %} journal-credit {% else %} journal-debit {% endif %}">
|
||||||
<div class="date-account-line">
|
<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>
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div>
|
<div>
|
||||||
{{ item.summary|default:"" }}
|
{{ record.summary|default:"" }}
|
||||||
{% if not item.is_balanced %}
|
{% if not record.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 %}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{% if item.debit_amount is not None %}
|
{% if record.debit_amount is not None %}
|
||||||
<span class="badge badge-success badge-pill">
|
<span class="badge badge-success badge-pill">
|
||||||
{{ item.debit_amount|intcomma:False }}
|
{{ record.debit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.credit_amount is not None %}
|
{% if record.credit_amount is not None %}
|
||||||
<span class="badge badge-warning badge-pill">
|
<span class="badge badge-warning badge-pill">
|
||||||
{{ item.credit_amount|intcomma:False }}
|
{{ record.credit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>{{ item.transaction.note|default:"" }}</div>
|
<div>{{ record.transaction.note|default:"" }}</div>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
|
@ -70,7 +70,7 @@ First written: 2020/7/16
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if item_list %}
|
{% if month_list %}
|
||||||
{% include "mia_core/include/pagination.html" %}
|
{% include "mia_core/include/pagination.html" %}
|
||||||
|
|
||||||
{# The table for large screens #}
|
{# The table for large screens #}
|
||||||
@ -86,16 +86,16 @@ First written: 2020/7/16
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for item in item_list %}
|
{% for month in month_list %}
|
||||||
<tr class="{% if request.resolver_match.kwargs.account.code|first in "12" and item.balance < 0 %} table-danger {% endif %}">
|
<tr class="{% if request.resolver_match.kwargs.account.code|first in "12" and month.balance < 0 %} table-danger {% endif %}">
|
||||||
<td>{{ item.label }}</td>
|
<td>{{ month.label }}</td>
|
||||||
<td class="amount">{{ item.debit|accounting_amount }}</td>
|
<td class="amount">{{ month.debit|accounting_amount }}</td>
|
||||||
<td class="amount">{{ item.credit|accounting_amount }}</td>
|
<td class="amount">{{ month.credit|accounting_amount }}</td>
|
||||||
<td class="amount {% if item.balance < 0 %} text-danger {% endif %}">{{ item.balance|accounting_amount }}</td>
|
<td class="amount {% if month.balance < 0 %} text-danger {% endif %}">{{ month.balance|accounting_amount }}</td>
|
||||||
<td class="amount {% if item.cumulative_balance < 0 %} text-danger {% endif %}">{{ item.cumulative_balance|accounting_amount }}</td>
|
<td class="amount {% if month.cumulative_balance < 0 %} text-danger {% endif %}">{{ month.cumulative_balance|accounting_amount }}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{% if item.month is not None %}
|
{% if month.month is not None %}
|
||||||
<a class="btn btn-info" role="button" href="{% url "accounting:ledger" request.resolver_match.kwargs.account item.month|date:"Y-m" %}">
|
<a class="btn btn-info" role="button" href="{% url "accounting:ledger" request.resolver_match.kwargs.account month.month|date:"Y-m" %}">
|
||||||
<i class="fas fa-eye"></i>
|
<i class="fas fa-eye"></i>
|
||||||
<span class="d-none d-lg-inline">{{ _("View")|force_escape }}</span>
|
<span class="d-none d-lg-inline">{{ _("View")|force_escape }}</span>
|
||||||
</a>
|
</a>
|
||||||
@ -108,47 +108,47 @@ First written: 2020/7/16
|
|||||||
|
|
||||||
{# The list for small screens #}
|
{# The list for small screens #}
|
||||||
<ul class="list-group d-sm-none">
|
<ul class="list-group d-sm-none">
|
||||||
{% for item in item_list %}
|
{% for month in month_list %}
|
||||||
<li class="list-group-item {% if request.resolver_match.kwargs.account.code|first in "12" and item.balance < 0 %} list-group-item-danger {% endif %}">
|
<li class="list-group-item {% if request.resolver_match.kwargs.account.code|first in "12" and month.balance < 0 %} list-group-item-danger {% endif %}">
|
||||||
{% if item.month is not None %}
|
{% if month.month is not None %}
|
||||||
<a class="list-group-item-action d-flex justify-content-between align-items-center" href="{% url "accounting:ledger" request.resolver_match.kwargs.account item.month|date:"Y-m" %}">
|
<a class="list-group-item-action d-flex justify-content-between align-items-center" href="{% url "accounting:ledger" request.resolver_match.kwargs.account month.month|date:"Y-m" %}">
|
||||||
{{ item.label }}
|
{{ month.label }}
|
||||||
<div>
|
<div>
|
||||||
<span class="badge badge-success badge-pill">
|
<span class="badge badge-success badge-pill">
|
||||||
{{ item.debit|accounting_amount }}
|
{{ month.debit|accounting_amount }}
|
||||||
</span>
|
</span>
|
||||||
<span class="badge badge-warning badge-pill">
|
<span class="badge badge-warning badge-pill">
|
||||||
{{ item.credit|accounting_amount }}
|
{{ month.credit|accounting_amount }}
|
||||||
</span>
|
</span>
|
||||||
<span class="badge {% if item.balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
<span class="badge {% if month.balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
||||||
{{ item.balance|intcomma:False }}
|
{{ month.balance|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
<span class="badge {% if item.cumulative_balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
<span class="badge {% if month.cumulative_balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
||||||
{{ item.cumulative_balance|intcomma:False }}
|
{{ month.cumulative_balance|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
<span class="badge {% if item.balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
<span class="badge {% if month.balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
||||||
{{ item.balance|intcomma:False }}
|
{{ month.balance|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
<span class="badge {% if item.cumulative_balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
<span class="badge {% if month.cumulative_balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
||||||
{{ item.cumulative_balance|intcomma:False }}
|
{{ month.cumulative_balance|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
{{ item.label }}
|
{{ month.label }}
|
||||||
<div>
|
<div>
|
||||||
<span class="badge badge-success badge-pill">
|
<span class="badge badge-success badge-pill">
|
||||||
{{ item.debit|accounting_amount }}
|
{{ month.debit|accounting_amount }}
|
||||||
</span>
|
</span>
|
||||||
<span class="badge badge-warning badge-pill">
|
<span class="badge badge-warning badge-pill">
|
||||||
{{ item.credit|accounting_amount }}
|
{{ month.credit|accounting_amount }}
|
||||||
</span>
|
</span>
|
||||||
<span class="badge {% if item.balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
<span class="badge {% if month.balance < 0 %} badge-danger {% else %} badge-info {% endif %} badge-pill">
|
||||||
{{ item.balance|intcomma:False }}
|
{{ month.balance|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
<span class="badge {% if item.cumulative_balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
<span class="badge {% if month.cumulative_balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
||||||
{{ item.cumulative_balance|intcomma:False }}
|
{{ month.cumulative_balance|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -80,7 +80,7 @@ First written: 2020/7/16
|
|||||||
{% include "mia_core/include/period-chooser.html" %}
|
{% include "mia_core/include/period-chooser.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
{% if item_list %}
|
{% if record_list %}
|
||||||
{% include "mia_core/include/pagination.html" %}
|
{% include "mia_core/include/pagination.html" %}
|
||||||
|
|
||||||
{# The table for large screens #}
|
{# The table for large screens #}
|
||||||
@ -97,33 +97,33 @@ First written: 2020/7/16
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for item in item_list %}
|
{% for record in record_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 %}">
|
<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>{{ item.transaction.date|smart_date }}</td>
|
<td>{{ record.transaction.date|smart_date }}</td>
|
||||||
<td>{{ item.account.title|title_case }}</td>
|
<td>{{ record.account.title|title_case }}</td>
|
||||||
<td>{{ item.summary|default:"" }}{% if not item.is_balanced %}
|
<td>{{ record.summary|default:"" }}{% if not record.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 %}{% if item.has_order_hole %}
|
{% endif %}{% if record.has_order_hole %}
|
||||||
<span class="badge badge-danger badge-pill">
|
<span class="badge badge-danger badge-pill">
|
||||||
{{ _("Need Reorder")|force_escape }}
|
{{ _("Need Reorder")|force_escape }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}{% if item.is_payable %}
|
{% endif %}{% if record.is_payable %}
|
||||||
<span class="badge badge-danger badge-pill">
|
<span class="badge badge-danger badge-pill">
|
||||||
{{ _("Payable")|force_escape }}
|
{{ _("Payable")|force_escape }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}{% if item.is_existing_equipment %}
|
{% endif %}{% if record.is_existing_equipment %}
|
||||||
<span class="badge badge-info badge-pill">
|
<span class="badge badge-info badge-pill">
|
||||||
{{ _("Existing")|force_escape }}
|
{{ _("Existing")|force_escape }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}</td>
|
{% endif %}</td>
|
||||||
<td class="amount">{{ item.debit_amount|accounting_amount }}</td>
|
<td class="amount">{{ record.debit_amount|accounting_amount }}</td>
|
||||||
<td class="amount">{{ item.credit_amount|accounting_amount }}</td>
|
<td class="amount">{{ record.credit_amount|accounting_amount }}</td>
|
||||||
<td class="amount {% if item.balance < 0 %} text-danger {% endif %}">{{ item.balance|accounting_amount }}</td>
|
<td class="amount {% if record.balance < 0 %} text-danger {% endif %}">{{ record.balance|accounting_amount }}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{% if item.pk is not None %}
|
{% if record.pk is not None %}
|
||||||
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" class="btn btn-info" role="button">
|
<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>
|
<i class="fas fa-eye"></i>
|
||||||
<span class="d-none d-lg-inline">{{ _("View")|force_escape }}</span>
|
<span class="d-none d-lg-inline">{{ _("View")|force_escape }}</span>
|
||||||
</a>
|
</a>
|
||||||
@ -136,75 +136,75 @@ First written: 2020/7/16
|
|||||||
|
|
||||||
{# The list for small screens #}
|
{# The list for small screens #}
|
||||||
<ul class="list-group d-md-none">
|
<ul class="list-group d-md-none">
|
||||||
{% for item in item_list %}
|
{% for record in record_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 %}">
|
<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 item.pk is not None %}
|
{% if record.pk is not None %}
|
||||||
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}">
|
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" record.transaction.type record.transaction %}">
|
||||||
<div class="date-account-line">
|
<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>
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div>
|
<div>
|
||||||
{{ item.summary|default:"" }}
|
{{ record.summary|default:"" }}
|
||||||
{% if not item.is_balanced %}
|
{% if not record.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 %}
|
||||||
{% if item.has_order_hole %}
|
{% if record.has_order_hole %}
|
||||||
<span class="badge badge-danger badge-pill">
|
<span class="badge badge-danger badge-pill">
|
||||||
{{ _("Need Reorder")|force_escape }}
|
{{ _("Need Reorder")|force_escape }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.is_payable %}
|
{% if record.is_payable %}
|
||||||
<span class="badge badge-danger badge-pill">
|
<span class="badge badge-danger badge-pill">
|
||||||
{{ _("Payable")|force_escape }}
|
{{ _("Payable")|force_escape }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.is_existing_equipment %}
|
{% if record.is_existing_equipment %}
|
||||||
<span class="badge badge-info badge-pill">
|
<span class="badge badge-info badge-pill">
|
||||||
{{ _("Existing")|force_escape }}
|
{{ _("Existing")|force_escape }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{% if item.debit_amount is not None %}
|
{% if record.debit_amount is not None %}
|
||||||
<span class="badge badge-success badge-pill">
|
<span class="badge badge-success badge-pill">
|
||||||
{{ item.debit_amount|intcomma:False }}
|
{{ record.debit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.credit_amount is not None %}
|
{% if record.credit_amount is not None %}
|
||||||
<span class="badge badge-warning badge-pill">
|
<span class="badge badge-warning badge-pill">
|
||||||
{{ item.credit_amount|intcomma:False }}
|
{{ record.credit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span class="badge {% if item.balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
<span class="badge {% if record.balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
||||||
{{ item.balance|intcomma:False }}
|
{{ record.balance|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="date-account-line">
|
<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>
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div>
|
<div>
|
||||||
{{ item.summary|default:"" }}
|
{{ record.summary|default:"" }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{% if item.debit_amount is not None %}
|
{% if record.debit_amount is not None %}
|
||||||
<span class="badge badge-success badge-pill">
|
<span class="badge badge-success badge-pill">
|
||||||
{{ item.debit_amount|intcomma:False }}
|
{{ record.debit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.credit_amount is not None %}
|
{% if record.credit_amount is not None %}
|
||||||
<span class="badge badge-warning badge-pill">
|
<span class="badge badge-warning badge-pill">
|
||||||
{{ item.credit_amount|intcomma:False }}
|
{{ record.credit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span class="badge {% if item.balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
<span class="badge {% if record.balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">
|
||||||
{{ item.balance|intcomma:False }}
|
{{ record.balance|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -66,7 +66,7 @@ First written: 2020/7/21
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if item_list %}
|
{% if record_list %}
|
||||||
{% include "mia_core/include/pagination.html" %}
|
{% include "mia_core/include/pagination.html" %}
|
||||||
|
|
||||||
{# The table for large screens #}
|
{# The table for large screens #}
|
||||||
@ -83,24 +83,24 @@ First written: 2020/7/21
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for item in item_list %}
|
{% for record in record_list %}
|
||||||
<tr class="{% if not item.is_balanced or item.has_order_hole %} table-danger {% endif %}">
|
<tr class="{% if not record.is_balanced or record.has_order_hole %} table-danger {% endif %}">
|
||||||
<td>{{ item.transaction.date|smart_date }}</td>
|
<td>{{ record.transaction.date|smart_date }}</td>
|
||||||
<td>{{ item.account.title|title_case }}</td>
|
<td>{{ record.account.title|title_case }}</td>
|
||||||
<td><div class="{% if item.is_credit %} journal-credit {% else %} journal-debit {% endif %}">{{ item.summary|default:"" }}{% if not item.is_balanced %}
|
<td><div class="{% if record.is_credit %} journal-credit {% else %} journal-debit {% endif %}">{{ record.summary|default:"" }}{% if not record.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 %}{% if item.has_order_hole %}
|
{% endif %}{% if record.has_order_hole %}
|
||||||
<span class="badge badge-danger badge-pill">
|
<span class="badge badge-danger badge-pill">
|
||||||
{{ _("Need Reorder")|force_escape }}
|
{{ _("Need Reorder")|force_escape }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}</div></td>
|
{% endif %}</div></td>
|
||||||
<td class="amount">{{ item.debit_amount|accounting_amount }}</td>
|
<td class="amount">{{ record.debit_amount|accounting_amount }}</td>
|
||||||
<td class="amount">{{ item.credit_amount|accounting_amount }}</td>
|
<td class="amount">{{ record.credit_amount|accounting_amount }}</td>
|
||||||
<td>{{ item.transaction.notes|default:"" }}</td>
|
<td>{{ record.transaction.notes|default:"" }}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" class="btn btn-info" role="button">
|
<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>
|
<i class="fas fa-eye"></i>
|
||||||
{{ _("View")|force_escape }}
|
{{ _("View")|force_escape }}
|
||||||
</a>
|
</a>
|
||||||
@ -112,41 +112,41 @@ First written: 2020/7/21
|
|||||||
|
|
||||||
{# The list for small screens #}
|
{# The list for small screens #}
|
||||||
<ul class="list-group d-md-none">
|
<ul class="list-group d-md-none">
|
||||||
{% for item in item_list %}
|
{% for record in record_list %}
|
||||||
<li class="list-group-item {% if not item.is_balanced or item.has_order_hole %} list-group-item-danger {% endif %}">
|
<li class="list-group-item {% if not record.is_balanced or record.has_order_hole %} list-group-item-danger {% endif %}">
|
||||||
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}">
|
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" record.transaction.type record.transaction %}">
|
||||||
<div class="{% if item.is_credit %} journal-credit {% else %} journal-debit {% endif %}">
|
<div class="{% if record.is_credit %} journal-credit {% else %} journal-debit {% endif %}">
|
||||||
<div class="date-account-line">
|
<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>
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<div>
|
<div>
|
||||||
{{ item.summary|default:"" }}
|
{{ record.summary|default:"" }}
|
||||||
{% if not item.is_balanced %}
|
{% if not record.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 %}
|
||||||
{% if item.has_order_hole %}
|
{% if record.has_order_hole %}
|
||||||
<span class="badge badge-danger badge-pill">
|
<span class="badge badge-danger badge-pill">
|
||||||
{{ _("Need Reorder")|force_escape }}
|
{{ _("Need Reorder")|force_escape }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{% if item.debit_amount is not None %}
|
{% if record.debit_amount is not None %}
|
||||||
<span class="badge badge-success badge-pill">
|
<span class="badge badge-success badge-pill">
|
||||||
{{ item.debit_amount|intcomma:False }}
|
{{ record.debit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.credit_amount is not None %}
|
{% if record.credit_amount is not None %}
|
||||||
<span class="badge badge-warning badge-pill">
|
<span class="badge badge-warning badge-pill">
|
||||||
{{ item.credit_amount|intcomma:False }}
|
{{ record.credit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>{{ item.transaction.note|default:"" }}</div>
|
<div>{{ record.transaction.note|default:"" }}</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -67,7 +67,7 @@ First written: 2020/7/19
|
|||||||
{% include "mia_core/include/period-chooser.html" %}
|
{% include "mia_core/include/period-chooser.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
{% if item_list %}
|
{% if account_list %}
|
||||||
{% include "mia_core/include/pagination.html" %}
|
{% include "mia_core/include/pagination.html" %}
|
||||||
|
|
||||||
{# The table for large screens #}
|
{# The table for large screens #}
|
||||||
@ -88,13 +88,13 @@ First written: 2020/7/19
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for item in item_list %}
|
{% for account in account_list %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ item.title|title_case }}</td>
|
<td>{{ account.title|title_case }}</td>
|
||||||
<td class="amount">{{ item.debit_amount|accounting_amount }}</td>
|
<td class="amount">{{ account.debit_amount|accounting_amount }}</td>
|
||||||
<td class="amount">{{ item.credit_amount|accounting_amount }}</td>
|
<td class="amount">{{ account.credit_amount|accounting_amount }}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<a href="{% url "accounting:ledger" item request.resolver_match.kwargs.period %}" class="btn btn-info" role="button">
|
<a href="{% url "accounting:ledger" account request.resolver_match.kwargs.period %}" class="btn btn-info" role="button">
|
||||||
<i class="fas fa-eye"></i>
|
<i class="fas fa-eye"></i>
|
||||||
<span class="d-none d-lg-inline">{{ _("View")|force_escape }}</span>
|
<span class="d-none d-lg-inline">{{ _("View")|force_escape }}</span>
|
||||||
</a>
|
</a>
|
||||||
@ -124,19 +124,19 @@ First written: 2020/7/19
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<ul class="list-group d-lg-none trial-balance-list">
|
<ul class="list-group d-lg-none trial-balance-list">
|
||||||
{% for item in item_list %}
|
{% for account in account_list %}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<a class="list-group-item-action d-flex justify-content-between align-items-center" href="{% url "accounting:ledger" item request.resolver_match.kwargs.period %}">
|
<a class="list-group-item-action d-flex justify-content-between align-items-center" href="{% url "accounting:ledger" account request.resolver_match.kwargs.period %}">
|
||||||
{{ item.title|title_case }}
|
{{ account.title|title_case }}
|
||||||
<div>
|
<div>
|
||||||
{% if item.debit_amount is not None %}
|
{% if account.debit_amount is not None %}
|
||||||
<span class="badge badge-success badge-pill">
|
<span class="badge badge-success badge-pill">
|
||||||
{{ item.debit_amount|intcomma:False }}
|
{{ account.debit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.credit_amount is not None %}
|
{% if account.credit_amount is not None %}
|
||||||
<span class="badge badge-warning badge-pill">
|
<span class="badge badge-warning badge-pill">
|
||||||
{{ item.credit_amount|intcomma:False }}
|
{{ account.credit_amount|intcomma:False }}
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -160,7 +160,7 @@ def cash(request, account, period):
|
|||||||
accounts = get_cash_accounts()
|
accounts = get_cash_accounts()
|
||||||
shortcut_accounts = settings.ACCOUNTING["CASH_SHORTCUT_ACCOUNTS"]
|
shortcut_accounts = settings.ACCOUNTING["CASH_SHORTCUT_ACCOUNTS"]
|
||||||
return render(request, "accounting/cash.html", {
|
return render(request, "accounting/cash.html", {
|
||||||
"item_list": records,
|
"record_list": records,
|
||||||
"pagination": pagination,
|
"pagination": pagination,
|
||||||
"shortcut_accounts": [x for x in accounts
|
"shortcut_accounts": [x for x in accounts
|
||||||
if x.code in shortcut_accounts],
|
if x.code in shortcut_accounts],
|
||||||
@ -258,7 +258,7 @@ def cash_summary(request, account):
|
|||||||
return HttpResponseRedirect(e.url)
|
return HttpResponseRedirect(e.url)
|
||||||
shortcut_accounts = settings.ACCOUNTING["CASH_SHORTCUT_ACCOUNTS"]
|
shortcut_accounts = settings.ACCOUNTING["CASH_SHORTCUT_ACCOUNTS"]
|
||||||
return render(request, "accounting/cash-summary.html", {
|
return render(request, "accounting/cash-summary.html", {
|
||||||
"item_list": pagination.items,
|
"month_list": pagination.items,
|
||||||
"pagination": pagination,
|
"pagination": pagination,
|
||||||
"shortcut_accounts": [x for x in accounts if
|
"shortcut_accounts": [x for x in accounts if
|
||||||
x.code in shortcut_accounts],
|
x.code in shortcut_accounts],
|
||||||
@ -339,7 +339,7 @@ def ledger(request, account, period):
|
|||||||
find_payable_records(account, records)
|
find_payable_records(account, records)
|
||||||
find_existing_equipments(account, records)
|
find_existing_equipments(account, records)
|
||||||
return render(request, "accounting/ledger.html", {
|
return render(request, "accounting/ledger.html", {
|
||||||
"item_list": records,
|
"record_list": records,
|
||||||
"pagination": pagination,
|
"pagination": pagination,
|
||||||
"accounts": get_ledger_accounts(),
|
"accounts": get_ledger_accounts(),
|
||||||
})
|
})
|
||||||
@ -402,7 +402,7 @@ def ledger_summary(request, account):
|
|||||||
except PaginationException as e:
|
except PaginationException as e:
|
||||||
return HttpResponseRedirect(e.url)
|
return HttpResponseRedirect(e.url)
|
||||||
return render(request, "accounting/ledger-summary.html", {
|
return render(request, "accounting/ledger-summary.html", {
|
||||||
"item_list": pagination.items,
|
"month_list": pagination.items,
|
||||||
"pagination": pagination,
|
"pagination": pagination,
|
||||||
"accounts": get_ledger_accounts(),
|
"accounts": get_ledger_accounts(),
|
||||||
})
|
})
|
||||||
@ -485,7 +485,7 @@ def journal(request, period):
|
|||||||
except PaginationException as e:
|
except PaginationException as e:
|
||||||
return HttpResponseRedirect(e.url)
|
return HttpResponseRedirect(e.url)
|
||||||
return render(request, "accounting/journal.html", {
|
return render(request, "accounting/journal.html", {
|
||||||
"item_list": pagination.items,
|
"record_list": pagination.items,
|
||||||
"pagination": pagination,
|
"pagination": pagination,
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -588,7 +588,7 @@ def trial_balance(request, period):
|
|||||||
total_account.credit_amount = sum([x.credit_amount for x in accounts
|
total_account.credit_amount = sum([x.credit_amount for x in accounts
|
||||||
if x.credit_amount is not None])
|
if x.credit_amount is not None])
|
||||||
return render(request, "accounting/trial-balance.html", {
|
return render(request, "accounting/trial-balance.html", {
|
||||||
"item_list": accounts,
|
"account_list": accounts,
|
||||||
"total_item": total_account,
|
"total_item": total_account,
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -664,7 +664,7 @@ def income_statement(request, period):
|
|||||||
section.has_next = True
|
section.has_next = True
|
||||||
sections[-1].has_next = False
|
sections[-1].has_next = False
|
||||||
return render(request, "accounting/income-statement.html", {
|
return render(request, "accounting/income-statement.html", {
|
||||||
"item_list": sections,
|
"section_list": sections,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -794,7 +794,7 @@ def search(request):
|
|||||||
except PaginationException as e:
|
except PaginationException as e:
|
||||||
return HttpResponseRedirect(e.url)
|
return HttpResponseRedirect(e.url)
|
||||||
return render(request, "accounting/search.html", {
|
return render(request, "accounting/search.html", {
|
||||||
"item_list": pagination.items,
|
"record_list": pagination.items,
|
||||||
"pagination": pagination,
|
"pagination": pagination,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user