fix(beancount): +beancount/balance: make v3 compliant

bean-report was removed in beancount v3+, so we defer to bean-query,
which is present in both v2 and v3 (though it lives in a separate repo
in v3).
This commit is contained in:
Henrik Lissner
2025-04-30 03:44:44 -04:00
parent ac0a327721
commit 440e952056
2 changed files with 6 additions and 6 deletions

View File

@ -123,10 +123,13 @@ If REVERSE (the prefix arg) is non-nil, sort the transactions in reverst order."
(defun +beancount/balance (&optional all-accounts)
"Display a balance report with bean-report (bean-report bal)."
(interactive "P")
(let ((args (unless all-accounts '("-e" "Assets|Liabilities")))
compilation-read-command
(let (compilation-read-command
current-prefix-arg)
(apply #'beancount--run "bean-report" buffer-file-name "balances" args)))
(beancount--run "bean-query"
buffer-file-name
(format "balances WHERE NOT close_date(account)%s"
(if all-accounts
"" (format " AND account ~ \"^(Assets|Liabilities)\"" ))))))
;;;###autoload
(defun +beancount/clone-transaction ()

View File

@ -28,9 +28,6 @@
(browse-url (match-string 1 output))))))
(map! :map beancount-mode-map
"TAB" (cmds! (and outline-minor-mode (outline-on-heading-p))
#'beancount-outline-cycle
#'indent-according-to-mode)
:m "[[" #'+beancount/previous-transaction
:m "]]" #'+beancount/next-transaction
:localleader