mia-accounting-django/accounting/templates/accounting/cash.html

114 lines
4.7 KiB
HTML

{% extends "base.html" %}
{% comment %}
The Mia Accounting Application
cash.html: The template for the accounting cash reports
Copyright (c) 2020 imacat.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: imacat@mail.imacat.idv.tw (imacat)
First written: 2020/7/1
{% endcomment %}
{% load i18n %}
{% load humanize %}
{% block settings %}
{% trans "Cash Report" context "Accounting|" as title %}
{% setvar "title" title %}
{% endblock %}
{% block content %}
<p>{{ request.resolver_match.url_name }}</p>
<p>{{ request.resolver_match.app_name }}</p>
{% if records %}
{# The table for large screens #}
<table class="table table-striped table-hover d-none d-md-table general-journal-table">
<thead>
<tr>
<th scope="col">{% trans "Date" context "Accounting|" %}</th>
<th scope="col">{% trans "Subject" context "Accounting|" %}</th>
<th scope="col">{% trans "Summary" context "Accounting|" %}</th>
<th class="amount" scope="col">{% trans "Income" context "Accounting|" %}</th>
<th class="amount" scope="col">{% trans "Expense" context "Accounting|" %}</th>
<th class="amount" scope="col">{% trans "Balance" context "Accounting|" %}</th>
<th class="actions" scope="col">{% trans "View" context "Accounting|" %}</th>
</tr>
</thead>
<tbody>
{% for record in records %}
<tr class="{% if not record.transaction.is_balanced or record.transaction.has_order_hole %} table-danger {% endif %}">
<td>{{ record.transaction.date|smart_date }}</td>
<td>{{ record.subject.title_zhtw }}</td>
<td>{{ record.summary }}{% if not record.transaction.is_balanced %}
<span class="badge badge-danger badge-pill">
{% trans "Unbalanced" context "Accounting|" %}
</span>
{% endif %}{% if record.transaction.has_order_hole %}
<span class="badge badge-danger badge-pill">
{% trans "Need Reorder" context "Accounting|" %}
</span>
{% endif %}</td>
<td class="amount">{{ record.credit_amount|default:""|intcomma:False }}</td>
<td class="amount">{{ record.debit_amount|default:""|intcomma:False }}</td>
<td class="amount">{{ record.amount|intcomma:False }}</td>
<td class="actions">
<a href="{{ record.transaction.get_absolute_url }}" class="btn btn-info" role="button">
<i class="fas fa-eye"></i>
<span class="d-none d-lg-inline">{% trans "View" context "Accounting|" %}</span>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{# The list for small screens #}
<ul class="list-group d-md-none">
{% for record in records %}
<li class="list-group-item {% if not record.transaction.is_balanced or record.transaction.has_order_hole %} list-group-item-danger {% endif %}">
<a class="list-group-item-action" href="{{ record.transaction.get_absolute_url }}">
<div class="date-subject-line d-flex justify-content-between align-items-center">
{{ record.transaction.date|smart_date }} {{ record.subject.title_zhtw }}
</div>
<div class="d-flex justify-content-between align-items-center">
<div>
{{ record.summary }}
{% if not record.transaction.is_balanced %}
<span class="badge badge-danger badge-pill">
{% trans "Unbalanced" context "Accounting|" %}
</span>
{% endif %}
{% if record.transaction.has_order_hole %}
<span class="badge badge-danger badge-pill">
{% trans "Need Reorder" context "Accounting|" %}
</span>
{% endif %}
</div>
</div>
<div>
<span class="badge {% if not record.is_credit %} badge-warning {% else %} badge-success {% endif %} badge-pill">{{ record.amount|intcomma:False }}</span>
<span class="badge {% if record.balance < 0 %} badge-danger {% else %} badge-primary {% endif %} badge-pill">{{ record.balance|intcomma:False }}</span>
</div>
</a>
</li>
{% endfor %}
</ul>
{% else %}
<p>{% trans "There is currently no data." %}</p>
{% endif %}
{% endblock %}