mia-accounting-django/accounting/templates/accounting/trial-balance.html

170 lines
6.4 KiB
HTML

{% extends "base.html" %}
{% comment %}
The Mia Accounting Application
cash.html: The template for the cash account 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/19
{% endcomment %}
{% load static %}
{% load i18n %}
{% load humanize %}
{% load mia_core %}
{% load accounting %}
{% block settings %}
{% blocktrans asvar title with period=period.description context "Accounting|" %}Trial Balance in {{ period }}{% endblocktrans %}
{% setvar "title" title %}
{% setvar "use_period_chooser" True %}
{% static "accounting/css/report.css" as css %}
{% setvar "css" css %}
{% endblock %}
{% block content %}
<div class="btn-group btn-actions">
<div class="btn-group">
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<i class="fas fa-edit"></i>
{% trans "New" context "Accounting|" as text %}
{{ text|force_escape }}
</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "expense" %}">
{% trans "Cash Expense" context "Accounting|" as text %}
{{ text|force_escape }}
</a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "income" %}">
{% trans "Cash Income" context "Accounting|" as text %}
{{ text|force_escape }}
</a>
<a class="dropdown-item" href="{% url_with_return "accounting:transactions.create" "transfer" %}">
{% trans "Transfer" context "Accounting|" as text %}
{{ text|force_escape }}
</a>
</div>
</div>
{% with current_report_icon="fas fa-balance-scale-right" %}
{% trans "Trial Balance" context "Accounting|" as current_report_title %}
{% include "accounting/include/report-chooser.html" %}
{% endwith %}
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#period-modal">
<i class="far fa-calendar-alt"></i>
<span class="d-none d-md-inline">{{ period.description }}</span>
<span class="d-md-none">{% trans "Period" context "Period|" as text %}{{ text|force_escape }}</span>
</button>
</div>
{% include "mia_core/include/period-chooser.html" %}
{% if item_list %}
{% include "mia_core/include/pagination.html" %}
{# The table for large screens #}
<div class="d-none d-sm-block report-block report-block-lg">
<div class="row justify-content-center">
<h2>{{ title|force_escape }}</h2>
</div>
<div class="row">
<div class="col-sm-12">
<table class="table table-borderless table-hover trial-balance-table">
<thead>
<tr>
<th scope="col">{% trans "Account" context "Accounting|" as text %}{{ text|force_escape }}</th>
<th class="amount" scope="col">{% trans "Debit" context "Accounting|" as text %}{{ text|force_escape }}</th>
<th class="amount" scope="col">{% trans "Credit" context "Accounting|" as text %}{{ text|force_escape }}</th>
<th class="actions" scope="col">{% trans "View" context "Accounting|" as text %}{{ text|force_escape }}</th>
</tr>
</thead>
<tbody>
{% for item in item_list %}
<tr>
<td>{{ item.title }}</td>
<td class="amount">{{ item.debit|accounting_amount }}</td>
<td class="amount">{{ item.credit|accounting_amount }}</td>
<td class="actions">
<a href="{% url "accounting:ledger" item period %}" 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>
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td>{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}</td>
<td class="amount">{{ total_item.debit|accounting_amount }}</td>
<td class="amount">{{ total_item.credit|accounting_amount }}</td>
<td></td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
{# The list for mobile browsers #}
<div class="d-sm-none report-block report-block-sm">
<div class="row justify-content-center">
<h2>{{ title|force_escape }}</h2>
</div>
<div class="row">
<div class="col-sm-12">
<ul class="list-group d-lg-none trial-balance-list">
{% for item in item_list %}
<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.spec %}">
{{ item.title }}
<div>
{% if item.debit is not None %}
<span class="badge badge-success badge-pill">
{{ item.debit|intcomma:False }}
</span>
{% endif %}
{% if item.credit is not None %}
<span class="badge badge-warning badge-pill">
{{ item.credit|intcomma:False }}
</span>
{% endif %}
</div>
</a>
</li>
{% endfor %}
<li class="list-group-item d-flex justify-content-between align-items-center total">
{% trans "Total" context "Accounting|" as text %}{{ text|force_escape }}
<div>
<span class="badge badge-success badge-pill">
{{ total_item.debit|intcomma:False }}
</span>
<span class="badge badge-warning badge-pill">
{{ total_item.credit|intcomma:False }}
</span>
</div>
</li>
</ul>
</div>
</div>
</div>
{% else %}
<p>{{ _("There is currently no data.")|force_escape }}</p>
{% endif %}
{% endblock %}