Standardise table padding

This commit is contained in:
RunasSudo 2024-04-06 02:28:52 +11:00
parent d715128bfb
commit d86c1c3f02
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
11 changed files with 137 additions and 137 deletions

View File

@ -41,29 +41,29 @@
<table class="min-w-full">
<thead>
<tr class="border-b border-gray-300">
<th class="py-0.5 pr-2 text-gray-900 font-semibold text-start">Account</th>
<th class="py-0.5 pr-2 text-gray-900 font-semibold text-start">Asset</th>
<th class="py-0.5 pr-2 text-gray-900 font-semibold text-end">Units</th>
<th class="py-0.5 pr-2 text-gray-900 font-semibold text-start">Acquisition date</th>
<th class="py-0.5 pr-2 text-gray-900 font-semibold text-end">Acquisition value</th>
<th class="py-0.5 pr-2 text-gray-900 font-semibold text-start">Adjustment date</th>
<th class="py-0.5 pr-2 text-gray-900 font-semibold text-start">Description</th>
<th class="py-0.5 pr-2 text-gray-900 font-semibold text-end">Cost adjustment&nbsp;</th>
<th class="py-0.5 pr-1 text-gray-900 font-semibold text-start">Account</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start">Asset</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Units</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start">Acquisition date</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Acquisition value</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start">Adjustment date</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start">Description</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Cost adjustment&nbsp;</th>
<th></th>
</tr>
</thead>
<tbody>
{% for cgt_adjustment in cgt_adjustments %}
<tr>
<td class="py-0.5 pr-2 text-gray-900">{{ cgt_adjustment.account }}</td>
<td class="py-0.5 pr-2 text-gray-900">{{ cgt_adjustment.asset().commodity_name() }}</td>
<td class="py-0.5 pr-2 text-gray-900 text-end">{{ cgt_adjustment.asset().format('hide') }}</td>
<td class="py-0.5 pr-2 text-gray-900">{{ cgt_adjustment.acquisition_date.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 pr-2 text-gray-900 text-end">{{ cgt_adjustment.asset().as_cost().format() }}</td>
<td class="py-0.5 pr-2 text-gray-900">{{ cgt_adjustment.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 pr-2 text-gray-900">{{ cgt_adjustment.description }}</td>
<td class="py-0.5 pr-2 text-gray-900 text-end">{{ cgt_adjustment.cost_adjustment_amount().format_accounting() }}</td>
<td class="py-0.5 text-end">
<td class="py-0.5 pr-1 text-gray-900">{{ cgt_adjustment.account }}</td>
<td class="py-0.5 px-1 text-gray-900">{{ cgt_adjustment.asset().commodity_name() }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ cgt_adjustment.asset().format('hide') }}</td>
<td class="py-0.5 px-1 text-gray-900">{{ cgt_adjustment.acquisition_date.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ cgt_adjustment.asset().as_cost().format() }}</td>
<td class="py-0.5 px-1 text-gray-900">{{ cgt_adjustment.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 px-1 text-gray-900">{{ cgt_adjustment.description }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ cgt_adjustment.cost_adjustment_amount().format_accounting() }}</td>
<td class="py-0.5 pl-1 text-end">
<a href="{{ url_for('cgt_adjustment_edit', id=cgt_adjustment.id) }}" 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 inline align-middle -mt-0.5">
<path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125" />

View File

@ -45,16 +45,16 @@
<thead>
<tr>
<th></th>
<th class="py-0.5 text-gray-900 font-semibold text-start">Account</th>
<th class="py-0.5 text-gray-900 font-semibold text-start">Associated types</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 text-gray-900 align-baseline"><input class="checkbox-primary" type="checkbox" name="sel-account" value="{{ account }}"></td>
<td class="py-0.5 text-gray-900 align-baseline">{{ account }}</td>
<td class="py-0.5 text-gray-900 align-baseline">
<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] %}

View File

@ -38,32 +38,32 @@
<table class="min-w-full">
<thead>
<tr>
<th class="py-0.5 text-gray-900 font-semibold text-start">Date</th>
<th class="py-0.5 text-gray-900 font-semibold text-start" colspan="3">Description</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Dr</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Cr</th>
<th class="py-0.5 pr-1 text-gray-900 font-semibold text-start">Date</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start" colspan="3">Description</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Dr</th>
<th class="py-0.5 pl-1 text-gray-900 font-semibold text-end">Cr</th>
</tr>
</thead>
<tbody>
{% for transaction in transactions %}
<tr class="border-t border-gray-300">
<td class="py-0.5 text-gray-900">{{ transaction.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 text-gray-900" colspan="3">{{ transaction.description }}</td>
<td class="py-0.5 pr-1 text-gray-900">{{ transaction.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 px-1 text-gray-900" colspan="3">{{ transaction.description }}</td>
<td></td>
<td></td>
</tr>
{% for posting in transaction.postings %}
<tr>
<td></td>
<td class="py-0.5 text-gray-900">{{ posting.description or '' }}</td>
<td class="py-0.5 pr-2 text-gray-900 text-end"><i>{{ 'Dr' if posting.quantity >= 0 else 'Cr' }}</i></td>
<td class="py-0.5 text-gray-900">{{ posting.account }}</td>
<td class="py-0.5 px-1 text-gray-900">{{ posting.description or '' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end"><i>{{ 'Dr' if posting.quantity >= 0 else 'Cr' }}</i></td>
<td class="py-0.5 px-1 text-gray-900">{{ posting.account }}</td>
{% if commodity_detail %}
<td class="py-0.5 text-gray-900 text-end">{{ posting.amount().format('force') if posting.quantity >= 0 else '' }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ (posting.amount()|abs).format('force') if posting.quantity < 0 else '' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ posting.amount().format('force') if posting.quantity >= 0 else '' }}</td>
<td class="py-0.5 pl-1 text-gray-900 text-end">{{ (posting.amount()|abs).format('force') if posting.quantity < 0 else '' }}</td>
{% else %}
<td class="py-0.5 text-gray-900 text-end">{{ posting.amount().as_cost().format() if posting.quantity >= 0 else '' }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ (posting.amount()|abs).as_cost().format() if posting.quantity < 0 else '' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ posting.amount().as_cost().format() if posting.quantity >= 0 else '' }}</td>
<td class="py-0.5 pl-1 text-gray-900 text-end">{{ (posting.amount()|abs).as_cost().format() if posting.quantity < 0 else '' }}</td>
{% endif %}
</tr>
{% endfor %}

View File

@ -35,24 +35,24 @@
<table class="min-w-full">
<thead>
<tr class="border-b border-gray-300">
<th class="py-0.5 text-gray-900 font-semibold text-start">Date</th>
<th class="py-0.5 text-gray-900 font-semibold text-start">Description</th>
<th class="py-0.5 text-gray-900 font-semibold text-start">Account</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Balance</th>
<th class="py-0.5 pr-1 text-gray-900 font-semibold text-start">Date</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start">Description</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start">Account</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Balance</th>
<th></th>
<th class="py-0.5 text-gray-900 font-semibold text-start">Status</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start">Status</th>
<th></th>
</tr>
</thead>
<tbody>
{% for assertion in assertions %}
<tr>
<td class="py-0.5 text-gray-900">{{ assertion.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 text-gray-900">{{ assertion.description }}</td>
<td class="py-0.5 text-gray-900">{{ assertion.account }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ (assertion.balance()|abs).format() }}</td>
<td class="py-0.5 pl-1 text-gray-900">{{ 'Dr' if assertion.quantity >= 0 else 'Cr' }}</td>
<td class="py-0.5 text-gray-900">
<td class="py-0.5 pr-1 text-gray-900">{{ assertion.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 px-1 text-gray-900">{{ assertion.description }}</td>
<td class="py-0.5 px-1 text-gray-900">{{ assertion.account }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ (assertion.balance()|abs).format() }}</td>
<td class="py-0.5 pr-1 text-gray-900">{{ 'Dr' if assertion.quantity >= 0 else 'Cr' }}</td>
<td class="py-0.5 px-1 text-gray-900">
{% if assertion_status[assertion] %}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="w-4 h-4">
<path fill-rule="evenodd" d="M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z" clip-rule="evenodd" />
@ -63,7 +63,7 @@
</svg>
{% endif %}
</td>
<td class="py-0.5 text-gray-900 text-end">
<td class="py-0.5 pl-1 text-gray-900 text-end">
<a href="{{ url_for('balance_assertions_edit', id=assertion.id) }}" 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 inline align-middle -mt-0.5">
<path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125" />

View File

@ -44,17 +44,17 @@
<table class="min-w-full">
<thead>
<tr>
<th class="py-0.5 text-gray-900 font-semibold text-start">Date</th>
<th class="py-0.5 text-gray-900 font-semibold text-start" colspan="3">Description</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Dr</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Cr</th>
<th class="py-0.5 pr-1 text-gray-900 font-semibold text-start">Date</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start" colspan="3">Description</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Dr</th>
<th class="py-0.5 pl-1 text-gray-900 font-semibold text-end">Cr</th>
</tr>
</thead>
<tbody>
{% for transaction in transactions %}
<tr class="border-t border-gray-300">
<td class="py-0.5 text-gray-900">{{ transaction.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 text-gray-900" colspan="3">
<td class="py-0.5 pr-1 text-gray-900">{{ transaction.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 px-1 text-gray-900" colspan="3">
{{ transaction.description }}
<a href="{{ url_for('journal_edit_transaction', id=transaction.id) }}" 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 inline align-middle -mt-0.5">
@ -68,15 +68,15 @@
{% for posting in transaction.postings %}
<tr>
<td></td>
<td class="py-0.5 text-gray-900">{{ posting.description or '' }}</td>
<td class="py-0.5 pr-2 text-gray-900 text-end"><i>{{ 'Dr' if posting.quantity >= 0 else 'Cr' }}</i></td>
<td class="py-0.5 text-gray-900">{{ posting.account }}</td>
<td class="py-0.5 px-1 text-gray-900">{{ posting.description or '' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end"><i>{{ 'Dr' if posting.quantity >= 0 else 'Cr' }}</i></td>
<td class="py-0.5 px-1 text-gray-900">{{ posting.account }}</td>
{% if commodity_detail %}
<td class="py-0.5 text-gray-900 text-end">{{ posting.amount().format('force') if posting.quantity >= 0 else '' }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ (posting.amount()|abs).format('force') if posting.quantity < 0 else '' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ posting.amount().format('force') if posting.quantity >= 0 else '' }}</td>
<td class="py-0.5 pl-1 text-gray-900 text-end">{{ (posting.amount()|abs).format('force') if posting.quantity < 0 else '' }}</td>
{% else %}
<td class="py-0.5 text-gray-900 text-end">{{ posting.amount().as_cost().format() if posting.quantity >= 0 else '' }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ (posting.amount()|abs).as_cost().format() if posting.quantity < 0 else '' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ posting.amount().as_cost().format() if posting.quantity >= 0 else '' }}</td>
<td class="py-0.5 pl-1 text-gray-900 text-end">{{ (posting.amount()|abs).as_cost().format() if posting.quantity < 0 else '' }}</td>
{% endif %}
</tr>
{% endfor %}

View File

@ -21,7 +21,7 @@
{% macro render_section(section) %}
{% if section.title %}
<tr>
<th class="py-0.5 text-gray-900 font-semibold text-start">{{ section.title }}</th>
<th class="py-0.5 pr-1 text-gray-900 font-semibold text-start">{{ section.title }}</th>
<th></th>
</tr>
{% endif %}
@ -36,21 +36,21 @@
{{ render_section(entry) }}
{% elif entry.__class__.__name__ == 'Subtotal' %}
<tr{% if entry.bordered %} class="border-y border-gray-300"{% endif %}>
<th class="py-0.5 text-gray-900 font-semibold text-start">{{ entry.text }}</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">{{ entry.amount.format_accounting() }}</th>
<th class="py-0.5 pr-1 text-gray-900 font-semibold text-start">{{ entry.text }}</th>
<th class="py-0.5 pl-1 text-gray-900 font-semibold text-end">{{ entry.amount.format_accounting() }}</th>
</tr>
{% elif entry.__class__.__name__ == 'Spacer' %}
<tr><td colspan="2" class="py-0.5">&nbsp;</td></tr>
{% else %}
<tr{% if entry.bordered %} class="border-y border-gray-300"{% endif %}>
{% if entry.heading %}<th class="py-0.5 text-gray-900 font-semibold text-start">{% else %}<td class="py-0.5 text-gray-900 text-start">{% endif %}
{% if entry.heading %}<th class="py-0.5 pr-1 text-gray-900 font-semibold text-start">{% else %}<td class="py-0.5 pr-1 text-gray-900 text-start">{% endif %}
{% if entry.link %}
<a href="{{ entry.link }}" class="hover:text-blue-700 hover:underline">{{ entry.text }}</a>
{% else %}
{{ entry.text }}
{% endif %}
</{{ 'th' if entry.heading else 'td' }}>
{% if entry.heading %}<th class="py-0.5 text-gray-900 font-semibold text-end">{% else %}<td class="py-0.5 text-gray-900 text-end">{% endif %}
{% if entry.heading %}<th class="py-0.5 pl-1 text-gray-900 font-semibold text-end">{% else %}<td class="py-0.5 pl-1 text-gray-900 text-end">{% endif %}
{{ entry.amount.format_accounting() }}
</{{ 'th' if entry.heading else 'td' }}>
</tr>
@ -67,7 +67,7 @@
<thead>
<tr class="border-b border-gray-300">
<th></th>
<th class="py-0.5 text-gray-900 font-semibold text-end">$&nbsp;</th>
<th class="py-0.5 pl-1 text-gray-900 font-semibold text-end">$&nbsp;</th>
</tr>
</thead>
<tbody>

View File

@ -26,21 +26,21 @@
<table class="min-w-full">
<thead>
<tr class="border-b border-gray-300">
<th class="py-0.5 text-gray-900 font-semibold text-start">Date</th>
<th class="py-0.5 text-gray-900 font-semibold text-start">Description</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Dr</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Cr</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Balance</th>
<th class="py-0.5 pr-1 text-gray-900 font-semibold text-start">Date</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start">Description</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Dr</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Cr</th>
<th class="py-0.5 pl-1 text-gray-900 font-semibold text-end">Balance</th>
</tr>
</thead>
<tbody>
{% for line in statement_lines %}
<tr>
<td class="py-0.5 text-gray-900">{{ line.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 text-gray-900">{{ line.description }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ line.amount().format() if line.quantity >= 0 else '' }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ (line.amount()|abs).format() if line.quantity < 0 else '' }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ line.balance or '' }}</td>
<td class="py-0.5 pr-1 text-gray-900">{{ line.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 px-1 text-gray-900">{{ line.description }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ line.amount().format() if line.quantity >= 0 else '' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ (line.amount()|abs).format() if line.quantity < 0 else '' }}</td>
<td class="py-0.5 pl-1 text-gray-900 text-end">{{ line.balance or '' }}</td>
</tr>
{% endfor %}
</tbody>

View File

@ -71,23 +71,23 @@
<thead>
<tr class="border-b border-gray-300">
<th></th>
<th class="py-0.5 pr-2 align-bottom text-gray-900 font-semibold text-start">Source account</th>
<th class="py-0.5 pr-2 align-bottom text-gray-900 font-semibold text-start">Date</th>
<th class="py-0.5 pr-2 align-bottom text-gray-900 font-semibold text-start">Description</th>
<th class="py-0.5 pr-2 align-bottom text-gray-900 font-semibold text-start">Charged to</th>
<th class="py-0.5 pr-2 align-bottom text-gray-900 font-semibold text-end">Dr</th>
<th class="py-0.5 pr-2 align-bottom text-gray-900 font-semibold text-end">Cr</th>
<th class="py-0.5 align-bottom text-gray-900 font-semibold text-end">Balance</th>
<th class="py-0.5 px-1 align-bottom text-gray-900 font-semibold text-start">Source account</th>
<th class="py-0.5 px-1 align-bottom text-gray-900 font-semibold text-start">Date</th>
<th class="py-0.5 px-1 align-bottom text-gray-900 font-semibold text-start">Description</th>
<th class="py-0.5 px-1 align-bottom text-gray-900 font-semibold text-start">Charged to</th>
<th class="py-0.5 px-1 align-bottom text-gray-900 font-semibold text-end">Dr</th>
<th class="py-0.5 px-1 align-bottom text-gray-900 font-semibold text-end">Cr</th>
<th class="py-0.5 pl-1 align-bottom text-gray-900 font-semibold text-end">Balance</th>
</tr>
</thead>
<tbody>
{% for line in page.items %}
<tr data-line-id="{{ line.id }}">
<td class="py-0.5 pr-2 align-baseline"><input class="checkbox-primary" type="checkbox" name="sel-line-id" value="{{ line.id }}"></td>
<td class="py-0.5 pr-2 align-baseline text-gray-900"><a href="{{ url_for('statement_lines', account=line.source_account) }}" class="hover:text-blue-700 hover:underline">{{ line.source_account }}</a></td>
<td class="py-0.5 pr-2 align-baseline text-gray-900">{{ line.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 pr-2 align-baseline text-gray-900">{{ line.description }}</td>
<td class="charge-account py-0.5 pr-2 align-baseline text-gray-900">
<td class="py-0.5 pr-1 align-baseline"><input class="checkbox-primary" type="checkbox" name="sel-line-id" value="{{ line.id }}"></td>
<td class="py-0.5 px-1 align-baseline text-gray-900"><a href="{{ url_for('statement_lines', account=line.source_account) }}" class="hover:text-blue-700 hover:underline">{{ line.source_account }}</a></td>
<td class="py-0.5 px-1 align-baseline text-gray-900">{{ line.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 px-1 align-baseline text-gray-900">{{ line.description }}</td>
<td class="charge-account py-0.5 px-1 align-baseline text-gray-900">
{% if not line.reconciliation %}
<a href="#" class="text-red-500 hover:text-red-600 hover:underline" onclick="classifyLine({{ line.id }});return false;">Unclassified</a>
<a href="{{ url_for('statement_line_charge_complex') }}?line-id={{ line.id }}" class="text-gray-500 hover:text-gray-700">
@ -113,9 +113,9 @@
</a>
{% endif %}
</td>
<td class="py-0.5 pr-2 align-baseline text-gray-900 text-end">{{ line.amount().format() if line.quantity >= 0 else '' }}</td>
<td class="py-0.5 pr-2 align-baseline text-gray-900 text-end">{{ (line.amount()|abs).format() if line.quantity < 0 else '' }}</td>
<td class="py-0.5 align-baseline text-gray-900 text-end">{{ line.balance or '' }}</td>
<td class="py-0.5 px-1 align-baseline text-gray-900 text-end">{{ line.amount().format() if line.quantity >= 0 else '' }}</td>
<td class="py-0.5 px-1 align-baseline text-gray-900 text-end">{{ (line.amount()|abs).format() if line.quantity < 0 else '' }}</td>
<td class="py-0.5 pl-1 align-baseline text-gray-900 text-end">{{ line.balance or '' }}</td>
</tr>
{% endfor %}
</tbody>

View File

@ -38,12 +38,12 @@
<table class="min-w-full">
<thead>
<tr>
<th class="py-0.5 text-gray-900 font-semibold text-start">Date</th>
<th class="py-0.5 text-gray-900 font-semibold text-start">Description</th>
<th class="py-0.5 text-gray-900 font-semibold text-start">Related Account</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Dr</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Cr</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Balance</th>
<th class="py-0.5 pr-1 text-gray-900 font-semibold text-start">Date</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start">Description</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start">Related Account</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Dr</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Cr</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Balance</th>
<th></th>
</tr>
</thead>
@ -52,8 +52,8 @@
{% if transaction.postings|length == 2 %}
{% for posting in transaction.postings if posting.account == account %}
<tr class="border-t border-gray-300">
<td class="py-0.5 text-gray-900">{{ transaction.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 text-gray-900">
<td class="py-0.5 pr-1 text-gray-900">{{ transaction.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 px-1 text-gray-900">
{{ transaction.description }}
{% if transaction.id %}
<a href="{{ url_for('journal_edit_transaction', id=transaction.id) }}" class="text-gray-500 hover:text-gray-700">
@ -63,17 +63,17 @@
</a>
{% endif %}
</td>
<td class="py-0.5 text-gray-900">{% for p in transaction.postings if p.account != account %}{{ p.account }}{% endfor %}</td>
<td class="py-0.5 text-gray-900 text-end">{{ posting.amount().as_cost().format() if posting.quantity >= 0 else '' }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ (posting.amount()|abs).as_cost().format() if posting.quantity < 0 else '' }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ (running_totals[posting]|abs).format() }}</td>
<td class="py-0.5 pl-1 text-gray-900">{{ 'Dr' if running_totals[posting].quantity >= 0 else 'Cr' }}</td>
<td class="py-0.5 px-1 text-gray-900">{% for p in transaction.postings if p.account != account %}{{ p.account }}{% endfor %}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ posting.amount().as_cost().format() if posting.quantity >= 0 else '' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ (posting.amount()|abs).as_cost().format() if posting.quantity < 0 else '' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ (running_totals[posting]|abs).format() }}</td>
<td class="py-0.5 text-gray-900">{{ 'Dr' if running_totals[posting].quantity >= 0 else 'Cr' }}</td>
</tr>
{% endfor %}
{% else %}
<tr class="border-t border-gray-300">
<td class="py-0.5 text-gray-900">{{ transaction.dt.strftime('%Y-%m-%d') }}</td>
<td colspan="2" class="py-0.5 text-gray-900">
<td class="py-0.5 pr-1 text-gray-900">{{ transaction.dt.strftime('%Y-%m-%d') }}</td>
<td colspan="2" class="py-0.5 px-1 text-gray-900">
{{ transaction.description }}
{% if transaction.id %}
<a href="{{ url_for('journal_edit_transaction', id=transaction.id) }}" class="text-gray-500 hover:text-gray-700">
@ -91,21 +91,21 @@
{% for posting in transaction.postings if posting.account == account %}
<tr>
<td></td>
<td class="py-0.5 pr-2 text-gray-900 text-end"><i>{{ 'Dr' if posting.quantity >= 0 else 'Cr' }}</i></td>
<td class="py-0.5 text-gray-900">{{ account }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ posting.amount().as_cost().format() if posting.quantity >= 0 else '' }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ (posting.amount()|abs).as_cost().format() if posting.quantity < 0 else '' }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ (running_totals[posting]|abs).format() }}</td>
<td class="py-0.5 pl-1 text-gray-900">{{ 'Dr' if running_totals[posting].quantity >= 0 else 'Cr' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end"><i>{{ 'Dr' if posting.quantity >= 0 else 'Cr' }}</i></td>
<td class="py-0.5 px-1 text-gray-900">{{ account }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ posting.amount().as_cost().format() if posting.quantity >= 0 else '' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ (posting.amount()|abs).as_cost().format() if posting.quantity < 0 else '' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ (running_totals[posting]|abs).format() }}</td>
<td class="py-0.5 text-gray-900">{{ 'Dr' if running_totals[posting].quantity >= 0 else 'Cr' }}</td>
</tr>
{% endfor %}
{% for posting in transaction.postings if posting.account != account %}
<tr>
<td></td>
<td class="py-0.5 pr-2 text-gray-900 text-end"><i>{{ 'Dr' if posting.quantity >= 0 else 'Cr' }}</i></td>
<td class="py-0.5 text-gray-900">{{ posting.account }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ posting.amount().as_cost().format() if posting.quantity >= 0 else '' }}</td>
<td class="py-0.5 pl-1 text-gray-900 text-end">{{ (posting.amount()|abs).as_cost().format() if posting.quantity < 0 else '' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end"><i>{{ 'Dr' if posting.quantity >= 0 else 'Cr' }}</i></td>
<td class="py-0.5 px-1 text-gray-900">{{ posting.account }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ posting.amount().as_cost().format() if posting.quantity >= 0 else '' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ (posting.amount()|abs).as_cost().format() if posting.quantity < 0 else '' }}</td>
<td></td>
<td></td>
</tr>

View File

@ -38,19 +38,19 @@
<table class="min-w-full">
<thead>
<tr>
<th class="py-0.5 text-gray-900 font-semibold text-start">Date</th>
<th class="py-0.5 text-gray-900 font-semibold text-start">Description</th>
<th class="py-0.5 pr-1 text-gray-900 font-semibold text-start">Date</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-start">Description</th>
<th></th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Amount</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Balance</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Amount</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Balance</th>
<th></th>
</tr>
</thead>
<tbody>
{% for transaction in transactions %}
<tr class="border-t border-gray-300">
<td class="py-0.5 text-gray-900">{{ transaction.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 text-gray-900">
<td class="py-0.5 pr-1 text-gray-900">{{ transaction.dt.strftime('%Y-%m-%d') }}</td>
<td class="py-0.5 px-1 text-gray-900">
{{ transaction.description }}
{% if transaction.id %}
<a href="{{ url_for('journal_edit_transaction', id=transaction.id) }}" class="text-gray-500 hover:text-gray-700">
@ -71,10 +71,10 @@
<tr>
<td></td>
<td></td>
<td class="py-0.5 text-gray-900 text-end">{{ 'Dr' if posting.quantity >= 0 else 'Cr' }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ (posting.amount()|abs).format('force') }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ (amount|abs).format('force') }}</td>
<td class="py-0.5 pl-1 text-gray-900">{{ 'Dr' if amount.quantity >= 0 else 'Cr' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ 'Dr' if posting.quantity >= 0 else 'Cr' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ (posting.amount()|abs).format('force') }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ (amount|abs).format('force') }}</td>
<td class="py-0.5 text-gray-900">{{ 'Dr' if amount.quantity >= 0 else 'Cr' }}</td>
</tr>
{% else %}
<tr>
@ -82,8 +82,8 @@
<td></td>
<td></td>
<td></td>
<td class="py-0.5 text-gray-900 text-end">{{ (amount|abs).format('force') }}</td>
<td class="py-0.5 pl-1 text-gray-900">{{ 'Dr' if amount.quantity >= 0 else 'Cr' }}</td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ (amount|abs).format('force') }}</td>
<td class="py-0.5 text-gray-900">{{ 'Dr' if amount.quantity >= 0 else 'Cr' }}</td>
</tr>
{% endfor %}
{% endfor %}

View File

@ -26,23 +26,23 @@
<table class="min-w-full">
<thead>
<tr class="border-b border-gray-300">
<th class="py-0.5 text-gray-900 font-semibold text-start">Account</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Dr</th>
<th class="py-0.5 text-gray-900 font-semibold text-end">Cr</th>
<th class="py-0.5 pr-1 text-gray-900 font-semibold text-start">Account</th>
<th class="py-0.5 px-1 text-gray-900 font-semibold text-end">Dr</th>
<th class="py-0.5 pl-1 text-gray-900 font-semibold text-end">Cr</th>
</tr>
</thead>
<tbody>
{% for name, balance in accounts.items() %}
<tr>
<td class="py-0.5 text-gray-900"><a href="{{ url_for('account_transactions', account=name) }}" class="hover:text-blue-700 hover:underline">{{ name }}</a></td>
<td class="py-0.5 text-gray-900 text-end">{{ balance.format() if balance.quantity >= 0 else '' }}</td>
<td class="py-0.5 text-gray-900 text-end">{{ (balance|abs).format() if balance.quantity < 0 else '' }}</td>
<td class="py-0.5 pr-1 text-gray-900"><a href="{{ url_for('account_transactions', account=name) }}" class="hover:text-blue-700 hover:underline">{{ name }}</a></td>
<td class="py-0.5 px-1 text-gray-900 text-end">{{ balance.format() if balance.quantity >= 0 else '' }}</td>
<td class="py-0.5 pl-1 text-gray-900 text-end">{{ (balance|abs).format() if balance.quantity < 0 else '' }}</td>
</tr>
{% endfor %}
<tr>
<th class="py-0.5 text-gray-900 font-semibold text-start">Total</th>
<th class="py-0.5 text-gray-900 text-end">{{ total_dr.format() }}</th>
<th class="py-0.5 text-gray-900 text-end">{{ (total_cr|abs).format() }}</th>
<th class="py-0.5 pr-1 text-gray-900 font-semibold text-start">Total</th>
<th class="py-0.5 px-1 text-gray-900 text-end">{{ total_dr.format() }}</th>
<th class="py-0.5 pl-1 text-gray-900 text-end">{{ (total_cr|abs).format() }}</th>
</tr>
</tbody>
</table>