Apply patch to update ldg-reconcile.el
This commit is contained in:
parent
23483b7973
commit
24b791ad07
1 changed files with 39 additions and 1 deletions
|
|
@ -105,7 +105,45 @@
|
||||||
(ledger-reconcile-save))
|
(ledger-reconcile-save))
|
||||||
|
|
||||||
(defun ledger-do-reconcile ()
|
(defun ledger-do-reconcile ()
|
||||||
)
|
(let* ((buf ledger-buf)
|
||||||
|
(account ledger-acct)
|
||||||
|
(items
|
||||||
|
(with-current-buffer
|
||||||
|
(apply #'ledger-exec-ledger
|
||||||
|
buf nil "emacs" account "--uncleared" '("--real"))
|
||||||
|
(goto-char (point-min))
|
||||||
|
(unless (eobp)
|
||||||
|
(unless (looking-at "(")
|
||||||
|
(error (buffer-string)))
|
||||||
|
(read (current-buffer))))))
|
||||||
|
(dolist (item items)
|
||||||
|
(let ((index 1))
|
||||||
|
(dolist (xact (nthcdr 5 item))
|
||||||
|
(let ((beg (point))
|
||||||
|
(where
|
||||||
|
(with-current-buffer buf
|
||||||
|
(cons
|
||||||
|
(nth 0 item)
|
||||||
|
(if ledger-clear-whole-entries
|
||||||
|
(save-excursion
|
||||||
|
(goto-line (nth 1 item))
|
||||||
|
(point-marker))
|
||||||
|
(save-excursion
|
||||||
|
(goto-line (nth 0 xact))
|
||||||
|
(point-marker)))))))
|
||||||
|
(insert (format "%s %-30s %-25s %15s\n"
|
||||||
|
(format-time-string "%m/%d" (nth 2 item))
|
||||||
|
(nth 4 item) (nth 1 xact) (nth 2 xact)))
|
||||||
|
(if (nth 3 xact)
|
||||||
|
(set-text-properties beg (1- (point))
|
||||||
|
(list 'face 'bold
|
||||||
|
'where where))
|
||||||
|
(set-text-properties beg (1- (point))
|
||||||
|
(list 'where where))))
|
||||||
|
(setq index (1+ index)))))
|
||||||
|
(goto-char (point-min))
|
||||||
|
(set-buffer-modified-p nil)
|
||||||
|
(toggle-read-only t)))
|
||||||
|
|
||||||
(defun ledger-reconcile (account)
|
(defun ledger-reconcile (account)
|
||||||
(interactive "sAccount to reconcile: ")
|
(interactive "sAccount to reconcile: ")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue