diff options
author | John Wiegley <johnw@newartisans.com> | 2005-01-29 01:41:29 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:40:51 -0400 |
commit | e4b5af061ed67c58447a88ad6bde75cf57c5b09b (patch) | |
tree | da9ba33adbe3525863163210bf0eccf7de981a66 /ledger.el | |
parent | 76968b844c849e25ebd80962f07deb0655646af9 (diff) | |
download | fork-ledger-e4b5af061ed67c58447a88ad6bde75cf57c5b09b.tar.gz fork-ledger-e4b5af061ed67c58447a88ad6bde75cf57c5b09b.tar.bz2 fork-ledger-e4b5af061ed67c58447a88ad6bde75cf57c5b09b.zip |
Changed the reconciling feature so that it doesn't need to ask for the
"number of days".
Diffstat (limited to 'ledger.el')
-rw-r--r-- | ledger.el | 18 |
1 files changed, 8 insertions, 10 deletions
@@ -207,13 +207,12 @@ Return the difference in the format of a time value." (define-key map [(control ?c) (control ?p)] 'ledger-print-result) (define-key map [(control ?c) (control ?r)] 'ledger-reconcile))) -(defun ledger-parse-entries (account &optional all-p after-date) +(defun ledger-parse-entries (account &optional all-p) (let (total entries) (ledger-iterate-entries (function (lambda (start date mark desc) - (when (and (or all-p (not mark)) - (ledger-time-less-p after-date date)) + (when (or all-p (not mark)) (forward-line) (setq total 0.0) (while (looking-at @@ -231,7 +230,8 @@ Return the difference in the format of a time value." (setq entries (cons (list (copy-marker start) mark date desc (or amt total)) - entries)))) + entries) + all-p t))) (forward-line)))))) entries)) @@ -289,13 +289,11 @@ Return the difference in the format of a time value." (forward-line) (ledger-update-balance-display))) -(defun ledger-reconcile (account &optional days) - (interactive "sAccount to reconcile: \nnBack how far (default 30 days): ") - (let* ((then (ledger-time-subtract - (current-time) (seconds-to-time (* (or days 30) 24 60 60)))) - (items (save-excursion +(defun ledger-reconcile (account) + (interactive "sAccount to reconcile: ") + (let* ((items (save-excursion (goto-char (point-min)) - (ledger-parse-entries account t then))) + (ledger-parse-entries account))) (buf (current-buffer))) (with-current-buffer (pop-to-buffer (generate-new-buffer "*Reconcile*")) |