MoritzR / fints2ledger

A tool for downloading transactions from FinTS banking APIs and sorting them into a ledger journal
MIT License
27 stars 8 forks source link

Don't delete transactions from csv-file before start date #16

Closed varac closed 2 years ago

varac commented 3 years ago

My bank requires a TAN when fetching transactions older than 3 month. To make my life easier, I use --date set to 3 month in the past to circumvent this. However, fints2ledger always removes transactions from the csv-file which are older than the start date. Please fix this (maybe add a cli flag --retain-old-transactions or sth like this?). Thanks!

varac commented 3 years ago

Since fints2ledger cannot handle TANs (#6) and many banks require TANs when fetching all available transactions this becomes important.

MoritzR commented 3 years ago

Mh, it's not super straighforward to implement this. The csv file is overwritten each time the transactions are fetched. I could append instead but without some deduplication you can easily get lots of duplicated lines in the csv.

Can you add some information on when this becomes an issue? My bank straight up only provides the last 90 days in any case, but I have never experienced the csv being an issue in that process.

Sorry for the late reply.

varac commented 3 years ago

Also sorry for late reply :) I found a way to work around this, so it's not an issue for me anymore.

varac commented 2 years ago

I'd still love to have this feature. I'd like to archive my transactions also as csv for historic purposes. right now, as you said,

The csv file is overwritten each time the transactions are fetched.

Or do you know a way how I can achieve this ? How are you doing it ?

MoritzR commented 2 years ago

How are you doing it ?

For me the ledger file is already my archive. It is nice to work with using a client like hledger. I can check reports or search for specific transactions. Additionally my bank sends me bank statements regularly, so I also have the transactions there, should I ever need that.

What are your reasons for keeping them in a csv aswell?

Or do you know a way how I can achieve this ?

Not really. I didn't intend for the csv to be anything but an intermediate storage. You could use the --date flag to only request transactions since your last request. But even then you might might miss or duplicate a transaction. I use this flag mainly when I change something in the template, which breaks the deduplication. Then I pick a date where I will only get 1 or 2 duplicated entries, which I can then resolve manually.

Other than that I have no specific idea.