Improve formatting of transaction lists
This commit is contained in:
parent
d9a0b5d1b5
commit
456352c88f
@ -47,7 +47,7 @@
|
|||||||
{% set ns = namespace(balance=None) %}
|
{% set ns = namespace(balance=None) %}
|
||||||
{% if account %}
|
{% if account %}
|
||||||
{% set prevlink = '/transactions?' + {'date_end': (date_beg - timedelta(days=1)).strftime('%Y-%m-%d'), 'date_beg': date_beg.replace(year=date_beg.year-1).strftime('%Y-%m-%d'), 'account': account.name, 'cash': 'on' if cash else ''}|urlencode %}
|
{% set prevlink = '/transactions?' + {'date_end': (date_beg - timedelta(days=1)).strftime('%Y-%m-%d'), 'date_beg': date_beg.replace(year=date_beg.year-1).strftime('%Y-%m-%d'), 'account': account.name, 'cash': 'on' if cash else ''}|urlencode %}
|
||||||
<tr class="total">
|
<tr class="total trn-first trn-last">
|
||||||
<td><a href="{{ prevlink }}">{{ date_beg.strftime('%Y-%m-%d') }}</a></td>
|
<td><a href="{{ prevlink }}">{{ date_beg.strftime('%Y-%m-%d') }}</a></td>
|
||||||
<td><a href="{{ prevlink }}">Opening Balance</a></td>
|
<td><a href="{{ prevlink }}">Opening Balance</a></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
@ -70,7 +70,7 @@
|
|||||||
{% for posting in transaction.postings if posting.account != account %}
|
{% for posting in transaction.postings if posting.account != account %}
|
||||||
{% set amount = posting.exchange(report_commodity, transaction.date) %}
|
{% set amount = posting.exchange(report_commodity, transaction.date) %}
|
||||||
{% set trn_url = '/transaction?' + {'tid': transaction.id, 'cash': 'on' if cash else ''}|urlencode %}
|
{% set trn_url = '/transaction?' + {'tid': transaction.id, 'cash': 'on' if cash else ''}|urlencode %}
|
||||||
<tr>
|
<tr{% if loop.first and loop.last %} class="trn-first trn-last"{% elif loop.first %} class="trn-first"{% elif loop.last %} class="trn-last"{% endif %}>
|
||||||
<td>{% if loop.first %}{% if transaction.id %}<a href="{{ trn_url }}">{% endif %}{{ transaction.date.strftime('%Y-%m-%d') }}{% if transaction.id %}</a>{% endif %}{% endif %}</td>
|
<td>{% if loop.first %}{% if transaction.id %}<a href="{{ trn_url }}">{% endif %}{{ transaction.date.strftime('%Y-%m-%d') }}{% if transaction.id %}</a>{% endif %}{% endif %}</td>
|
||||||
<td>{% if loop.first %}{% if transaction.id %}<a href="{{ trn_url }}">{% endif %}{{ transaction.description }}{% if transaction.id %}</a>{% endif %}{% endif %}</td>
|
<td>{% if loop.first %}{% if transaction.id %}<a href="{{ trn_url }}">{% endif %}{{ transaction.description }}{% if transaction.id %}</a>{% endif %}{% endif %}</td>
|
||||||
<td><a href="/transactions?{{ {'date_end': date_end.strftime('%Y-%m-%d'), 'date_beg': date_beg.strftime('%Y-%m-%d'), 'account': posting.account.name, 'cash': 'on' if cash else ''}|urlencode }}">{{ (posting.account.name|e).__str__().replace(':', ':<wbr>')|safe }}</a></td>
|
<td><a href="/transactions?{{ {'date_end': date_end.strftime('%Y-%m-%d'), 'date_beg': date_beg.strftime('%Y-%m-%d'), 'account': posting.account.name, 'cash': 'on' if cash else ''}|urlencode }}">{{ (posting.account.name|e).__str__().replace(':', ':<wbr>')|safe }}</a></td>
|
||||||
@ -97,7 +97,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% if account %}
|
{% if account %}
|
||||||
<tr class="total">
|
<tr class="total trn-first trn-last">
|
||||||
<td>{{ date_end.strftime('%Y-%m-%d') }}</td>
|
<td>{{ date_end.strftime('%Y-%m-%d') }}</td>
|
||||||
<td>Closing Balance</td>
|
<td>Closing Balance</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
@ -112,7 +112,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr class="total">
|
<tr class="total trn-first trn-last">
|
||||||
<td>{{ date_end.strftime('%Y-%m-%d') }}</td>
|
<td>{{ date_end.strftime('%Y-%m-%d') }}</td>
|
||||||
<td>Total</td>
|
<td>Total</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
{% set ns = namespace(balance=None) %}
|
{% set ns = namespace(balance=None) %}
|
||||||
{% set prevlink = '/transactions?' + {'date_end': (date_beg - timedelta(days=1)).strftime('%Y-%m-%d'), 'date_beg': date_beg.replace(year=date_beg.year-1).strftime('%Y-%m-%d'), 'account': account.name, 'cash': 'on' if cash else '', 'commodity': 'on'}|urlencode %}
|
{% set prevlink = '/transactions?' + {'date_end': (date_beg - timedelta(days=1)).strftime('%Y-%m-%d'), 'date_beg': date_beg.replace(year=date_beg.year-1).strftime('%Y-%m-%d'), 'account': account.name, 'cash': 'on' if cash else '', 'commodity': 'on'}|urlencode %}
|
||||||
{% for amount in opening_balance.amounts %}
|
{% for amount in opening_balance.amounts %}
|
||||||
<tr class="total">
|
<tr class="total{% if loop.first %} trn-first{% endif %}{% if loop.last %} trn-last{% endif %}">
|
||||||
<td>{% if loop.first %}<a href="{{ prevlink }}">{{ date_beg.strftime('%Y-%m-%d') }}</a>{% endif %}</td>
|
<td>{% if loop.first %}<a href="{{ prevlink }}">{{ date_beg.strftime('%Y-%m-%d') }}</a>{% endif %}</td>
|
||||||
<td>{% if loop.first %}<a href="{{ prevlink }}">Opening Balance</a>{% endif %}</td>
|
<td>{% if loop.first %}<a href="{{ prevlink }}">Opening Balance</a>{% endif %}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
@ -51,7 +51,7 @@
|
|||||||
<td>{% if amount >= 0 %}Dr{% else %}Cr{% endif %}</td>
|
<td>{% if amount >= 0 %}Dr{% else %}Cr{% endif %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr class="total">
|
<tr class="total trn-first trn-last">
|
||||||
<td><a href="{{ prevlink }}">{{ date_beg.strftime('%Y-%m-%d') }}</a></td>
|
<td><a href="{{ prevlink }}">{{ date_beg.strftime('%Y-%m-%d') }}</a></td>
|
||||||
<td><a href="{{ prevlink }}">Opening Balance</a></td>
|
<td><a href="{{ prevlink }}">Opening Balance</a></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
@ -72,7 +72,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for amount in ns.balance.amounts %}
|
{% for amount in ns.balance.amounts %}
|
||||||
{% set posting = matching_posting(transaction, amount) %}
|
{% set posting = matching_posting(transaction, amount) %}
|
||||||
<tr{% if loop.first %} style="border-top: 1px solid black;"{% endif %}>
|
<tr{% if loop.first and loop.last %} class="trn-first trn-last"{% elif loop.first %} class="trn-first"{% elif loop.last %} class="trn-last"{% endif %}>
|
||||||
<td>{% if loop.first %}{% if transaction.id %}<a href="{{ trn_url }}">{% endif %}{{ transaction.date.strftime('%Y-%m-%d') }}{% if transaction.id %}</a>{% endif %}{% endif %}</td>
|
<td>{% if loop.first %}{% if transaction.id %}<a href="{{ trn_url }}">{% endif %}{{ transaction.date.strftime('%Y-%m-%d') }}{% if transaction.id %}</a>{% endif %}{% endif %}</td>
|
||||||
<td>{% if loop.first %}{% if transaction.id %}<a href="{{ trn_url }}">{% endif %}{{ transaction.description }}{% if transaction.id %}</a>{% endif %}{% endif %}</td>
|
<td>{% if loop.first %}{% if transaction.id %}<a href="{{ trn_url }}">{% endif %}{{ transaction.description }}{% if transaction.id %}</a>{% endif %}{% endif %}</td>
|
||||||
{% if posting %}
|
{% if posting %}
|
||||||
@ -89,7 +89,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% for amount in closing_balance.amounts %}
|
{% for amount in closing_balance.amounts %}
|
||||||
<tr class="total explicit-rules" style="{% if loop.first %}border-top: 1pt solid black;{% endif %}{% if loop.last %}border-bottom: 1pt solid black;{% endif %}">
|
<tr class="total explicit-rules{% if loop.first %} trn-first{% endif %}{% if loop.last %} trn-last{% endif %}" style="{% if loop.first %}border-top: 1pt solid black;{% endif %}{% if loop.last %}border-bottom: 1pt solid black;{% endif %}">
|
||||||
<td>{% if loop.first %}{{ date_end.strftime('%Y-%m-%d') }}{% endif %}</td>
|
<td>{% if loop.first %}{{ date_end.strftime('%Y-%m-%d') }}{% endif %}</td>
|
||||||
<td>{% if loop.first %}Closing Balance{% endif %}</td>
|
<td>{% if loop.first %}Closing Balance{% endif %}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
@ -100,7 +100,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
<tr class="total">
|
<tr class="total trn-first trn-last">
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
@ -44,6 +44,7 @@ table.ledger {
|
|||||||
|
|
||||||
table.ledger td, table.ledger th {
|
table.ledger td, table.ledger th {
|
||||||
padding: 2px 2px 2px 2px;
|
padding: 2px 2px 2px 2px;
|
||||||
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.ledger th {
|
table.ledger th {
|
||||||
@ -66,6 +67,13 @@ table.ledger.onedesc tr td:not(:first-child), table.ledger.onedesc tr th:not(:fi
|
|||||||
width: 6em;
|
width: 6em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.ledger tr.trn-first td {
|
||||||
|
padding-top: 1.5mm;
|
||||||
|
}
|
||||||
|
table.ledger tr.trn-last td {
|
||||||
|
padding-bottom: 1.5mm;
|
||||||
|
}
|
||||||
|
|
||||||
table.ledger a {
|
table.ledger a {
|
||||||
color: black;
|
color: black;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
Reference in New Issue
Block a user