-
Notifications
You must be signed in to change notification settings - Fork 20
entry_date': undefined method
month'
#52
Comments
Hey @yuvke, do you mind adding a small line? Before this line here: it would help if you add a
and post the output here (the one just before it fails). Please make sure that you remove all sensitive information from the output I suspect that your bank returns some weird value. |
Hey @schurig, thank you for the help. <Cmxl::Fields::Transaction:0x00007fc0022e9d88
@tag=\"61\",
@modifier=nil,
@source=\"SOMEIDXXXX,1902290301DR3\",
@data={
\"date\"=>\"190229\",
\"entry_date\"=>\"0301\",
\"storno_flag\"=>\"\",
\"funds_code\"=>\"D\",
\"currency_letter\"=>\"R\",
\"amount\"=>\"3,00\",
\"swift_code\"=>\"XXXX\",
\"reference\"=>\"NONREF\",
\"bank_reference\"=>\"\"
},
@match=#<MatchData \"SOMEIDXXXX,1902290301DR3\"
date:\"190229\"
entry_date:\"0301\"
storno_flag:\"\"
funds_code:\"D\"
currency_letter:\"R\"
amount:\"3,00\"
swift_code:\"N024\"
reference:\"NONREF\"
bank_reference:\"\"
>,
@details=#<Cmxl::Fields::StatementDetails:0x00007fc0022e96f8
@tag=\"86\",
@modifier=nil,
@source=\"809?VERYLONGIDWITHTONSOFCHARACTERSANDQUESTIONMARKS\",
@data={
\"transaction_code\"=>\"809\",
\"details\"=>\"?VERYLONGIDWITHTONSOFCHARACTERSANDQUESTIONMARKS\",
\"seperator\"=>\"?\"
},
@match=#<MatchData \"809?VERYLONGIDWITHTONSOFCHARACTERSANDQUESTIONMARKS\"
transaction_code:\"809\"
details:\"?VERYLONGIDWITHTONSOFCHARACTERSANDQUESTIONMARKS\"
seperator:\"?\"
>
>
> |
@schurig, could this be related to the fact that I'm running the script directly from the terminal and via the docker container? I'm running on Mac and I have ruby installed, but maybe not the correct version? |
@yuvke I just had some time to check into it and it seems like it's a combination of your bank and the ruby library cmxl that I'm using: https://github.com/railslove/cmxl/blob/master/lib/cmxl/fields/transaction.rb#L63-L67 |
Got the same problem now with my bank. worked one month ago... :-( I played a bit... it has to do sth with the februrary... he is trying getting the month of "190230" ... the 30th of Februrary 2019 does not exist... I "fixed" this by modifying fints.rb --> statement = client.get_statement(account, Date.today - 30, Date.today - 9) |
@BluetriX - thanks for the tip! I managed to skip the problematic dates (mine was February 29). And enter the remaining statements manually! @schurig - Any idea why this happens? Is the faulty date due to the bank's API or the cmxl lib? |
This happens to me on Sparkasse. I would change the date to 28/2 so that the transaction would be valid. Is it possible? |
I will have a look into it and will try to do it asap. Probably not today but next week |
Hi there. Updates on this? Just ran into the same issue. Great work btw! |
I just fixed the issue. Sorry, I forgot that this was still open. Be aware that if you use the latest version you might get some duplicates imported. YNAB will ask you to approve them. So you can simply select all the transactions it asks you to approve and remove them if you think it's a duplicate. Will only effect transactions within the last 35 days. 😊 |
Thanks for acting on the issue. Actually, I think your fix doesn't resolve the issue, as the date in question is "190230". Just pulled the latest changes, the error is thrown again. :-( I can't reopen the issue, but it isn't resolved yet, I guess. For me, this happens on a transaction from the DKB bank in Germany, so it's not some little bank where you'd expect a general misbehaviour or false date calculation. So I'd expect the issue to not be directly related to february - maybe this can happen in other months too? How about just changing the date to the last possible day in the month in case it's a date like Feb 30 or April 31? |
Okay, inspected that a bit closer, here is some more information. First the error I get:
I inspected the failing transaction, it looks like this (removed some parts):
So the |
Simpler solution: In Sorry for not submitting this as a pr, having the relatives on the doorstep so I don't have the time right now. If you don't get to it, I'll submit one later. |
Just ran a quick test, seems to work. No error. I'll check the transactions later, but there are some new ones, so this looks good. 👍 Thanks! |
Hi,
I'm trying to run the script locally on Mac (directly in terminal, I have ruby installed).
I'm getting the following error:
My config is:
Any idea what may be causing this?
The text was updated successfully, but these errors were encountered: