From 55e97eb78a75f978144c519788252a476cf4c75c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 16 May 2025 10:55:47 +0200 Subject: [PATCH] fix(beancount): +beancount/balance: omit zeroed accounts --- modules/lang/beancount/autoload.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/lang/beancount/autoload.el b/modules/lang/beancount/autoload.el index c43a1b5cc..07ff15283 100644 --- a/modules/lang/beancount/autoload.el +++ b/modules/lang/beancount/autoload.el @@ -127,9 +127,12 @@ If REVERSE (the prefix arg) is non-nil, sort the transactions in reverst order." current-prefix-arg) (beancount--run "bean-query" buffer-file-name - (format "balances WHERE NOT close_date(account)%s" + (format (concat "SELECT account, sum(position) as balance %s " + "GROUP BY account " + "HAVING not empty(sum(position)) " + "ORDER BY account") (if all-accounts - "" (format " AND account ~ \"^(Assets|Liabilities)\"" )))))) + "" (format "WHERE account ~ \"^(Assets|Liabilities)\"" )))))) ;;;###autoload (defun +beancount/clone-transaction ()