Added the transaction views in the accounting application.

This commit is contained in:
2020-07-23 22:02:26 +08:00
parent 41737c250e
commit 2db3899dea
18 changed files with 543 additions and 76 deletions

View File

@ -44,18 +44,15 @@ First written: 2020/7/16
{{ text|force_escape }}
</button>
<div class="dropdown-menu">
{% url "accounting:transaction.create" "expense" as url %}
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
{% trans "Cash Expense" context "Accounting|" as text %}
{{ text|force_escape }}
</a>
{% url "accounting:transaction.create" "income" as url %}
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
{% trans "Cash Income" context "Accounting|" as text %}
{{ text|force_escape }}
</a>
{% url "accounting:transaction.create" "transfer" as url %}
<a class="dropdown-item" href="{% url_query url r=request.get_full_path %}">
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
{% trans "Transfer" context "Accounting|" as text %}
{{ text|force_escape }}
</a>
@ -134,7 +131,7 @@ First written: 2020/7/16
<td class="amount {% if item.balance < 0 %} text-danger {% endif %}">{{ item.balance|accounting_amount }}</td>
<td class="actions">
{% if item.sn is not None %}
<a href="{{ item.transaction.get_absolute_url }}" class="btn btn-info" role="button">
<a href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}" class="btn btn-info" role="button">
<i class="fas fa-eye"></i>
<span class="d-none d-lg-inline">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</span>
</a>
@ -150,7 +147,7 @@ First written: 2020/7/16
{% for item in item_list %}
<li class="list-group-item {% if not item.is_balanced or item.has_order_hole or not item.is_credit_card_paid %} list-group-item-danger {% endif %}{% if item.is_existing_equipment %} list-group-item-info {% endif %}">
{% if item.sn is not None %}
<a class="list-group-item-action" href="{{ item.transaction.get_absolute_url }}">
<a class="list-group-item-action" href="{% url_with_return "accounting:transactions.show" item.transaction.type item.transaction %}">
<div class="date-account-line">
{{ item.transaction.date|smart_date }} {{ item.account.title|title }}
</div>