From f9d2ea7e90be53ccf7f0df85f6f007fcd170cfa7 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Mon, 30 Mar 2020 20:04:41 +1100 Subject: [PATCH] Exclude accounts from comparative trial balance with near-zero balances --- ledger_pyreport/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ledger_pyreport/__init__.py b/ledger_pyreport/__init__.py index 86cf8a2..5f1f86f 100644 --- a/ledger_pyreport/__init__.py +++ b/ledger_pyreport/__init__.py @@ -76,7 +76,7 @@ def trial(): # Delete accounts with always zero balances accounts = sorted(l.accounts.values(), key=lambda a: a.name) 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) return flask.render_template('trial_multiple.html', trial_balances=trial_balances, accounts=accounts, report_currency=report_currency, cash=cash)