Browse Source

Make the Transaction view display the account

custom-labels
Damien Cassou 3 years ago
parent
commit
9a504d26f2
No known key found for this signature in database GPG Key ID: A7123815F5DCE914
2 changed files with 9 additions and 2 deletions
  1. +1
    -1
      elbank-common.el
  2. +8
    -1
      elbank-transaction.el

+ 1
- 1
elbank-common.el View File

@ -81,7 +81,7 @@ Example of categories
(defvar elbank-data nil
"Alist of all accounts and transactions.")
(defvar elbank-report-available-columns '(date rdate label raw category amount)
(defvar elbank-report-available-columns '(date rdate label raw category account amount)
"List of all available columns in reports.")


+ 8
- 1
elbank-transaction.el View File

@ -48,6 +48,13 @@
(elbank-transaction-mode)
(elbank-transaction--refresh transaction)))
(cl-defgeneric elbank-transaction--field (transaction key)
"Return the label of the KEY of TRANSACTION."
(elbank-transaction-elt transaction key))
(cl-defmethod elbank-transaction--field (transaction (_key (eql account)))
(elbank-account-name (elbank-transaction-elt transaction 'account)))
(defun elbank-transaction--refresh (transaction)
"Populate the current buffer with the details of TRANSACTION."
(let ((inhibit-read-only t)
@ -65,7 +72,7 @@
'face
'font-lock-keyword-face)
(insert " ")
(insert (format "%s" (elbank-transaction-elt transaction key)))
(insert (format "%s" (elbank-transaction--field transaction key)))
(insert "\n")))))
(provide 'elbank-transaction)


Loading…
Cancel
Save