Browse Source

Make it possible to have an "Account" column in reports

custom-labels
Damien Cassou 3 years ago
parent
commit
0c1d14c5e0
No known key found for this signature in database GPG Key ID: A7123815F5DCE914
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      elbank-report.el

+ 6
- 1
elbank-report.el View File

@ -61,8 +61,9 @@ Available columns:
- `label'
- `raw' (raw transaction text)
- `category'
- `account'
- `amount'."
:type `(repeat (list (string :tag "Name")
:type `(repeat (list (string :tag "Name")
(string :tag "Category")
(symbol :tag "Group by")
(symbol :tag "Sort by" :value date)
@ -424,6 +425,10 @@ When clicking the button, jump to the transaction."
(elbank-show-transaction transaction)))
(elbank-report--truncate (buffer-string))))
(cl-defmethod elbank-report--cell (transaction (_column (eql account)))
"Return the label of the account associated with TRANSACTION."
(elbank-report--truncate (elbank-account-name (elbank-transaction-elt transaction 'account))))
(defun elbank-report--truncate (str)
"Truncate STR to `elbank-report-max-column-width'.
If STR overflows, add an ellipsis."


Loading…
Cancel
Save