-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unknown account guessing when payee has changed #25
Comments
Thanks for the feedback! Those both sound like good ideas. I'd also like to improve payee matching (e.g. http://tomszilagyi.github.io/payment-matching/) but I think giving the user an option to configure payee matching via some sort of configuration, ideally in the ledger file itself, would be very useful. I'd worry about the second option creating some feature drift between support for ledger and hledger, because it is not supported by ledger. So far I have been able to keep ledger-autosync working the same in hledger and ledger, and it would be nice to keep it that way. It might be possible to parse ledger files for The first options seems viable. I'll need to explore how this could work in ledger and hledger. I imagine it would be possible to have a single |
@egh Would you be open to a PR implementing the The post you linked to looks interesting too, but I think that would be mostly separate from the issue I'm having, since the author uses the original payee in their ledger file (and possibly appends something to it). |
@501st-alpha1 Sure! Thank you. |
Currently
ledger-autosync
can guess the unknown account based on previous transactions with the same payee. However, the payee output byledger-autosync
isn't usually in the format that I want for my ledger file, so I rewrite it as needed. (Example:ledger-autosync
givesDebit Card Purchase - STARBUCKS
as the payee for one transaction. I don't care about the first part, and the second part is shouty, so I change the payee toStarbucks
.) Unfortunately, this breaks the account guessing, which causes me to additionally need to rewrite the unknown account.I have a couple ideas of how to fix this. The first is: would it be possible to save the payee that
ledger-autosync
outputs to e.g. a tag, and match on that? (I assume I could add aPayee:
directive, but that would probably also affect any ledger output.)Second idea: Ledger recognizes a
payee
sub-directive to theaccount
directive, as follows (from the Ledger docs):Could
ledger-autosync
apply these regexes to find the matching account to use? I realize I could add thepayee
sub-directives and use a generic unknown account, but I'd rather have the correct account in my ledger file, so it's clear without searching through the headers for the payee directive.The text was updated successfully, but these errors were encountered: