DrCr/drcr/templates/chart_of_accounts.html

72 lines
2.5 KiB
HTML

{# DrCr: Web-based double-entry bookkeeping framework
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
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 %}Chart of accounts{% endblock %}
{% block content %}
<h1 class="page-heading">
Chart of accounts
</h1>
<form method="POST">
<div class="my-2 py-2 flex gap-x-2 items-baseline bg-white sticky top-0">
<div>
<select class="mt-2 bordered-field pl-3 pr-10" name="kind">
{% for plugin_name, plugin_account_kinds in account_kinds_by_plugin.items() %}
<optgroup label="{{ plugin_name }}">
{% for account_kind in plugin_account_kinds %}
<option value="{{ account_kind[0] }}">{{ account_kind[1] }}</option>
{% endfor %}
</optgroup>
{% endfor %}
</select>
</div>
<div>
<button formaction="{{ url_for('account_add_kind') }}" class="btn-primary" type="submit">Add type</button>
</div>
</div>
<table class="min-w-full">
<thead>
<tr>
<th></th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start">Account</th>
<th class="py-0.5 pl-1 text-gray-900 font-semibold text-start">Associated types</th>
</tr>
</thead>
<tbody>
{% for account in accounts %}
<tr class="border-t border-gray-300">
<td class="py-0.5 pr-1 text-gray-900 align-baseline"><input class="checkbox-primary" type="checkbox" name="sel-account" value="{{ account }}"></td>
<td class="py-0.5 px-1 text-gray-900 align-baseline">{{ account }}</td>
<td class="py-0.5 pl-1 text-gray-900 align-baseline">
{% if account in account_configurations %}
<ul class="list-disc ml-5">
{% for account_configuration in account_configurations[account] %}
<li>{{ account_kinds_map[account_configuration.kind] }}</li>
{% endfor %}
</ul>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</form>
{% endblock %}