Closed 501st-alpha1 closed 5 years ago
In my experience payee/name and memo seem completely interchangeable in real world OFX files. It doesn't seem unreasonable to copy one to the other, although the default formatter is {payee} {memo}
so that would be weird. Also it kind of messes with expectations of how the payee format would work. (I realize now that I probably should have called {payee}
{name}
instead as that is what it is called in OFX.)
I prefer the second option because it doesn't really mess with expectations of what is contained in payee
and memo
. I did some of this kind of manipulation of payee/memo before and when it got too complicated I gave up and added the --payee-format
option which I think works a lot better - you can't really account for the varieties of OFX file.
My bank recently dropped support for plain OFX files for transaction downloads. Thankfully, they offer files in the QFX format ("for Quicken"), which appear to be an XML-compliant version of the OFX standard. However, they've made some changes in how they format the data in the files.
Here is an example transaction (whitespace for readability, original file is entirely on one line):
You may spot a couple other issues here, but the one I care about in this issue is the payee/memo fields.
In the previous OFX files, they used the
<NAME>
field and had no<MEMO>
, but this QFX file reverses that, which has broken syncing for me. It doesn't appear that they've changed the content at all; the<MEMO>
field in the QFX file looks just like the<NAME>
field in the OFX file did. (I guess this change actually makes sense given the contents of the field, I just wish they would put a useful payee in the<NAME>
field.) My main concern is using my new payee-matching functionality (#62) to get a useful payee for my Ledger file.I see a couple possible solutions:
payee
is blank andmemo
is not, copymemo
topayee
.get_autosync_payee
will be called after that, sopayee
will potentially be changed, whilememo
would be left alone. That could be an issue, so maybe we should also clearmemo
? What about valid reasons to have a blankpayee
with amemo
? (Are there any?)payee
is blank andmemo
is not, runget_autosync_payee
onmemo
instead ofpayee
. Could then usepayee_format
of{memo}
to set the Ledger payee correctly.sed
and replace<MEMO>
with<NAME>
before passing to ledger-autosync.I have the first solution working locally (and I use a
payee_format
of{payee}
anyway, so I don't care what happens tomemo
), but I wanted to get your input before I submit a PR.