Renamed the template variable current_account to account in the accounting application, for simplicity.
This commit is contained in:
parent
8890e60fbb
commit
a089e2c235
@ -27,7 +27,7 @@ First written: 2020/7/15
|
|||||||
{% load accounting %}
|
{% load accounting %}
|
||||||
|
|
||||||
{% block settings %}
|
{% block settings %}
|
||||||
{% blocktrans asvar title with account=current_account.title|title context "Accounting|" %}Cash Summary for {{ account }}{% endblocktrans %}
|
{% blocktrans asvar title with account=account.title|title context "Accounting|" %}Cash Summary for {{ account }}{% endblocktrans %}
|
||||||
{% setvar "title" title %}
|
{% setvar "title" title %}
|
||||||
{% static "accounting/css/report.css" as css %}
|
{% static "accounting/css/report.css" as css %}
|
||||||
{% setvar "css" css %}
|
{% setvar "css" css %}
|
||||||
@ -66,20 +66,20 @@ First written: 2020/7/15
|
|||||||
{% 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">{{ current_account.title|title }}</span>
|
<span class="d-none d-md-inline">{{ account.title|title }}</span>
|
||||||
<span class="d-md-none">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</span>
|
<span class="d-md-none">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu account-picker">
|
<div class="dropdown-menu account-picker">
|
||||||
<div class="dropdown-header">{% trans "Shortcuts" context "Accounting|Account|" as text %}{{ text|force_escape }}</div>
|
<div class="dropdown-header">{% trans "Shortcuts" context "Accounting|Account|" as text %}{{ text|force_escape }}</div>
|
||||||
{% for account in shortcut_accounts %}
|
{% for x in shortcut_accounts %}
|
||||||
<a class="dropdown-item {% if account.code == current_account.code %} active {% endif %}>" href="{% url "accounting:cash-summary" account %}">
|
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash-summary" x %}">
|
||||||
{{ account.title|title }}
|
{{ x.title|title }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<div class="dropdown-header">{% trans "All" context "Accounting|Account|" as text %}{{ text|force_escape }}</div>
|
<div class="dropdown-header">{% trans "All" context "Accounting|Account|" as text %}{{ text|force_escape }}</div>
|
||||||
{% for account in all_accounts %}
|
{% for x in all_accounts %}
|
||||||
<a class="dropdown-item {% if account.code == current_account.code %} active {% endif %}>" href="{% url "accounting:cash-summary" account %}">
|
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash-summary" x %}">
|
||||||
{{ account.code }} {{ account.title|title }}
|
{{ x.code }} {{ x.title|title }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
@ -111,7 +111,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" current_account item.month|date:"Y-m" %}">
|
<a class="btn btn-info" role="button" href="{% url "accounting:cash" 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">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</span>
|
<span class="d-none d-lg-inline">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</span>
|
||||||
</a>
|
</a>
|
||||||
@ -127,7 +127,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" current_account item.month|date:"Y-m" %}">
|
<a class="list-group-item-action d-flex justify-content-between align-items-center" href="{% url "accounting:cash" 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=current_account.title|title period=period.description context "Accounting|" %}Cash Account for {{ account }} in {{ period }}{% endblocktrans %}
|
{% blocktrans asvar title with account=account.title|title period=period.description context "Accounting|" %}Cash Account for {{ account }} in {{ period }}{% endblocktrans %}
|
||||||
{% setvar "title" title %}
|
{% setvar "title" title %}
|
||||||
{% setvar "use_period_chooser" True %}
|
{% setvar "use_period_chooser" True %}
|
||||||
{% static "accounting/css/report.css" as css %}
|
{% static "accounting/css/report.css" as css %}
|
||||||
@ -67,20 +67,20 @@ First written: 2020/7/1
|
|||||||
{% 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">{{ current_account.title|title }}</span>
|
<span class="d-none d-md-inline">{{ account.title|title }}</span>
|
||||||
<span class="d-md-none">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</span>
|
<span class="d-md-none">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu account-picker">
|
<div class="dropdown-menu account-picker">
|
||||||
<div class="dropdown-header">{% trans "Shortcuts" context "Accounting|Account|" as text %}{{ text|force_escape }}</div>
|
<div class="dropdown-header">{% trans "Shortcuts" context "Accounting|Account|" as text %}{{ text|force_escape }}</div>
|
||||||
{% for account in shortcut_accounts %}
|
{% for x in shortcut_accounts %}
|
||||||
<a class="dropdown-item {% if account.code == current_account.code %} active {% endif %}>" href="{% url "accounting:cash" account period %}">
|
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash" x period %}">
|
||||||
{{ account.title|title }}
|
{{ x.title|title }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<div class="dropdown-header">{% trans "All" context "Accounting|Account|" as text %}{{ text|force_escape }}</div>
|
<div class="dropdown-header">{% trans "All" context "Accounting|Account|" as text %}{{ text|force_escape }}</div>
|
||||||
{% for account in all_accounts %}
|
{% for x in all_accounts %}
|
||||||
<a class="dropdown-item {% if account.code == current_account.code %} active {% endif %}>" href="{% url "accounting:cash" account period %}">
|
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:cash" x period %}">
|
||||||
{{ account.code }} {{ account.title|title }}
|
{{ x.code }} {{ x.title|title }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -27,7 +27,7 @@ First written: 2020/7/16
|
|||||||
{% load accounting %}
|
{% load accounting %}
|
||||||
|
|
||||||
{% block settings %}
|
{% block settings %}
|
||||||
{% blocktrans asvar title with account=current_account.title|title context "Accounting|" %}Ledger Summary for {{ account }}{% endblocktrans %}
|
{% blocktrans asvar title with account=account.title|title context "Accounting|" %}Ledger Summary for {{ account }}{% endblocktrans %}
|
||||||
{% setvar "title" title %}
|
{% setvar "title" title %}
|
||||||
{% static "accounting/css/report.css" as css %}
|
{% static "accounting/css/report.css" as css %}
|
||||||
{% setvar "css" css %}
|
{% setvar "css" css %}
|
||||||
@ -66,13 +66,13 @@ First written: 2020/7/16
|
|||||||
{% 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">{{ current_account.title|title }}</span>
|
<span class="d-none d-md-inline">{{ account.title|title }}</span>
|
||||||
<span class="d-md-none">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</span>
|
<span class="d-md-none">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu account-picker">
|
<div class="dropdown-menu account-picker">
|
||||||
{% for account in accounts %}
|
{% for x in accounts %}
|
||||||
<a class="dropdown-item {% if account.code == current_account.code %} active {% endif %}>" href="{% url "accounting:ledger-summary" account %}">
|
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}>" href="{% url "accounting:ledger-summary" x %}">
|
||||||
{{ account.title|title }}
|
{{ x.title|title }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
@ -96,7 +96,7 @@ First written: 2020/7/16
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for item in item_list %}
|
{% for item in item_list %}
|
||||||
<tr class="{% if current_account.code|first in "12" and item.balance < 0 %} table-danger {% endif %}">
|
<tr class="{% if 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>
|
||||||
@ -104,7 +104,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" current_account item.month|date:"Y-m" %}">
|
<a class="btn btn-info" role="button" href="{% url "accounting:ledger" 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">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</span>
|
<span class="d-none d-lg-inline">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</span>
|
||||||
</a>
|
</a>
|
||||||
@ -118,9 +118,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 current_account.code|first in "12" and item.balance < 0 %} list-group-item-danger {% endif %}">
|
<li class="list-group-item {% if 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" current_account item.month|date:"Y-m" %}">
|
<a class="list-group-item-action d-flex justify-content-between align-items-center" href="{% url "accounting:ledger" 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=current_account.title|title period=period.description context "Accounting|" %}Ledger for {{ account }} in {{ period }}{% endblocktrans %}
|
{% blocktrans asvar title with account=account.title|title period=period.description context "Accounting|" %}Ledger for {{ account }} in {{ period }}{% endblocktrans %}
|
||||||
{% setvar "title" title %}
|
{% setvar "title" title %}
|
||||||
{% setvar "use_period_chooser" True %}
|
{% setvar "use_period_chooser" True %}
|
||||||
{% static "accounting/css/report.css" as css %}
|
{% static "accounting/css/report.css" as css %}
|
||||||
@ -67,13 +67,13 @@ First written: 2020/7/16
|
|||||||
{% 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">{{ current_account.title|title }}</span>
|
<span class="d-none d-md-inline">{{ account.title|title }}</span>
|
||||||
<span class="d-md-none">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</span>
|
<span class="d-md-none">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</span>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu account-picker">
|
<div class="dropdown-menu account-picker">
|
||||||
{% for account in accounts %}
|
{% for x in accounts %}
|
||||||
<a class="dropdown-item {% if account.code == current_account.code %} active {% endif %}" href="{% url "accounting:ledger" account period %}">
|
<a class="dropdown-item {% if x.code == account.code %} active {% endif %}" href="{% url "accounting:ledger" x period %}">
|
||||||
{{ account.code }} {{ account.title|title }}
|
{{ x.code }} {{ x.title|title }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -150,7 +150,7 @@ 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,
|
||||||
"current_account": account,
|
"account": account,
|
||||||
"period": period,
|
"period": period,
|
||||||
"reports": ReportUrl(cash=account, period=period),
|
"reports": ReportUrl(cash=account, period=period),
|
||||||
"shortcut_accounts": [x for x in accounts
|
"shortcut_accounts": [x for x in accounts
|
||||||
@ -253,7 +253,7 @@ 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,
|
||||||
"current_account": account,
|
"account": account,
|
||||||
"reports": ReportUrl(cash=account),
|
"reports": ReportUrl(cash=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],
|
||||||
@ -336,7 +336,7 @@ 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,
|
||||||
"current_account": account,
|
"account": account,
|
||||||
"period": period,
|
"period": period,
|
||||||
"reports": ReportUrl(ledger=account, period=period),
|
"reports": ReportUrl(ledger=account, period=period),
|
||||||
"accounts": _ledger_accounts(),
|
"accounts": _ledger_accounts(),
|
||||||
@ -404,7 +404,7 @@ 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,
|
||||||
"current_account": account,
|
"account": account,
|
||||||
"reports": ReportUrl(ledger=account),
|
"reports": ReportUrl(ledger=account),
|
||||||
"accounts": _ledger_accounts(),
|
"accounts": _ledger_accounts(),
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user