summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2013-04-08 11:40:10 -0700
committerCraig Earls <enderw88@gmail.com>2013-04-08 11:40:10 -0700
commit76145828fd8b0ca6ec19b5f192bbd5829d0fa263 (patch)
tree90562f63deec3ae230b8655548d4354a7670ba5f /lisp
parent3adab52660d8b7aacf13669140d7a9414fb9a0a9 (diff)
downloadfork-ledger-76145828fd8b0ca6ec19b5f192bbd5829d0fa263.tar.gz
fork-ledger-76145828fd8b0ca6ec19b5f192bbd5829d0fa263.tar.bz2
fork-ledger-76145828fd8b0ca6ec19b5f192bbd5829d0fa263.zip
Make quick balance showed "cleared" results
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ldg-mode.el16
1 files changed, 6 insertions, 10 deletions
diff --git a/lisp/ldg-mode.el b/lisp/ldg-mode.el
index 85cec39f..57fba674 100644
--- a/lisp/ldg-mode.el
+++ b/lisp/ldg-mode.el
@@ -62,16 +62,12 @@ And calculate the target-delta of the account being reconciled."
(interactive)
(let* ((account (ledger-read-account-with-prompt "Account balance to show"))
- (pending (ledger-reconcile-get-cleared-or-pending-balance (current-buffer) account)))
- (when pending
- (if ledger-target
- (message "%s balance: %s, Difference from target: %s"
- account
- (ledger-commodity-to-string pending)
- (ledger-commodity-to-string (-commodity ledger-target pending)))
- (message "%s balance: %s"
- account
- (ledger-commodity-to-string pending))))))
+ (buffer (current-buffer))
+ (balance (with-temp-buffer
+ (ledger-exec-ledger buffer (current-buffer) "cleared" account)
+ (buffer-substring-no-properties (point-min) (1- (point-max))))))
+ (when balance
+ (message balance))))
(defun ledger-magic-tab (&optional interactively)
"Decide what to with with <TAB> .