Exclude accounts from comparative trial balance with near-zero balances

This commit is contained in:
RunasSudo 2020-03-30 20:04:41 +11:00
parent 858ba0254a
commit f9d2ea7e90
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -76,7 +76,7 @@ def trial():
# Delete accounts with always zero balances # Delete accounts with always zero balances
accounts = sorted(l.accounts.values(), key=lambda a: a.name) accounts = sorted(l.accounts.values(), key=lambda a: a.name)
for account in accounts[:]: for account in accounts[:]:
if all(t.get_balance(account) == 0 for t in trial_balances): if all(t.get_balance(account).exchange(report_currency, True).near_zero for t in trial_balances):
accounts.remove(account) accounts.remove(account)
return flask.render_template('trial_multiple.html', trial_balances=trial_balances, accounts=accounts, report_currency=report_currency, cash=cash) return flask.render_template('trial_multiple.html', trial_balances=trial_balances, accounts=accounts, report_currency=report_currency, cash=cash)