hledger icon indicating copy to clipboard operation
hledger copied to clipboard

RFE; timedot - add payee/description and trailing comment/tags

Open linuxcaffe opened this issue 4 years ago • 14 comments

The most awesome timedot would be even awesomer with a description (payee field). Currently a timedot entry carries no description, but can handle a trailing comment.

<acct:sub:sub><spaces><qtty><spaces><;><comment>

This enhancement would use the comment as description.

linuxcaffe avatar Nov 14 '21 21:11 linuxcaffe

Closed in favour of #1220 https://github.com/simonmichael/hledger/issues/1220#issuecomment-968392952

linuxcaffe avatar Nov 15 '21 00:11 linuxcaffe

Related to #1220 (comments in timeclock format). Let's keep this one open for timedot specifically.

simonmichael avatar Nov 15 '21 01:11 simonmichael

Following up on djp's timedot comment there:

  • timedot format supports descriptions, written after the date
  • You can add a ; comment and tags there too, but it's treated as part of the description. Instead we should parse text after semicolon as a comment and tags, as in journal format
  • We should do the same for ; comment on a time dots line, where currently it is ignored.

simonmichael avatar Nov 15 '21 01:11 simonmichael

I'm confused. "timedot supports descriptions".. how? I get an error putting anything after the date. I often put a comment like ;Friday on the line following the date, but.. Does that description relate to the day? Not to each timedot event, right? When I review my ledger combining the timedot and timeclock, using hledger-ui, for example, entries from the timeclock have descriptions, those from timedot do not. I DO agree that the trailing <spaces>;comment :tags: would be dandy..

copying mockup back to the correct topic

UPDATE; oh what the hell. I've been thinking about a more complete feature set, and considering eeking them out, as the foundational bits get deployed, so as not to cause alarm, but I'm expanding this mockup with status "*" and (number). All comments, in-line and indented (not including file-comments) would be transaction-comments, as there aren't really "postings".

<acct:sub:sub> <2+ spaces> <qtty> <2+ spaces> <* (123) description text> <2+ spaces> <;> <comment and :tags:>

2021/11/12
sleep                7
job:store            8.5         cleaned, set up xmas decorations
job:mary:reno        ...         * (21024) bathroom drain repair       ; sink didn't fit :plumbing:invoice:
   ; Mary suggests retrofitting the old one :scrapyard:
ent:reading          .... .      Kurt Vonnegut - Cat's Cradle          ; insane! loved it! :fiction:funny:
phys:workout         25min       ; reps: 305

linuxcaffe avatar Nov 15 '21 02:11 linuxcaffe

Eg:

* 2021-11-14 Sun
fos.hledger              .... .... .
$ hledger -f a.timedot print desc:sun
2021-11-14 * Sun
    (fos.hledger)            2.25

simonmichael avatar Nov 15 '21 02:11 simonmichael

(It works for me at least back to hledger 1.17..)

simonmichael avatar Nov 15 '21 02:11 simonmichael

Oh that's cool on the date (emacsism?) but I'm after a description on the entry

      (fos.hledger)        2.25       more dumb suggestions in irc

linuxcaffe avatar Nov 15 '21 03:11 linuxcaffe

Yes, in that position I propose we should support comments (; comment maybe with a tag:). There's no room for a posting description in our data model.

simonmichael avatar Nov 15 '21 03:11 simonmichael

Well.. I'm getting confused, I thought the date creates a transaction and each dot line is a posting within it. Actually, each dot line is a separate transaction. (Is that for the best ? I'm not sure.)

simonmichael avatar Nov 15 '21 03:11 simonmichael

yes, it's (nearly) perfect! Ruminate, maybe there IS room for that description :-D

linuxcaffe avatar Nov 15 '21 03:11 linuxcaffe

timedot entries being a one-liner, with an inherited date, is my favorite part of it, but it only has a date, an account and an amount, no description (or comment or tag). I suspect that some of the timedot behaviors you are seeing (Simon) is emacs magic, and none of the leading-* features described work in my editor (vi) and that's ok (for now) . Have another look at the mockup above, and I hope you'll agree that it might be the most concise, most hledgerish way to cram the full data set into a single line.

