bnw / firefly-iii-fints-importer

Import financial transactions from you FinTS enabled bank into Firefly III.
GNU Affero General Public License v3.0
157 stars 23 forks source link

Allow to configure description for firefly via fints raw fields #76

Open timaschew opened 2 years ago

timaschew commented 2 years ago

First of all thanks for this great tool!

When I started using firefly I tried to import a CSV file from my ING DiBa bank account. Firefly detected a duplicate because there were two deposits on the same day the the same amount from the same source account. The reference (EREF) was different but not present in the CSV file. I decided that the CSV files are not good enough, so I've written a pdf2json and json2csv converter in python. It works for my bank statements from 2019 until today (~1300 transactions) and I construct the default description for firefly from Verwendungszweck and Referenz. No duplicates are detected anymore. I have also transactions without any description (Verwendungszweck) but only a reference value (Referenz).

BTW: If anybody is interested in the script - to convert ING DiBa stements (Kontoauszüge) from PDFs to JSON/CSV, let me know and I will open source the tool. It can be used as a drop in replacement for the official ING DiBa CSV files, just with a better description.

It would be nice if firefly-iii-fints-importer would support to construct the description for firefly from the source data of the fints response. What I see from my debugging message is this:

escription1":protected]=> string(153) "EREF+Zahlbeleg ****54687929MREF+DE000201000200000000000000009198417CRED+DE93ZZZ0000007****SVWZ+Festnetz Vertragskonto ****341962 RG ****319904/24.08.2022" 
 ["description2":protected]=> string(0) "" 
 ["structuredDescription":protected]=> array(4) { 
 ["EREF"]=> string(22) "Zahlbeleg 33865468****" 
 ["MREF"]=> string(35) "DE00020100020000000000000000919****" 
 ["CRED"]=> string(18) "DE93ZZZ0000007****" 
 ["SVWZ"]=> string(58) "Festnetz Vertragskonto ****341962 RG ****319904/24.08.2022" } 
benjaminfrank commented 1 year ago

@timaschew i just found this issue. Are you still open to publish your scripts vor maybe already die so? I woild be interested in them

timaschew commented 1 year ago

Hi @benjaminfrank I need some help from you to make the tool working. Currently I have some hard coded value which contains my bank account.

Can you please tell me what you see on your PDF statements (Kontoauszüge) on the left lower corner vertically – the letters are rotatet by 90 degree, so you can read it normalle if you rotate the paper 90 degrees to the right.

Please just share the non-bank account characters, the pattern for me looks like this:

34GKKA<BANK-ACCOUNT>_T

I have also some older PDF statements which have a slightly different pattern.

Please also share in which country your ING account is.

benjaminfrank commented 1 year ago

Can you please tell [...] 34GKKA_T

Same here

Please also share in which country your ING account is.

Germany

I have also some older PDF statements which have a slightly different pattern.

My oldest statements are from 2019 and all of them have the pattern. However, I do have multiple kinds of additional accounts with slightly different patterns:

timaschew commented 1 year ago

Thanks for providing the information. I will adjust my python script. You have one PDF per account type, right?

BTW: Usually I have this pattern 34GKKA but for one statement for December 2019 it's differenet: 34GIRO

I will rewrite my script so that it will scan for all the patterns (without account number), I hope the string is uniuqe enough so that it is not detected in some other occurences.

34STAN seems good to be unique, for others I can check the pattern beginning + 10 numbers + _T

Or do you think it makes more sense to type in account number to the script?

benjaminfrank commented 1 year ago

I would say go the easy route and once the script is available we can iterate in case we find problems

timaschew commented 1 year ago

https://github.com/timaschew/ing-pdf-converter