Convert trial balance report to Tailwind CSS

This commit is contained in:
RunasSudo 2024-04-04 11:01:48 +11:00
parent 0b0ba703e0
commit 89e177983e
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -1,5 +1,5 @@
{# DrCr: Web-based double-entry bookkeeping framework
Copyright (C) 2022 Lee Yingtong Li (RunasSudo)
Copyright (C) 2022–2024 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
@ -15,32 +15,34 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
#}
{% extends 'base.html' %}
{% extends 'base_tailwind.html' %}
{% block title %}Trial balance{% endblock %}
{% block content %}
<h1 class="h2 my-4">Trial balance</h1>
<h1 class="text-3xl text-gray-900 mb-4">
Trial balance
</h1>
<table class="table">
<table class="min-w-full">
<thead>
<tr>
<th>Account</th>
<th class="text-end">Dr</th>
<th class="text-end">Cr</th>
<tr class="border-b border-gray-300">
<th class="py-0.5 text-gray-900 font-semibold text-start">Account</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Dr</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Cr</th>
</tr>
</thead>
<tbody>
{% for name, balance in accounts.items() %}
<tr>
<td><a href="{{ url_for('account_transactions', account=name) }}">{{ name }}</a></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>
<td class="py-0.5 text-gray-900"><a href="{{ url_for('account_transactions', account=name) }}" class="hover:text-blue-700 hover:underline">{{ name }}</a></td>
<td class="py-0.5 text-gray-900 text-end">{{ balance.format() if balance.quantity >= 0 else '' }}</td>
<td class="py-0.5 text-gray-900 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>
<th class="py-0.5 text-gray-900 font-semibold text-start">Total</th>
<th class="py-0.5 text-gray-900 text-end">{{ total_dr.format() }}</th>
<th class="py-0.5 text-gray-900 text-end">{{ (total_cr|abs).format() }}</th>
</tr>
</tbody>
</table>