This repository helps importing OFX in finance management tools by fixing the transaction ID (FITID). Too many times banks websites change FITID although it is used as a primary key for transaction matching in finance management tools like GNUCash.
Using this project will «fix» FITID in all transactions as such:
statement.FITID = `${statement.DTPOSTED}-${statement.NAME}-${statement.TRNTYPE}-${statement.TRNAMT}`
Before:
<STMTTRN>
<TRNTYPE>OTHER
<DTPOSTED>20210926
<TRNAMT>-23.40
<FITID>20210926000000001
<NAME>PAYPAL LUXEMBOURG
<MEMO>.
</STMTTRN>
After:
<STMTTRN>
<TRNTYPE>OTHER
<DTPOSTED>20210926
<TRNAMT>-23.40
<FITID>20210926-PAYPAL LUXEMBOURG-OTHER--23.40
<NAME>PAYPAL LUXEMBOURG
<MEMO>.
</STMTTRN>
npm cinpm run buildnode dist/ofix.js --inputDir=<dir having ofx files to fix> --outDir=<dir receiving fixed ofx files>outDirwill then have as many files asinputDir- Every file in
outDirwill be suffixed with_fixedto avoid overwriting ifinputDir===outDir - cleanup, either in
inputDiroroutDiris left to you
Of course there are tests, just npm run test !