{# 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 %}CGT assets{% endblock %} {% block content %} <h1 class="h2 mt-4">CGT assets</h1> <table class="table"> <thead> <tr> <th style="border-bottom-width:0"></th> <th style="border-bottom-width:0"></th> <th style="border-bottom-width:0"></th> <th style="border-left-width:1px" colspan="2">Acquisition</th> <th style="border-left-width:1px" colspan="2">Disposal</th> <th style="border-bottom-width:0;border-left-width:1px"></th> </tr> <tr> <th>Account</th> <th>Asset</th> <th class="text-end">Units</th> <th style="border-left-width:1px">Date</th> <th class="text-end">Value</th> <th style="border-left-width:1px">Date</th> <th class="text-end">Value</th> <th style="border-left-width:1px" class="text-end">Gain </th> </tr> </thead> <tbody> {% for asset in assets %} <tr> <td>{{ asset.account }}</td> <td>{{ asset.commodity_name() }}</td> <td class="text-end">{{ asset.format('hide') }}</td> <td style="border-left-width:1px">{{ asset.acquisition_date.strftime('%Y-%m-%d') }}</td> <td class="text-end">{{ asset.as_cost().format() }}</td> <td style="border-left-width:1px">{{ asset.disposal_date.strftime('%Y-%m-%d') if asset.disposal_date else '' }}</td> <td class="text-end">{{ asset.disposal_value.format() if asset.disposal_value else '' }}</td> <td style="border-left-width:1px" class="text-end">{% if asset.disposal_date %}{{ (asset.disposal_value - asset.as_cost()).format_accounting() }}{% endif %}</td> </tr> {% endfor %} </tbody> </table> {% endblock %}