Bug 476770 - default value for last date of import of transactions through HBCI is always 3 days too early
Summary: default value for last date of import of transactions through HBCI is always ...
Status: CLOSED NOT A BUG
Alias: None
Product: kmymoney
Classification: Applications
Component: onlinebanking (show other bugs)
Version: 5.1.3
Platform: Appimage Linux
: NOR wishlist
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-09 20:23 UTC by surcouf
Modified: 2023-11-15 18:04 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
this shows the menu Account -> import transactions from online banking, then the default value of last import date (181.07 KB, image/png)
2023-11-09 20:23 UTC, surcouf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description surcouf 2023-11-09 20:23:29 UTC
Created attachment 162992 [details]
this shows the menu Account -> import transactions from online banking, then the default value of last import date

SUMMARY
***
The default value for last date of import of transactions through HBCI is always 3 or 4 days earlier than the real last date of of update of transactions through HBCI.
***


STEPS TO REPRODUCE
1. open Kmymoney
2. select "Account → Update account..." in the menu, to import transactions from online banking for an account. (see screenshot as attachment)


OBSERVED RESULT

the default value of "last import date" is never the real one (example Nov 8th), visible in the kmymoney ledger of this account, but 3 or four days earlier than the "last import date" (example Nov 5th).

EXPECTED RESULT
the "last import date" shown should be the date of the latest transaction of the to-be-updated bank account. In my example, the default value shown by KMyMoney is november 5th although the newest transaction is from November 8th.

SOFTWARE/OS VERSIONS
KMyMoney (App-image): Version 5.1.3-db8f32618
Linux/KDE Plasma: Elementary OS 6.1

ADDITIONAL INFORMATION
Comment 1 Jack 2023-11-09 20:31:55 UTC
The default date is actually correct, but when the online options are set to download transactions since the last download, KMyMoney intentionally uses a data three days earlier.  I believe this was originally implemented because there was a report of a bank creating transactions dated to the previous day, which would never get downloaded if that actual date of last download was used.
I don't think this will be changed, but a possible wish list would be to allow the user to select the number of days by which the download request is adjusted.
Comment 2 surcouf 2023-11-09 21:04:36 UTC
thanks Jack for the background explanation.
- how can i transform this bug in a wish for "allow the user to select the number of days by which the download request is adjusted" ? Can this bug be transformed into a wish?
- regarding "because there was a report of a bank creating transactions dated to the previous day, which would never get downloaded if that actual date of last download was used" -> in this case, the user of this strange bank could also set the date he wants manually :) instead of imposing this behaviour to a whole software user community. It is not a big deal for me either to change the date value, but i am surprised to see some kind of individual case being implemented as a general rule.
Comment 3 Jack 2023-11-09 21:23:54 UTC
I can adjust the priority to wishlist.  You should be able to, but may not, based on how the bugzilla permissions are set up.

However, I see I've misinterpreted your issue.  What I've been talking about is that if you set that dialog (Start date of import) to the first choice "Last update" then KMyMoney actually requests transactions starting three days earlier than that.  There is little downside to the three extra days, as any transcations which have already been downloaded should be recognized as duplicates, and ignored.

I now see you are talking about the third selection "Pick date."  I have no idea where the default value in this field comes from.  I just looked at the file I currently have open, and "Last update" is set to 2023-11-04, which is indeed the last time I updated this account, but "Pick date" shows "2022-09-12."   It is possible I actually used this as a specific date at some point in the past, but don't remember.  In any case, the default value only matters the first time you ever select this choice for this account.  Once you have done that, whether you accept the default or change it, that date will still be there if you come back to this dialog at a later time - it will not be (or at least should not be) updated based on the current date.  My guess, based on nothing in particular, is that if this is the first time you have used that dialog, is that might be the date you created the account.  Basically, I suspect the "default" date in that field is initially set to something like the account's creation date, and thereafter only changed by the user, not by the program.

Does this make a bit more sense than my earlier rambling?
Comment 4 surcouf 2023-11-09 21:36:43 UTC
i am not allowed to change the bug's priority.

Regarding:
> However, I see I've misinterpreted your issue.  
i don't think so. Or the misunderstanding might depend on a language translation issue.
I would recommend you to look at my attachment in the bug description to make sure we talk about the same things.

- the first date option doesn't interest me for this bug, i don't consider it.
- My bug regards the 2nd date option (in my interface, this is the last update date = last transaction import date = should be Nov 8th but KMyMoney shows Nov 5th today)
- the last date option (that you call "pick date") is the date of today, in my screenshot difficult to read, but equals Nov 9th. It doesn't interest me for this bug, i don't consider it.

Is it clearer like this?
Comment 5 Jack 2023-11-09 21:53:53 UTC
Aha!  You are using HBCI, with which I have no experience.  It seems that when you update the account, you get to choose a start date for the download.  My best guess now is that dialog is provided by HBCI, not by KMyMoney itself.  Using KMyMoney's internal ofx means for online update, you need to edit the account to select how the start date requested from the bank is determined.  With HBCI it seems you get to choose that as part of each download process.  So, my comments are really not relevant, and we need to wait for someone with experience with the aqbanking software, which I believe is what implements the HBCI download.
Comment 6 Thomas Baumgart 2023-11-10 07:25:09 UTC
I'd like to point out a few things: 

a) it's KMyMoney not AqBanking code that does all that (in case you search it, it can be found in the KBanking plugin);
b) the user of this strange bank was me (there might be others too) and no, I don't do things manually;
c) never before (except this time) somebody complained about this date setting and its usage;
d) the code to do that is unchanged for 14+ years.

You can get around this dialog by opening the account editor, select the online banking tab, then the download sub-tab and change "Ask user" to "Last download". That will bypass the dialog during the download.

BTW: The functionality of subtracting 3 days from the date of the last download will not change. We can certainly argue about the display, but I think that is a minor issue (see c) in the above list)
Comment 7 surcouf 2023-11-15 18:03:46 UTC
Many thanks for your comment
(In reply to Thomas Baumgart from comment #6)
> I'd like to point out a few things: 
...
> You can get around this dialog by opening the account editor, select the
> online banking tab, then the download sub-tab and change "Ask user" to "Last
> download". That will bypass the dialog during the download.
this is exactly my use case, many thanks for the hint!

Now KMyMoney always downloads from the last (included) download day, recognizes the duplicate transactions (the one of the exactly last download day) properly and insert the new transactions.