Convert CGT assets report to Tailwind CSS
This commit is contained in:
parent
27c6087a53
commit
4b3ecc8320
@ -1,5 +1,5 @@
|
|||||||
{# DrCr: Web-based double-entry bookkeeping framework
|
{# DrCr: Web-based double-entry bookkeeping framework
|
||||||
Copyright (C) 2022–2023 Lee Yingtong Li (RunasSudo)
|
Copyright (C) 2022–2024 Lee Yingtong Li (RunasSudo)
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Affero General Public License as published by
|
||||||
@ -15,52 +15,62 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
#}
|
#}
|
||||||
|
|
||||||
{% extends 'base.html' %}
|
{% extends 'base_tailwind.html' %}
|
||||||
{% block title %}CGT assets{% endblock %}
|
{% block title %}CGT assets{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1 class="h2 mt-4">CGT assets</h1>
|
<h1 class="text-3xl text-gray-900">
|
||||||
|
CGT assets
|
||||||
|
</h1>
|
||||||
|
|
||||||
<table class="table">
|
<table class="min-w-full">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th style="border-bottom-width:0"></th>
|
<th></th>
|
||||||
<th style="border-bottom-width:0"></th>
|
<th></th>
|
||||||
<th style="border-bottom-width:0"></th>
|
<th></th>
|
||||||
<th style="border-left-width:1px" colspan="2">Acquisition</th>
|
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start border-l border-gray-300" colspan="2">Acquisition</th>
|
||||||
<th style="border-left-width:1px" colspan="2">Adjustment</th>
|
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start border-l border-gray-300" colspan="2">Adjustment</th>
|
||||||
<th class="d-print-none"></th>
|
<th class="print:hidden"></th>
|
||||||
<th style="border-left-width:1px" colspan="2">Disposal</th>
|
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start border-l border-gray-300" colspan="2">Disposal</th>
|
||||||
<th style="border-bottom-width:0;border-left-width:1px"></th>
|
<th class="border-l border-gray-300"></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Account</th>
|
<th class="py-0.5 text-gray-900 font-semibold text-start">Account</th>
|
||||||
<th>Asset</th>
|
<th class="py-0.5 text-gray-900 font-semibold text-start">Asset</th>
|
||||||
<th class="text-end">Units</th>
|
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Units</th>
|
||||||
<th style="border-left-width:1px">Date</th>
|
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start border-l border-gray-300">Date</th>
|
||||||
<th class="text-end">Value</th>
|
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Value</th>
|
||||||
<th style="border-left-width:1px" class="text-end">b/f </th>
|
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end border-l border-gray-300">b/f </th>
|
||||||
<th class="text-end">{{ eofy_date.year }}</th>
|
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">{{ eofy_date.year }}</th>
|
||||||
<th class="d-print-none"></th>
|
<th class="print:hidden"></th>
|
||||||
<th style="border-left-width:1px">Date</th>
|
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start border-l border-gray-300">Date</th>
|
||||||
<th class="text-end">Value</th>
|
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Value</th>
|
||||||
<th style="border-left-width:1px" class="text-end">Gain </th>
|
<th class="py-0.5 pl-1 text-gray-900 font-semibold text-end border-l border-gray-300">Gain </th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for asset in assets %}
|
{% for asset in assets %}
|
||||||
<tr>
|
<tr class="border-t border-gray-300">
|
||||||
<td><a href="{{ url_for('account_transactions', account=asset.account, commodity_detail=1) }}">{{ asset.account }}</a></td>
|
<td class="py-0.5 pr-1 text-gray-900">
|
||||||
<td>{{ asset.commodity_name() }}</td>
|
<a href="{{ url_for('account_transactions', account=asset.account, commodity_detail=1) }}" class="hover:text-blue-700 hover:underline">{{ asset.account }}</a>
|
||||||
<td class="text-end">{{ asset.format('hide') }}</td>
|
</td>
|
||||||
<td style="border-left-width:1px">{{ asset.acquisition_date.strftime('%Y-%m-%d') }}</td>
|
<td class="py-0.5 px-1 text-gray-900">{{ asset.commodity_name() }}</td>
|
||||||
<td class="text-end">{{ asset.as_cost().format() }}</td>
|
<td class="py-0.5 px-1 text-gray-900 text-end">{{ asset.format('hide') }}</td>
|
||||||
<td style="border-left-width:1px" class="text-end">{{ asset.cost_adjustment_brought_forward().format_accounting(link=url_for('cgt_adjustments', account=asset.account, commodity=asset.commodity, quantity=asset.quantity, acquisition_date=asset.acquisition_date.strftime('%Y-%m-%d'))) if asset.cost_adjustment_brought_forward().quantity != 0 }}</td>
|
<td class="py-0.5 px-1 text-gray-900 border-l border-gray-300">{{ asset.acquisition_date.strftime('%Y-%m-%d') }}</td>
|
||||||
<td class="text-end">{{ asset.cost_adjustment_current_period().format_accounting(link=url_for('cgt_adjustments', account=asset.account, commodity=asset.commodity, quantity=asset.quantity, acquisition_date=asset.acquisition_date.strftime('%Y-%m-%d'))) if asset.cost_adjustment_current_period().quantity != 0 }}</td>
|
<td class="py-0.5 px-1 text-gray-900 text-end">{{ asset.as_cost().format() }}</td>
|
||||||
<td class="text-center d-print-none"><a href="{{ url_for('cgt_adjustment_new', account=asset.account, asset=asset.quantity_string(), acquisition_date=asset.acquisition_date.strftime('%Y-%m-%d')) }}"><i class="bi bi-plus-lg text-muted"></i></a></td>
|
<td class="py-0.5 px-1 text-gray-900 text-end border-l border-gray-300">{{ asset.cost_adjustment_brought_forward().format_accounting(link=url_for('cgt_adjustments', account=asset.account, commodity=asset.commodity, quantity=asset.quantity, acquisition_date=asset.acquisition_date.strftime('%Y-%m-%d'))) if asset.cost_adjustment_brought_forward().quantity != 0 }}</td>
|
||||||
<td style="border-left-width:1px">{{ asset.disposal_date.strftime('%Y-%m-%d') if asset.disposal_date else '' }}</td>
|
<td class="py-0.5 px-1 text-gray-900 text-end">{{ asset.cost_adjustment_current_period().format_accounting(link=url_for('cgt_adjustments', account=asset.account, commodity=asset.commodity, quantity=asset.quantity, acquisition_date=asset.acquisition_date.strftime('%Y-%m-%d'))) if asset.cost_adjustment_current_period().quantity != 0 }}</td>
|
||||||
<td class="text-end">{{ asset.disposal_value.format() if asset.disposal_value else '' }}</td>
|
<td class="py-0.5 px-1 text-gray-900 text-center print:hidden">
|
||||||
<td style="border-left-width:1px" class="text-end">{% if asset.disposal_date %}{{ asset.gain().format_accounting() }}{% endif %}</td>
|
<a href="{{ url_for('cgt_adjustment_new', account=asset.account, asset=asset.quantity_string(), acquisition_date=asset.acquisition_date.strftime('%Y-%m-%d')) }}" class="text-gray-500 hover:text-gray-700">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15" />
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td class="py-0.5 px-1 text-gray-900 border-l border-gray-300">{{ asset.disposal_date.strftime('%Y-%m-%d') if asset.disposal_date else '' }}</td>
|
||||||
|
<td class="py-0.5 px-1 text-gray-900 text-end">{{ asset.disposal_value.format() if asset.disposal_value else '' }}</td>
|
||||||
|
<td class="py-0.5 pl-1 text-gray-900 text-end border-l border-gray-300">{% if asset.disposal_date %}{{ asset.gain().format_accounting() }}{% endif %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
Loading…
Reference in New Issue
Block a user