Replaced the account and period template variables with the resolver matches from the request, reducing the variables passed from the view to the templates in the accounting application.
This commit is contained in:
parent
d23d7a9c60
commit
c7e1fd323d
@ -27,7 +27,7 @@ First written: 2020/7/20
|
|||||||
{% load accounting %}
|
{% load accounting %}
|
||||||
|
|
||||||
{% block settings %}
|
{% block settings %}
|
||||||
{% blocktrans asvar title with prep_period=period.prep_desc %}Balance Sheet {{ prep_period }}{% endblocktrans %}
|
{% blocktrans asvar title with prep_period=request.resolver_match.kwargs.period.prep_desc %}Balance Sheet {{ prep_period }}{% endblocktrans %}
|
||||||
{% setvar "title" title %}
|
{% setvar "title" title %}
|
||||||
{% setvar "use_period_chooser" True %}
|
{% setvar "use_period_chooser" True %}
|
||||||
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
||||||
@ -53,17 +53,19 @@ First written: 2020/7/20
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% with current_report_icon="fas fa-balance-scale" current_report_title=_("Balance Sheet") period=period %}
|
{% with current_report_icon="fas fa-balance-scale" current_report_title=_("Balance Sheet") period=request.resolver_match.kwargs.period %}
|
||||||
{% include "accounting/include/report-chooser.html" %}
|
{% include "accounting/include/report-chooser.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
|
||||||
<i class="far fa-calendar-alt"></i>
|
<i class="far fa-calendar-alt"></i>
|
||||||
<span class="d-none d-md-inline">{{ period.description }}</span>
|
<span class="d-none d-md-inline">{{ request.resolver_match.kwargs.period.description }}</span>
|
||||||
<span class="d-md-none">{{ _("Period")|force_escape }}</span>
|
<span class="d-md-none">{{ _("Period")|force_escape }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% with period=request.resolver_match.kwargs.period %}
|
||||||
{% include "mia_core/include/period-chooser.html" %}
|
{% include "mia_core/include/period-chooser.html" %}
|
||||||
|
{% endwith %}
|
||||||
|
|
||||||
{# The table for large screens #}
|
{# The table for large screens #}
|
||||||
<div class="d-none d-lg-block report-block report-block-lg">
|
<div class="d-none d-lg-block report-block report-block-lg">
|
||||||
|
@ -27,7 +27,7 @@ First written: 2020/7/15
|
|||||||
{% load accounting %}
|
{% load accounting %}
|
||||||
|
|
||||||
{% block settings %}
|
{% block settings %}
|
||||||
{% blocktrans asvar title with account=account.title %}Cash Summary for {{ account }}{% endblocktrans %}
|
{% blocktrans asvar title with account=request.resolver_match.kwargs.account.title %}Cash Summary for {{ account }}{% endblocktrans %}
|
||||||
{% setvar "title" title %}
|
{% setvar "title" title %}
|
||||||
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@ -52,25 +52,25 @@ First written: 2020/7/15
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% with current_report_icon="fas fa-money-bill-wave" current_report_title=_("Cash Summary") cash_account=account %}
|
{% with current_report_icon="fas fa-money-bill-wave" current_report_title=_("Cash Summary") cash_account=request.resolver_match.kwargs.account %}
|
||||||
{% include "accounting/include/report-chooser.html" %}
|
{% include "accounting/include/report-chooser.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
||||||
<span class="d-none d-md-inline">{{ account.title|title_case }}</span>
|
<span class="d-none d-md-inline">{{ request.resolver_match.kwargs.account.title|title_case }}</span>
|
||||||
<span class="d-md-none">{{ _("Account")|force_escape }}</span>
|
<span class="d-md-none">{{ _("Account")|force_escape }}</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu account-picker">
|
<div class="dropdown-menu account-picker">
|
||||||
<div class="dropdown-header">{{ _("Shortcuts")|force_escape }}</div>
|
<div class="dropdown-header">{{ _("Shortcuts")|force_escape }}</div>
|
||||||
{% for x in shortcut_accounts %}
|
{% for account in shortcut_accounts %}
|
||||||
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash-summary" x %}">
|
<a class="dropdown-item {% if account.code == request.resolver_match.kwargs.account.code %} active {% endif %}>" href="{% url "accounting:cash-summary" account %}">
|
||||||
{{ x.title|title_case }}
|
{{ account.title|title_case }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<div class="dropdown-header">{{ _("All")|force_escape }}</div>
|
<div class="dropdown-header">{{ _("All")|force_escape }}</div>
|
||||||
{% for x in all_accounts %}
|
{% for account in all_accounts %}
|
||||||
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash-summary" x %}">
|
<a class="dropdown-item {% if account.code == request.resolver_match.kwargs.account.code %} active {% endif %}>" href="{% url "accounting:cash-summary" account %}">
|
||||||
{{ x.code }} {{ x.title|title_case }}
|
{{ account.code }} {{ account.title|title_case }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
@ -102,7 +102,7 @@ First written: 2020/7/15
|
|||||||
<td class="amount {% if item.cumulative_balance < 0 %} text-danger {% endif %}">{{ item.cumulative_balance|accounting_amount }}</td>
|
<td class="amount {% if item.cumulative_balance < 0 %} text-danger {% endif %}">{{ item.cumulative_balance|accounting_amount }}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{% if item.month is not None %}
|
{% if item.month is not None %}
|
||||||
<a class="btn btn-info" role="button" href="{% url "accounting:cash" account item.month|date:"Y-m" %}">
|
<a class="btn btn-info" role="button" href="{% url "accounting:cash" request.resolver_match.kwargs.account item.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>
|
||||||
@ -118,7 +118,7 @@ First written: 2020/7/15
|
|||||||
{% for item in item_list %}
|
{% for item in item_list %}
|
||||||
<li class="list-group-item {% if item.balance < 0 %} list-group-item-danger {% endif %}">
|
<li class="list-group-item {% if item.balance < 0 %} list-group-item-danger {% endif %}">
|
||||||
{% if item.month is not None %}
|
{% if item.month is not None %}
|
||||||
<a class="list-group-item-action d-flex justify-content-between align-items-center" href="{% url "accounting:cash" 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 item.month|date:"Y-m" %}">
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
<div>
|
<div>
|
||||||
<span class="badge badge-success badge-pill">
|
<span class="badge badge-success badge-pill">
|
||||||
|
@ -27,7 +27,7 @@ First written: 2020/7/1
|
|||||||
{% load accounting %}
|
{% load accounting %}
|
||||||
|
|
||||||
{% block settings %}
|
{% block settings %}
|
||||||
{% blocktrans asvar title with account=account.title prep_period=period.prep_desc %}Cash Account for {{ account }} {{ prep_period }}{% endblocktrans %}
|
{% blocktrans asvar title with account=request.resolver_match.kwargs.account.title prep_period=request.resolver_match.kwargs.period.prep_desc %}Cash Account for {{ account }} {{ prep_period }}{% endblocktrans %}
|
||||||
{% setvar "title" title %}
|
{% setvar "title" title %}
|
||||||
{% setvar "use_period_chooser" True %}
|
{% setvar "use_period_chooser" True %}
|
||||||
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
||||||
@ -53,37 +53,39 @@ First written: 2020/7/1
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% with current_report_icon="fas fa-money-bill-wave" current_report_title=_("Cash Account") cash_account=account period=period %}
|
{% with current_report_icon="fas fa-money-bill-wave" current_report_title=_("Cash Account") cash_account=request.resolver_match.kwargs.account period=request.resolver_match.kwargs.period %}
|
||||||
{% include "accounting/include/report-chooser.html" %}
|
{% include "accounting/include/report-chooser.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
||||||
<span class="d-none d-md-inline">{{ account.title|title_case }}</span>
|
<span class="d-none d-md-inline">{{ request.resolver_match.kwargs.account.title|title_case }}</span>
|
||||||
<span class="d-md-none">{{ _("Account")|force_escape }}</span>
|
<span class="d-md-none">{{ _("Account")|force_escape }}</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu account-picker">
|
<div class="dropdown-menu account-picker">
|
||||||
<div class="dropdown-header">{{ _("Shortcuts")|force_escape }}</div>
|
<div class="dropdown-header">{{ _("Shortcuts")|force_escape }}</div>
|
||||||
{% for x in shortcut_accounts %}
|
{% for account in shortcut_accounts %}
|
||||||
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash" x period %}">
|
<a class="dropdown-item {% if account.code == request.resolver_match.kwargs.account.code %} active {% endif %}>" href="{% url "accounting:cash" account request.resolver_match.kwargs.period %}">
|
||||||
{{ x.title|title_case }}
|
{{ account.title|title_case }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<div class="dropdown-header">{{ _("All")|force_escape }}</div>
|
<div class="dropdown-header">{{ _("All")|force_escape }}</div>
|
||||||
{% for x in all_accounts %}
|
{% for account in all_accounts %}
|
||||||
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash" x period %}">
|
<a class="dropdown-item {% if account.code == request.resolver_match.kwargs.account.code %} active {% endif %}>" href="{% url "accounting:cash" account request.resolver_match.kwargs.period %}">
|
||||||
{{ x.code }} {{ x.title|title_case }}
|
{{ account.code }} {{ account.title|title_case }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
|
||||||
<i class="far fa-calendar-alt"></i>
|
<i class="far fa-calendar-alt"></i>
|
||||||
<span class="d-none d-md-inline">{{ period.description }}</span>
|
<span class="d-none d-md-inline">{{ request.resolver_match.kwargs.period.description }}</span>
|
||||||
<span class="d-md-none">{{ _("Period")|force_escape }}</span>
|
<span class="d-md-none">{{ _("Period")|force_escape }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% with period=request.resolver_match.kwargs.period %}
|
||||||
{% include "mia_core/include/period-chooser.html" %}
|
{% include "mia_core/include/period-chooser.html" %}
|
||||||
|
{% endwith %}
|
||||||
|
|
||||||
{% if item_list %}
|
{% if item_list %}
|
||||||
{% include "mia_core/include/pagination.html" %}
|
{% include "mia_core/include/pagination.html" %}
|
||||||
|
@ -27,7 +27,7 @@ First written: 2020/7/19
|
|||||||
{% load accounting %}
|
{% load accounting %}
|
||||||
|
|
||||||
{% block settings %}
|
{% block settings %}
|
||||||
{% blocktrans asvar title with prep_period=period.prep_desc %}Income Statement {{ prep_period }}{% endblocktrans %}
|
{% blocktrans asvar title with prep_period=request.resolver_match.kwargs.period.prep_desc %}Income Statement {{ prep_period }}{% endblocktrans %}
|
||||||
{% setvar "title" title %}
|
{% setvar "title" title %}
|
||||||
{% setvar "use_period_chooser" True %}
|
{% setvar "use_period_chooser" True %}
|
||||||
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
||||||
@ -53,17 +53,19 @@ First written: 2020/7/19
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% with current_report_icon="fas fa-file-invoice" current_report_title=_("Income Statement") period=period %}
|
{% with current_report_icon="fas fa-file-invoice" current_report_title=_("Income Statement") period=request.resolver_match.kwargs.period %}
|
||||||
{% include "accounting/include/report-chooser.html" %}
|
{% include "accounting/include/report-chooser.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
|
||||||
<i class="far fa-calendar-alt"></i>
|
<i class="far fa-calendar-alt"></i>
|
||||||
<span class="d-none d-md-inline">{{ period.description }}</span>
|
<span class="d-none d-md-inline">{{ request.resolver_match.kwargs.period.description }}</span>
|
||||||
<span class="d-md-none">{{ _("Period")|force_escape }}</span>
|
<span class="d-md-none">{{ _("Period")|force_escape }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% with period=request.resolver_match.kwargs.period %}
|
||||||
{% include "mia_core/include/period-chooser.html" %}
|
{% include "mia_core/include/period-chooser.html" %}
|
||||||
|
{% endwith %}
|
||||||
|
|
||||||
{# The table for large screens #}
|
{# The table for large screens #}
|
||||||
<div class="d-none d-sm-block report-block report-block-lg">
|
<div class="d-none d-sm-block report-block report-block-lg">
|
||||||
@ -103,7 +105,7 @@ First written: 2020/7/19
|
|||||||
<td class="amount {% if item.amount < 0 %} text-danger {% endif %}">{{ item.amount|accounting_amount }}</td>
|
<td class="amount {% if item.amount < 0 %} text-danger {% endif %}">{{ item.amount|accounting_amount }}</td>
|
||||||
<td class="amount"></td>
|
<td class="amount"></td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<a href="{% url "accounting:ledger" item period %}" class="btn btn-info" role="button">
|
<a href="{% url "accounting:ledger" item 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>
|
||||||
@ -163,7 +165,7 @@ First written: 2020/7/19
|
|||||||
</li>
|
</li>
|
||||||
{% for item in group.details %}
|
{% for item 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 period %}">
|
<a class="list-group-item-action" href="{% url "accounting:ledger" item request.resolver_match.kwargs.period %}">
|
||||||
{{ item.title|title_case }}
|
{{ item.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 item.amount < 0 %} badge-warning {% else %} badge-secondary {% endif %} badge-pill">
|
||||||
|
@ -27,7 +27,7 @@ First written: 2020/7/17
|
|||||||
{% load accounting %}
|
{% load accounting %}
|
||||||
|
|
||||||
{% block settings %}
|
{% block settings %}
|
||||||
{% blocktrans asvar title with prep_period=period.prep_desc %}Journal {{ prep_period }}{% endblocktrans %}
|
{% blocktrans asvar title with prep_period=request.resolver_match.kwargs.period.prep_desc %}Journal {{ prep_period }}{% endblocktrans %}
|
||||||
{% setvar "title" title %}
|
{% setvar "title" title %}
|
||||||
{% setvar "use_period_chooser" True %}
|
{% setvar "use_period_chooser" True %}
|
||||||
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
||||||
@ -53,17 +53,19 @@ First written: 2020/7/17
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% with current_report_icon="fas fa-book" current_report_title=_("Journal") period=period %}
|
{% with current_report_icon="fas fa-book" current_report_title=_("Journal") period=request.resolver_match.kwargs.period %}
|
||||||
{% include "accounting/include/report-chooser.html" %}
|
{% include "accounting/include/report-chooser.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
|
||||||
<i class="far fa-calendar-alt"></i>
|
<i class="far fa-calendar-alt"></i>
|
||||||
<span class="d-none d-md-inline">{{ period.description }}</span>
|
<span class="d-none d-md-inline">{{ request.resolver_match.kwargs.period.description }}</span>
|
||||||
<span class="d-md-none">{{ _("Period")|force_escape }}</span>
|
<span class="d-md-none">{{ _("Period")|force_escape }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% with period=request.resolver_match.kwargs.period %}
|
||||||
{% include "mia_core/include/period-chooser.html" %}
|
{% include "mia_core/include/period-chooser.html" %}
|
||||||
|
{% endwith %}
|
||||||
|
|
||||||
{% if item_list %}
|
{% if item_list %}
|
||||||
{% include "mia_core/include/pagination.html" %}
|
{% include "mia_core/include/pagination.html" %}
|
||||||
|
@ -27,7 +27,7 @@ First written: 2020/7/16
|
|||||||
{% load accounting %}
|
{% load accounting %}
|
||||||
|
|
||||||
{% block settings %}
|
{% block settings %}
|
||||||
{% blocktrans asvar title with account=account.title %}Ledger Summary for {{ account }}{% endblocktrans %}
|
{% blocktrans asvar title with account=request.resolver_match.kwargs.account.title %}Ledger Summary for {{ account }}{% endblocktrans %}
|
||||||
{% setvar "title" title %}
|
{% setvar "title" title %}
|
||||||
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@ -52,18 +52,18 @@ First written: 2020/7/16
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% with current_report_icon="fas fa-file-invoice-dollar" current_report_title=_("Ledger Summary") ledger_account=account %}
|
{% with current_report_icon="fas fa-file-invoice-dollar" current_report_title=_("Ledger Summary") ledger_account=request.resolver_match.kwargs.account %}
|
||||||
{% include "accounting/include/report-chooser.html" %}
|
{% include "accounting/include/report-chooser.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
||||||
<span class="d-none d-md-inline">{{ account.title|title_case }}</span>
|
<span class="d-none d-md-inline">{{ request.resolver_match.kwargs.account.title|title_case }}</span>
|
||||||
<span class="d-md-none">{{ _("Account")|force_escape }}</span>
|
<span class="d-md-none">{{ _("Account")|force_escape }}</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu account-picker">
|
<div class="dropdown-menu account-picker">
|
||||||
{% for x in accounts %}
|
{% for account in accounts %}
|
||||||
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:ledger-summary" x %}">
|
<a class="dropdown-item {% if account.code == request.resolver_match.kwargs.account.code %} active {% endif %}>" href="{% url "accounting:ledger-summary" account %}">
|
||||||
{{ x.title|title_case }}
|
{{ account.title|title_case }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
@ -87,7 +87,7 @@ First written: 2020/7/16
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for item in item_list %}
|
{% for item in item_list %}
|
||||||
<tr class="{% if 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 item.balance < 0 %} table-danger {% endif %}">
|
||||||
<td>{{ item.label }}</td>
|
<td>{{ item.label }}</td>
|
||||||
<td class="amount">{{ item.debit|accounting_amount }}</td>
|
<td class="amount">{{ item.debit|accounting_amount }}</td>
|
||||||
<td class="amount">{{ item.credit|accounting_amount }}</td>
|
<td class="amount">{{ item.credit|accounting_amount }}</td>
|
||||||
@ -95,7 +95,7 @@ First written: 2020/7/16
|
|||||||
<td class="amount {% if item.cumulative_balance < 0 %} text-danger {% endif %}">{{ item.cumulative_balance|accounting_amount }}</td>
|
<td class="amount {% if item.cumulative_balance < 0 %} text-danger {% endif %}">{{ item.cumulative_balance|accounting_amount }}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{% if item.month is not None %}
|
{% if item.month is not None %}
|
||||||
<a class="btn btn-info" role="button" href="{% url "accounting:ledger" account item.month|date:"Y-m" %}">
|
<a class="btn btn-info" role="button" href="{% url "accounting:ledger" request.resolver_match.kwargs.account item.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>
|
||||||
@ -109,9 +109,9 @@ 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 item in item_list %}
|
||||||
<li class="list-group-item {% if 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 item.balance < 0 %} list-group-item-danger {% endif %}">
|
||||||
{% if item.month is not None %}
|
{% if item.month is not None %}
|
||||||
<a class="list-group-item-action d-flex justify-content-between align-items-center" href="{% url "accounting:ledger" 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 item.month|date:"Y-m" %}">
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
<div>
|
<div>
|
||||||
<span class="badge badge-success badge-pill">
|
<span class="badge badge-success badge-pill">
|
||||||
|
@ -27,7 +27,7 @@ First written: 2020/7/16
|
|||||||
{% load accounting %}
|
{% load accounting %}
|
||||||
|
|
||||||
{% block settings %}
|
{% block settings %}
|
||||||
{% blocktrans asvar title with account=account.title prep_period=period.prep_desc %}Ledger for {{ account }} {{ prep_period }}{% endblocktrans %}
|
{% blocktrans asvar title with account=request.resolver_match.kwargs.account.title prep_period=request.resolver_match.kwargs.period.prep_desc %}Ledger for {{ account }} {{ prep_period }}{% endblocktrans %}
|
||||||
{% setvar "title" title %}
|
{% setvar "title" title %}
|
||||||
{% setvar "use_period_chooser" True %}
|
{% setvar "use_period_chooser" True %}
|
||||||
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
||||||
@ -53,30 +53,32 @@ First written: 2020/7/16
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% with current_report_icon="fas fa-file-invoice-dollar" current_report_title=_("Ledger") ledger_account=account period=period %}
|
{% with current_report_icon="fas fa-file-invoice-dollar" current_report_title=_("Ledger") ledger_account=request.resolver_match.kwargs.account period=request.resolver_match.kwargs.period %}
|
||||||
{% include "accounting/include/report-chooser.html" %}
|
{% include "accounting/include/report-chooser.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
|
||||||
<span class="d-none d-md-inline">{{ account.title|title_case }}</span>
|
<span class="d-none d-md-inline">{{ request.resolver_match.kwargs.account.title|title_case }}</span>
|
||||||
<span class="d-md-none">{{ _("Account")|force_escape }}</span>
|
<span class="d-md-none">{{ _("Account")|force_escape }}</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu account-picker">
|
<div class="dropdown-menu account-picker">
|
||||||
{% for x in accounts %}
|
{% for account in accounts %}
|
||||||
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}" href="{% url "accounting:ledger" x period %}">
|
<a class="dropdown-item {% if account.code == request.resolver_match.kwargs.account.code %} active {% endif %}" href="{% url "accounting:ledger" account request.resolver_match.kwargs.period %}">
|
||||||
{{ x.code }} {{ x.title|title_case }}
|
{{ account.code }} {{ account.title|title_case }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
|
||||||
<i class="far fa-calendar-alt"></i>
|
<i class="far fa-calendar-alt"></i>
|
||||||
<span class="d-none d-md-inline">{{ period.description }}</span>
|
<span class="d-none d-md-inline">{{ request.resolver_match.kwargs.period.description }}</span>
|
||||||
<span class="d-md-none">{{ _("Period")|force_escape }}</span>
|
<span class="d-md-none">{{ _("Period")|force_escape }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% with period=request.resolver_match.kwargs.period %}
|
||||||
{% include "mia_core/include/period-chooser.html" %}
|
{% include "mia_core/include/period-chooser.html" %}
|
||||||
|
{% endwith %}
|
||||||
|
|
||||||
{% if item_list %}
|
{% if item_list %}
|
||||||
{% include "mia_core/include/pagination.html" %}
|
{% include "mia_core/include/pagination.html" %}
|
||||||
|
@ -27,7 +27,7 @@ First written: 2020/7/19
|
|||||||
{% load accounting %}
|
{% load accounting %}
|
||||||
|
|
||||||
{% block settings %}
|
{% block settings %}
|
||||||
{% blocktrans asvar title with prep_period=period.prep_desc %}Trial Balance {{ prep_period }}{% endblocktrans %}
|
{% blocktrans asvar title with prep_period=request.resolver_match.kwargs.period.prep_desc %}Trial Balance {{ prep_period }}{% endblocktrans %}
|
||||||
{% setvar "title" title %}
|
{% setvar "title" title %}
|
||||||
{% setvar "use_period_chooser" True %}
|
{% setvar "use_period_chooser" True %}
|
||||||
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
{% static "accounting/css/report.css" as file %}{% add_css file %}
|
||||||
@ -53,17 +53,19 @@ First written: 2020/7/19
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% with current_report_icon="fas fa-balance-scale-right" current_report_title=_("Trial Balance") period=period %}
|
{% with current_report_icon="fas fa-balance-scale-right" current_report_title=_("Trial Balance") period=request.resolver_match.kwargs.period %}
|
||||||
{% include "accounting/include/report-chooser.html" %}
|
{% include "accounting/include/report-chooser.html" %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
|
||||||
<i class="far fa-calendar-alt"></i>
|
<i class="far fa-calendar-alt"></i>
|
||||||
<span class="d-none d-md-inline">{{ period.description }}</span>
|
<span class="d-none d-md-inline">{{ request.resolver_match.kwargs.period.description }}</span>
|
||||||
<span class="d-md-none">{{ _("Period")|force_escape }}</span>
|
<span class="d-md-none">{{ _("Period")|force_escape }}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% with period=request.resolver_match.kwargs.period %}
|
||||||
{% include "mia_core/include/period-chooser.html" %}
|
{% include "mia_core/include/period-chooser.html" %}
|
||||||
|
{% endwith %}
|
||||||
|
|
||||||
{% if item_list %}
|
{% if item_list %}
|
||||||
{% include "mia_core/include/pagination.html" %}
|
{% include "mia_core/include/pagination.html" %}
|
||||||
@ -92,7 +94,7 @@ First written: 2020/7/19
|
|||||||
<td class="amount">{{ item.debit_amount|accounting_amount }}</td>
|
<td class="amount">{{ item.debit_amount|accounting_amount }}</td>
|
||||||
<td class="amount">{{ item.credit_amount|accounting_amount }}</td>
|
<td class="amount">{{ item.credit_amount|accounting_amount }}</td>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
<a href="{% url "accounting:ledger" item period %}" class="btn btn-info" role="button">
|
<a href="{% url "accounting:ledger" item 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,7 +126,7 @@ First written: 2020/7/19
|
|||||||
<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 item in item_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 period %}">
|
<a class="list-group-item-action d-flex justify-content-between align-items-center" href="{% url "accounting:ledger" item request.resolver_match.kwargs.period %}">
|
||||||
{{ item.title|title_case }}
|
{{ item.title|title_case }}
|
||||||
<div>
|
<div>
|
||||||
{% if item.debit_amount is not None %}
|
{% if item.debit_amount is not None %}
|
||||||
|
@ -162,8 +162,6 @@ def cash(request, account, period):
|
|||||||
return render(request, "accounting/cash.html", {
|
return render(request, "accounting/cash.html", {
|
||||||
"item_list": records,
|
"item_list": records,
|
||||||
"pagination": pagination,
|
"pagination": pagination,
|
||||||
"account": account,
|
|
||||||
"period": period,
|
|
||||||
"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],
|
||||||
"all_accounts": [x for x in accounts
|
"all_accounts": [x for x in accounts
|
||||||
@ -262,7 +260,6 @@ def cash_summary(request, account):
|
|||||||
return render(request, "accounting/cash-summary.html", {
|
return render(request, "accounting/cash-summary.html", {
|
||||||
"item_list": pagination.items,
|
"item_list": pagination.items,
|
||||||
"pagination": pagination,
|
"pagination": pagination,
|
||||||
"account": account,
|
|
||||||
"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],
|
||||||
"all_accounts": [x for x in accounts if
|
"all_accounts": [x for x in accounts if
|
||||||
@ -344,8 +341,6 @@ def ledger(request, account, period):
|
|||||||
return render(request, "accounting/ledger.html", {
|
return render(request, "accounting/ledger.html", {
|
||||||
"item_list": records,
|
"item_list": records,
|
||||||
"pagination": pagination,
|
"pagination": pagination,
|
||||||
"account": account,
|
|
||||||
"period": period,
|
|
||||||
"accounts": get_ledger_accounts(),
|
"accounts": get_ledger_accounts(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -409,7 +404,6 @@ def ledger_summary(request, account):
|
|||||||
return render(request, "accounting/ledger-summary.html", {
|
return render(request, "accounting/ledger-summary.html", {
|
||||||
"item_list": pagination.items,
|
"item_list": pagination.items,
|
||||||
"pagination": pagination,
|
"pagination": pagination,
|
||||||
"account": account,
|
|
||||||
"accounts": get_ledger_accounts(),
|
"accounts": get_ledger_accounts(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -493,7 +487,6 @@ def journal(request, period):
|
|||||||
return render(request, "accounting/journal.html", {
|
return render(request, "accounting/journal.html", {
|
||||||
"item_list": pagination.items,
|
"item_list": pagination.items,
|
||||||
"pagination": pagination,
|
"pagination": pagination,
|
||||||
"period": period,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -597,7 +590,6 @@ def trial_balance(request, period):
|
|||||||
return render(request, "accounting/trial-balance.html", {
|
return render(request, "accounting/trial-balance.html", {
|
||||||
"item_list": accounts,
|
"item_list": accounts,
|
||||||
"total_item": total_account,
|
"total_item": total_account,
|
||||||
"period": period,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -673,7 +665,6 @@ def income_statement(request, period):
|
|||||||
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,
|
"item_list": sections,
|
||||||
"period": period,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -774,7 +765,6 @@ def balance_sheet(request, period):
|
|||||||
"assets": by_code["1"],
|
"assets": by_code["1"],
|
||||||
"liabilities": by_code["2"],
|
"liabilities": by_code["2"],
|
||||||
"owners_equity": by_code["3"],
|
"owners_equity": by_code["3"],
|
||||||
"period": period,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user