raphaelm / python-fints

Pure-python FinTS (formerly known as HBCI) implementation
https://pypi.python.org/pypi/fints
GNU Lesser General Public License v3.0
334 stars 81 forks source link

Got wrong value for entry_date #77

Open kmille opened 5 years ago

kmille commented 5 years ago

Hey,

I have two bank transfers which have as entry_date Date(2019, 12, 28) which lays way in the future. The rest of the transactions look fine. The two wrong transactions are from the same day/company/terminal.

Is this a bug of the fints library or the bank (ING)? I use the the newest version of you library: (venv) kmille@linbox finfoo master % pip freeze | grep fints fints==2.1.1

The code is like that:

url_backend = "https://fints.ing-diba.de/fints/"
blz_ing = "50010517"

self.fints = FinTS3PinTanClient(self.settings['blz_ing'], self.settings['username'], self.settings['password'], self.settings['url_backend'])self.accounts = self.fints.get_sepa_accounts()

for account in self.accounts
    transactions = self.fints.get_transactions(account)
        for transaction in transactions:
            set_trace()

ipdb> transaction                                          
<Transaction[2019-01-04] <-58 EUR>>
ipdb> transaction.data                                     
{'status': 'D', 'funds_code': None, 'amount': <-58 EUR>, 'id': 'NMSC', 'customer_reference': None, 'bank_reference': None, 'extra_details': '', 'currency': 'EUR', 'date': Date(2019, 1, 4), 'entry_date': Date(2019, 12, 28), 'guessed_entry_date': Date(2018, 12, 28), 'transaction_code': '005', 'posting_text': 'Lastschrifteinzug', 'prima_nota': '009500', 'purpose': '<redacted> BAD KISSINGKAUFUMSATZ22.<redacted>', 'applicant_bin': None, 'applicant_iban': None, 'applicant_name': 'VISA KISSSALIS- THERME     ', 'return_debit_notes': None, 'recipient_name': None, 'additional_purpose': None, 'gvc_applicant_iban': None, 'gvc_applicant_bin': None, 'end_to_end_reference': None, 'additional_position_reference': None, 'applicant_creditor_id': None, 'purpose_code': None, 'additional_position_date': None, 'deviate_applicant': None, 'deviate_recipient': None, 'FRST_ONE_OFF_RECC': None, 'old_SEPA_CI': None, 'old_SEPA_additional_position_reference': None, 'settlement_tag': None, 'debitor_identifier': None, 'compensation_amount': None, 'original_amount': None}

As you can see: 'date': Date(2019, 1, 4) 'entry_date': Date(2019, 12, 28)

If you need any help please ask.

Thank you!

raphaelm commented 5 years ago

Sorry for the late response. Can you enable debug logging?

import logging
logging.basicConfig(level=logging.DEBUG)

Feel free to send me the logs privately.

kmille commented 5 years ago

Any idea how I can call the get_transactions function to only get the wrong transaction? Don't want to send you all of my transactions :)

 20 start = arrow.get("3.1.2019", "D.M.YYYY")
 21 end = arrow.get("5.1.2019", "D.M.YYYY")
 22 accounts = fints.get_sepa_accounts()
 23 for account in accounts:
 24     #transactions = fints.get_transactions(account, start_date= start.datetime, end_date=end.datetime)
 25     #transactions = fints.get_transactions(account, start_date=arrow.now().datetime)
 26     transactions = fints.get_transactions(account)
 27     for transaction in transactions:
 28         if transaction.data['amount'].amount == -58:
 29             print(transaction)
 30             print(transaction.data['entry_date'])
 31             print(transaction.data['date'])
 32 #            set_trace()
 33 
(venv) kmille@machtnix finfoo master % python test-bug.py                                                                                                                    ~/projects/finfoo
<Transaction[2019-01-04] <-58 EUR>>
2019-12-28
2019-01-04

The two tries with the comment are unfortunately not working

kmille commented 5 years ago
transactions = fints.get_transactions(account, start_date= start.datetime, end_date=end.datetime)

(venv) kmille@machtnix finfoo master % python test-bug.py                                                                                                                    ~/projects/finfoo
<Transaction[2019-01-03] <-10 EUR>>
2019-01-03
2019-01-03
<Transaction[2019-01-03] <-14.99 EUR>>
2019-01-03
2019-01-03
<Transaction[2019-01-08] <-7.07 EUR>>
2019-01-03
2019-01-08
<Transaction[2019-01-08] <-16.61 EUR>>
2019-01-03
2019-01-08
<Transaction[2019-01-09] <-2.56 EUR>>
2019-01-04
2019-01-09

=> the wrong transaction is not in there

transactions = fints.get_transactions(account, start_date=arrow.now().datetime)

(venv) kmille@machtnix finfoo master % python test-bug.py                                                                                                                    ~/projects/finfoo
Dialog response: 3060 - Teilweise liegen Warnungen/Hinweise vor.
Dialog response: 3010 - Es liegen keine Einträge vor.
<Transaction[2019-07-29] <-50 EUR>>
2019-07-29
2019-07-29
<Transaction[2019-07-29] <-44 EUR>>
2019-07-29
2019-07-29

=> the wrong transaction is not in there
raphaelm commented 5 years ago

Hi,

sorry, the transaction objects won't help. If you enable debug logging, you should see the full FinTS trace. Somewhere in there, you should see a blob of MT940 data, where you can look for the wrong transaction. If it's already in there with the future date, it's an error with the bank. Otherwise, it's a parse error.

kmille commented 5 years ago

sorry for the delay. I'm pretty busy atm. But I will send you the logs

Tricade commented 4 years ago

@kmille Have you checked the transactions on the ING Website? In WISO MeinGeld are always transaction with a future date, those are noted sales (vorgemerkte Umsätze), maybe thats why they are in the future.

ING is the only bank i use with this "feature"

kmille commented 4 years ago

No I think it was a special case. Don't know why. And I still have no clue how to give @raphaelm the log files. It's not that relevant for me. Even so I'm thinking about moving away from ING. GLS Bank for future :bank::evergreen_tree:

tloebhard commented 3 years ago

Double of #42? And there the issue is linked to the source: https://github.com/WoLpH/mt940/issues/17 So just use guessed_entry_date?