You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Thank you for your work on ledger-autosync. I'm new to ledger and ledger-autosync, so perhaps this has already bee covered somewhere. If, I'm sorry.
I can't tell if this is a bug, or just me being new and not knowing my way around, but I'm tying myself in knots trying to figure out how autosync and offset account lookup works. It's pretty easy to get the name to be be looked up via AutosyncPayee, but I can only get the offset account to be looked up if I explicitly specify a payee name format via --payee-format '{payee}'.
# first, w/o connecting l-a to my ledger file
$ ledger-autosync file.OFX -a Assets:Bank:Checking
2021/10/18 ACH Deposit Square Inc TYPE: 211018P2 CO: Square Inc
Bank:Checking $504.50
Expenses:Misc -$504.50
# next, w/ connecting it to my ledger file, but w/o the payee-format
$ ledger-autosync -l journal.ledger file.OFX -a Bank:Checking
2021/10/18 Square Deposit TYPE: 211018P2 CO: Square Inc
Bank:Checking $504.50
Expenses:Misc -$504.50
# finally, w/ my ledger file AND payee-format
$ ledger-autosync -l journal.ledger file.OFX -a Bank:Checking --payee-format '{payee}'
2021/10/18 Square Deposit
Bank:Checking $504.50
Assets:Undeposited Funds -$504.50
I've also tried to put the full name + memo "name" into the AutosyncPayee field, but that doesn't work either.
The more I tinker w/ the code and play w/ it, I think that this all swirls around mk_dynamic_account and load_payees. mk_dynamic_account is called w/ self.format_payee(txn), and then calls out to get_account_by_payee w/ the formatted payee name. get_account_by_payee then calls load_payees and then uses the passed (formatted) payee to filter the accounts. However, it looks (again, to me, not a python dev) like load_payees is just loading the payees based on the results of calling ledger csv show --actual, ie the payees that ledger knows about, not that I've configured via AutosyncPayee or payee_format.
So, stepping back up, get_account_by_payee is using the formatted payee name to query the dictionary of payees and accounts, and that will only work if either all of my ledger transactions have payees that match payee_format. ... which ... I guess might not be a bug, but a configuration issue on my end?? I don't know.
Possibly related, but what got me started on this is that essentially all of the transactions in my OFX file (ie nearly all of my transactions) have the date or some sort of transaction reference number (like the actual POS transaction, not the ledger transaction) included in the OFX memo field, so the default format of {payee} {memo} means that they're all essentially unique. Again, I can get around this w/ --payee-format '{payee}', but then I completely lose the memo, which sometimes includes useful information.
Sorry to be rambling about this. This is probably all just me trying to learn my way around.
Thanks again for ledger-autosync!
The text was updated successfully, but these errors were encountered:
I admit I've kind of lost track of how the automatic payee matching works, but I think you're correct - the transaction number in the payee line is preventing the payee from matching. ledger-autosync calls ledger -f fixtures/checking.lgr csv show --actual and creates a map between the payee and the account in that csv file. So when the payee is Square Deposit it matches, but when its Square Deposit TYPE: 211018P2 CO: Square Inc it is not matching the older entries, so it's not picking up the account name.
It would probably be possible to add some sort of fuzzy matching on the payee line.
Alternately, you could save the transaction number in a metadata comment. In the long term we could add a new option for a "comment line" format, e.g.
Hi! Thank you for your work on
ledger-autosync
. I'm new to ledger and ledger-autosync, so perhaps this has already bee covered somewhere. If, I'm sorry.I can't tell if this is a bug, or just me being new and not knowing my way around, but I'm tying myself in knots trying to figure out how autosync and offset account lookup works. It's pretty easy to get the name to be be looked up via
AutosyncPayee
, but I can only get the offset account to be looked up if I explicitly specify a payee name format via--payee-format '{payee}'
.Here's my homework...
Given a ledger w/ this transaction:
and an OFX file w/ a transaction matching this snippet:
then, this is what I see:
I've also tried to put the full
name + memo
"name" into theAutosyncPayee
field, but that doesn't work either.The more I tinker w/ the code and play w/ it, I think that this all swirls around
mk_dynamic_account
andload_payees
.mk_dynamic_account
is called w/self.format_payee(txn)
, and then calls out toget_account_by_payee
w/ the formatted payee name.get_account_by_payee
then callsload_payees
and then uses the passed (formatted) payee to filter the accounts. However, it looks (again, to me, not a python dev) likeload_payees
is just loading the payees based on the results of callingledger csv show --actual
, ie the payees that ledger knows about, not that I've configured viaAutosyncPayee
orpayee_format
.So, stepping back up,
get_account_by_payee
is using the formatted payee name to query the dictionary of payees and accounts, and that will only work if either all of my ledger transactions have payees that matchpayee_format
. ... which ... I guess might not be a bug, but a configuration issue on my end?? I don't know.Possibly related, but what got me started on this is that essentially all of the transactions in my OFX file (ie nearly all of my transactions) have the date or some sort of transaction reference number (like the actual POS transaction, not the ledger transaction) included in the OFX
memo
field, so the default format of{payee} {memo}
means that they're all essentially unique. Again, I can get around this w/--payee-format '{payee}'
, but then I completely lose the memo, which sometimes includes useful information.Sorry to be rambling about this. This is probably all just me trying to learn my way around.
Thanks again for
ledger-autosync
!The text was updated successfully, but these errors were encountered: