DrCr/drcr/templates/chart_of_accounts.html
2023-01-04 18:01:59 +11:00

71 lines
2.2 KiB
HTML

{# DrCr: Web-based double-entry bookkeeping framework
Copyright (C) 2022–2023 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="h2 mt-4 mb-2">Chart of accounts</h1>
<form method="POST">
<div class="d-flex py-2 bg-white sticky-top">
<div class="me-2">
<select class="form-select" name="kind">
<option value="drcr.asset">Asset</option>
<option value="drcr.liability">Liability</option>
<option value="drcr.income">Income</option>
<option value="drcr.expense">Expense</option>
<option value="drcr.equity">Equity</option>
{% for account_kind in account_kinds %}
<option value="{{ account_kind[0] }}">{{ account_kind[1] }}</option>
{% endfor %}
</select>
</div>
<div>
<button type="submit" class="btn btn-primary" formaction="/chart-of-accounts/add-kind">Add kind</button>
</div>
</div>
<table class="table">
<thead>
<tr>
<th></th>
<th>Account</th>
<th>Associated types</th>
</tr>
</thead>
<tbody>
{% for account in accounts %}
<tr>
<td><input type="checkbox" name="sel-account" value="{{ account }}"></td>
<td>{{ account }}</td>
<td>
{% if account in account_configurations %}
<ul class="mb-0">
{% for account_configuration in account_configurations[account] %}
<li>{{ account_configuration.kind }}</li>
{% endfor %}
</ul>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</form>
{% endblock %}