Closed bratekarate closed 3 years ago
You have to set code_tag
in your config file.
$ cat > d.yaml
code_tag: code
$ ledger2beancount --config d.yaml d
1970-01-01 open Assets:Bank:Checkings
1970-01-01 open Expenses:Foods:Groceries
1970-01-01 commodity EUR
2021-03-03 * "Supermarket XY"
code: "DEBIT CARD"
Is that not clear from the docs?
On a second thought, an option would be great to just prepend the transaction code in parenthesis to the description (or even default).
I don't think that's a great solution. I think moving the info to meta-data (as code_tag
does) makes more sense.
Well, what can I say... somehow I did not pick it up. Interestingly I have visited the section about transaction codes before, but at that time I did not understand what is meant by code_tag
-- I thought it means that the ledger transaction must possess a code.
Looking back this does not make much sense, but I did not expect a yaml configuration file to be necessary to transform all transaction data to beancount format. There was a lot of configuration and mails I read about ledger, hledger and beancount recently, so I may have become somewhat documentation blind and should take a break :).
Personally I think that it would be pleasant if there was a default, but then again understand the issue of collissions with actual ledger tags. I'd like to avoid a configuration file just for the converter, but that's just my laziness. Thanks for the great converter that allows me to easily use fava to analyze my ledger journals!
Personally I think that it would be pleasant if there was a default, but then again understand the issue of collissions with actual ledger tags
When I saw your report, I was wondering about turning it on by default. I agree it would be nice, but I think there are some downsides.
The biggest one, as you say, is the potential for collisions (i.e. if someone has code
metadata already). Another is that it's probably easier to turn on (define the config variable) than to turn it off (set an empty config variable?); and finally there are some similar options that I wouldn't want to turn on by default (the payer stuff) and so there would be some inconsistency between what's on and what's off by default.
So on balance I think I'll leave it off by default, even though it's not optimal.
The readme states that transaction codes will be stored as metadata. However, when converting my ledger journal I do not see such meta data. The following transaction may serve as a test:
Output of ledger2beancount:
The transaction code (DEBIT CARD) is not included in metadata after conversion. Should the readme be updated to not support it? Or is it me using a weird format?
Edit: On a second thought, an option would be great to just prepend the transaction code in parenthesis to the description (or even default).