simonmichael / hledger

Robust, fast, intuitive plain text accounting tool with CLI, TUI and web interfaces.
https://hledger.org
GNU General Public License v3.0
3.03k stars 321 forks source link

Show tags in hledger-web/hledger register #1101

Open legrostdg opened 5 years ago

legrostdg commented 5 years ago

It would be nice to have tags displayed for each transaction in the "General Journal" part of hledger-web webpage. hledger register should also display the tags, maybe with a --tags option. That would help tag usage a lot!

legrostdg commented 5 years ago

probably related to https://github.com/simonmichael/hledger/issues/664

simonmichael commented 5 years ago

Hi @legrostdg, what are some situations where this would be helpful ?

simonmichael commented 5 years ago

Also, could you show some mockups (here is fine) of register output including tags ? Space is quite limited.

legrostdg commented 5 years ago

I use tags to specify the related accountant documents for each transaction (essentially the filename of the invoice). I guess tags are used by others in different ways, but whatever the use case is, they are quite hidden now (maybe because they are just a kind of special comment).

legrostdg commented 5 years ago

mockup:

$ hledger register [--tags]
2019/01/01 first transaction                liabilities:bank          50.00€    50.00€
    doc:"~/invoices/01.pdf"                 assets:custom            -50.00€         0
2019/01/02 second transaction               liabilities:bank          30.00€    30.00€
    doc:"~/invoices/01.pdf"                 assets:custom            -20.00€    10.00€
                                            liabilities:VAT          -10.00€         0
legrostdg commented 5 years ago

In the webapp, the best would be clickable text redirecting to the list of the transactions with the same tag (not very useful for my usecase of tags, but for example click on "trips:Germany" on a transaction redirecting to all transactions matching this tag would be really nice!).

simonmichael commented 5 years ago

You're right that they are quite hidden; only the print and tags commands display them. (Also, with --pivot you can make a single tag's values visible as accounts.)

The mockup is a good start. Could you show a journal entry or two, with both transaction and posting tags, including multiple tags and multiline tags, and explore how that might look, with the register unfiltered or filtered to specific accounts.

Adding them to hledger-web seems easier (more space and layout flexibility) and that does sound nice. Is it something you could try prototyping ?

simonmichael commented 5 years ago

(By "multiline tags" I meant next-line tags.) Eg:

2019-01-01 foo    ; txn-tag-1: some value
  ; txn-tag-2: 2 2 2, txn-tag-3: 3
  ; txn-tag-4: with a very long value with a very long value with a very long value with a very long value with a very long value with a very long value with a very long value with a very long value with a very long value
  a   1    ; posting-tag-1:  p1 p1
             ; posting-tag-2: p2 p2
  b  
  ;  posting-tag-3: with a very long value with a very long value with a very long value with a very long value with a very long value with a very long value with a very long value with a very long value with a very long value
  ; this:
  ; posting:
  ; has:
  ; lots:
  ; of: tags