DrCr/drcr/templates/trial_balance.html

50 lines
1.6 KiB
HTML
Raw Normal View History

2022-12-24 12:31:45 +11:00
{# DrCr: Web-based double-entry bookkeeping framework
Copyright (C) 2022 Lee Yingtong Li (RunasSudo)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
#}
{% extends 'base.html' %}
{% block title %}Trial balance{% endblock %}
{% block body %}
<div class="container">
<h1 class="h2 mt-4 mb-4">Trial balance</h1>
<table class="table">
<thead>
<tr>
<th>Account</th>
<th class="text-end">Dr</th>
<th class="text-end">Cr</th>
</tr>
</thead>
<tbody>
{% for name, balance in accounts.items() %}
<tr>
<td>{{ name }}</td>
<td class="text-end">{{ balance.format() if balance.quantity >= 0 else '' }}</td>
<td class="text-end">{{ (balance|abs).format() if balance.quantity < 0 else '' }}</td>
</tr>
{% endfor %}
<tr>
<th>Total</th>
<th class="text-end">{{ total_dr.format() }}</th>
<th class="text-end">{{ (total_cr|abs).format() }}</th>
</tr>
</tbody>
</table>
</div>
{% endblock %}