linuxcaffe avatar Nov 15 '21 06:11 linuxcaffe

@linuxcaffe and I, the current known users of timedot format, discussed this (cf today's #hledger chat log) and made some decisions. We'd like to get better description and comment support in timedot format, along these lines:

2021/11/12 blah
sleep                7
job:store            8.5     cleaned, set up xmas decorations
job:mary:reno        ...     * (21024) bathroom drain repair, sink didn't fit ; plumbing:, invoice:
   ; Mary suggests retrofitting the old one, scrapyard:
ent:reading          .... .  Kurt Vonnegut - Cat's Cradle, insane! loved it! ; fiction:, funny:
phys:workout         25m     ; reps: 305
  • we'll keep generating a separate transaction from each data line, for now at least
  • currently, text following the date is used as a common description for all the day's transactions. In case anyone is using this, it will now be preserved as a tag on the day's transactions, day: or some such.
  • after the time quantity (numeric or dotted), following 2+ spaces, we will read an optional transaction description, and/or semicolon comment, as in journal format
  • additional comment lines below a data line will form additional transaction comment lines
  • a (code) at the start of description could be parsed as the transaction's code
  • a status mark (* or !) at the start could be parsed as the transaction's status. This is more impactful, it implies that timedot transactions would no longer have cleared status by default.

If all of those are implemented, the above would produce transactions like these, queryable in the usual ways:

2021-11-12
    ; day: blah
    (sleep)               7.00

2021-11-12 cleaned, set up xmas decorations
    ; day: blah
    (job:store)           8.50

2021-11-12 * (21024) bathroom drain repair, sink didn't fit  ; plumbing:, invoice: 
    ; Mary suggests retrofitting the old one, scrapyard:
    ; day: blah
    (job:mary:reno)       0.75

2021-11-12 Kurt Vonnegut - Cat's Cradle, insane! loved it!  ; fiction:, funny: 
    ; day: blah
    (ent:reading)         1.25

2021-11-12  ; reps: 305
    ; day: blah
    (phys:workout)        0.41666666666666665
  • Also timedot format should remain essentially simple and easy for others to adopt and implement, so perhaps these will be described as optional "tier 2" features. In the doc there should be a short implementors section communicating this.

simonmichael avatar Nov 17 '21 03:11 simonmichael

@simonmichael and/or @linuxcaffe - do either of you know of anyone working this issue at this time? I am a daily user of the timedot format and would like to implement this, as I have wished for the same thing!

alhirzel avatar Jul 08 '22 14:07 alhirzel

Noone is working on it, be our guest @alhirzel .

simonmichael avatar Jul 08 '22 15:07 simonmichael

Here's a RFC on changes to timedot format: https://groups.google.com/g/hledger/c/TxoA-xnfvMA/m/QvpmWA5pAwAJ

simonmichael avatar May 03 '23 03:05 simonmichael

Ccing here (and reviewing the discussion above):

I'm fixing/improving timedot's description/comment/tag parsing. But before that.. which do you think is better:

  1. generating little transactions for each line, as we do now:
2023-01-01 
a .... 
b .... 
c .... 

->

2023-01-01 
(a) 1 

2023-01-01 
(b) 1 

2023-01-01 
(c) 1 

Or 2. generating one big transaction per date line ?

2023-01-01 
(a) 1 
(b) 1 
(c) 1 

I don't remember why it's implemented as 1. Right now, 2 looks a little tidier ? It would be a breaking change (print and register reports would change; balance reports would not).

The above affects how timedot format can support descriptions and comments (and tags). Variant 2 would simplify that design space a bit: date lines can end with a transaction description and comment, time lines can end with a posting comment.

simonmichael avatar May 03 '23 03:05 simonmichael

Now implemented in master: https://hledger.org/dev/hledger.html#timedot

simonmichael avatar May 04 '23 05:05 simonmichael