DrCr/drcr/templates/journal/journal.html

69 lines
2.6 KiB
HTML
Raw Normal View History

2022-12-24 12:31:45 +11:00
{# DrCr: Web-based double-entry bookkeeping framework
2023-01-02 18:08:30 +11:00
Copyright (C) 2022–2023 Lee Yingtong Li (RunasSudo)
2022-12-24 12:31:45 +11:00
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' %}
2023-01-02 18:08:30 +11:00
{% block title %}Journal{% endblock %}
2022-12-24 12:31:45 +11:00
2022-12-24 16:57:53 +11:00
{% block content %}
2023-01-02 18:08:30 +11:00
<h1 class="h2 my-4">Journal</h1>
2022-12-24 16:57:53 +11:00
<div class="mb-2">
2023-01-02 18:08:30 +11:00
{#<a href="/journal/new-transaction" class="btn btn-primary"><i class="bi bi-plus-lg"></i> New transaction</a>#}
2022-12-25 17:31:31 +11:00
{% if commodity_detail %}
<a href="?commodity-detail=0" class="btn btn-outline-secondary">Hide commodity detail</a>
{% else %}
<a href="?commodity-detail=1" class="btn btn-outline-secondary">Show commodity detail</a>
{% endif %}
</div>
2022-12-24 16:57:53 +11:00
<table class="table">
<thead>
<tr>
<th>Date</th>
<th colspan="3">Description</th>
<th class="text-end">Dr</th>
<th class="text-end">Cr</th>
2022-12-24 16:57:53 +11:00
</tr>
</thead>
<tbody>
{% for transaction in transactions %}
2022-12-24 12:31:45 +11:00
<tr>
2022-12-24 16:57:53 +11:00
<td>{{ transaction.dt.strftime('%Y-%m-%d') }}</td>
<td colspan="3">{{ transaction.description }} <a href="/journal/edit-transaction?id={{ transaction.id }}"><i class="bi bi-pencil text-muted"></i></a></td>
2022-12-24 16:57:53 +11:00
<td></td>
<td></td>
2022-12-24 12:31:45 +11:00
</tr>
2022-12-24 16:57:53 +11:00
{% for posting in transaction.postings %}
2022-12-24 12:31:45 +11:00
<tr>
<td></td>
2022-12-24 16:57:53 +11:00
<td>{{ posting.description or '' }}</td>
<td class="text-end"><i>{{ 'Dr' if posting.quantity >= 0 else 'Cr' }}</i></td>
<td>{{ posting.account }}</td>
2022-12-25 17:31:31 +11:00
{% if commodity_detail %}
<td class="text-end">{{ posting.amount().format(True) if posting.quantity >= 0 else '' }}</td>
<td class="text-end">{{ (posting.amount()|abs).format(True) if posting.quantity < 0 else '' }}</td>
{% else %}
<td class="text-end">{{ posting.amount().as_cost().format() if posting.quantity >= 0 else '' }}</td>
<td class="text-end">{{ (posting.amount()|abs).as_cost().format() if posting.quantity < 0 else '' }}</td>
{% endif %}
2022-12-24 12:31:45 +11:00
</tr>
{% endfor %}
2022-12-24 16:57:53 +11:00
{% endfor %}
</tbody>
</table>
2022-12-24 12:31:45 +11:00
{% endblock %}