-
Notifications
You must be signed in to change notification settings - Fork 813
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
Bug 799469 - Future Gnucash Object idea: Reconciliation Object #2048
Conversation
draft. Upon a successful reconciliation, we can store the "statement" thus confirmed "correct" in an appropriate data structure, an OFX file.
That's an interesting idea. Where would the file live? With the book, in GNC_DATA_DIR, or somewhere else? |
Dunno... maybe a For SQL maybe they may live in another table? |
Storing the data in a file outside of the book brings extra challenges, similar to the ones we encounter with the gcm files. Assuming you store your ofx file(s) in a file or directory of which the name is similar to the data file they relate to. Then:
And as you already hinted at, for sql it gets worse as sql may be accessed from completely different computers. |
I also think our engine code to save data to a table in sql is equivalent to using dedicated nodes in an xml file. I don't think we can do an separate sql table in case of sql and external files in case of xml backends, unless you want to write yet another data storage and retrieval engine. IMO if this is to become a gnucash object, we really should stick to either extending our file/sql schema or bolt it on via kvp. |
Ok point taken. I still feel it may be acceptable to spin out these "second-class" objects whereby dataloss isn't critical. Instead of saving the OFX into On the other hand if we'd bolt onto kvp, would it be via an intricate tree of kvp objects, or save the whole OFX into a kvp string? I quite like the availability of OFX whereby a reimport may use the import ui to fix cases whereby the user has deleted or damaged the transactions. |
It would depend on how you want to query the OFX. If you'd just retrieve the whole thing to reprocess it as an OFX file then it would make more sense to store it as a single string, while if you want to retrieve a piece of it with a KVP path then it would have to be broken up. As an aside, the example you used is an OFX DirectConnect stream from AQBanking. The actual OFX starts at the
Not as it's written: OFX's STMTTRN requires a unique FITID element (missing from your example, making it ill-formed). GnuCash stores that in the transaction's Note also that neither AQBanking nor libofx can write so you'd need to implement that yourself. |
The example ofx I copied above isn't a download, it's a direct output from my code above from my test datafile. From my experimentation it seems libofx handles both ofx1 and ofx2.2 just fine; but is more strict about ofx2.2 (eg it does require FITID). Maybe we'll need to ask @benoitg whether ofx1 or ofx2.2 would be more appropriate |
I can't help but wonder why you would want to store this as OFX inside of gnucash ? Can't we just store the parts we need in some format that is easier to integrate with the rest of gnucash ? |
The idea is that OFX already has an elaborate and debugged importer, and any other kvp or first-class objects format would require building a whole UI to repair transactions. And it's still unclear which "parts we need" actually consist of. |
We already have a much simpler way to re-create transactions, the transaction log. |
I seem to be missing something here. To me reconciliation means confirming transactions in your book appear on some external record. So to save that data in gnucash, one would need some id for that record, a few dates and a list of splits that are covered by the reconciliation. You are now talking about importing, and transaction repair. How is that related ? Isn't that widening the scope quite a bit ? |
^ no disagreement here!
Agree... the scope is still ill-defined. The idea of storing a copy of successfully reconciled splits (alongside statement date, statement balance) is still useful IMHO. While coding storing reconciliation data into kvp, I that felt I was recreating an OFX file and recoded to output OFX. kvp would offer a neater method to write a proper reconciliation report (i.e. show me the statement and its splits). OFX offers the ability to reimport splits, hence repairing damaged reconciliations (e.g. via accidental deletes). IMHO the Transaction Log is also neat but stores complete transactions rather than splits. Additionally I wager most users routinely delete these .log files. Further debates welcome... |
Maybe back up a bit and articulate the problem you're trying to solve. That's probably better done by closing the bug and this PR and starting over with a new bug report that states a problem rather than proposing a solution. |
draft.
Upon a successful reconciliation, we can store the "statement" thus confirmed "correct" in an appropriate data store: an OFX file. This works if the
<?xml version="1.0" encoding="UTF-8"?>
is removed manually.