Bug fixes

Correct incorrect URL on cash flow report
Force sort transactions by date
This commit is contained in:
RunasSudo 2021-01-02 21:28:20 +11:00
parent 4a76f605b4
commit 297b2bf451
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
2 changed files with 3 additions and 1 deletions

View File

@ -29,7 +29,7 @@
</td>
{% for cashflow in cashflows %}
{% set amount = (-cashflow.get_balance(account) if invert else cashflow.get_balance(account)).exchange(report_commodity, True) %}
<td>{% if not amount.near_zero %}{{ amount|a('/transactions?' + {'date': cashflow.date.strftime('%Y-%m-%d'), 'pstart': cashflow.pstart.strftime('%Y-%m-%d'), 'account': account.name, 'cash': 'on' if cash else ''}|urlencode) }}{% endif %}</td>
<td>{% if not amount.near_zero %}{{ amount|a('/transactions?' + {'date_end': cashflow.date.strftime('%Y-%m-%d'), 'date_beg': cashflow.pstart.strftime('%Y-%m-%d'), 'account': account.name, 'cash': 'on' if cash else ''}|urlencode) }}{% endif %}</td>
{% endfor %}
</tr>

View File

@ -131,4 +131,6 @@ def raw_transactions_at_date(date):
if amount.commodity.name not in ledger.commodities:
ledger.commodities[amount.commodity.name] = amount.commodity.strip_price()
ledger.transactions.sort(key=lambda t: t.date)
return ledger