Introduce second date field to PP model for booking / EX AND valuta date#5420
Introduce second date field to PP model for booking / EX AND valuta date#5420ZfT2 wants to merge 1 commit intoportfolio-performance:masterfrom
Conversation
|
Hello @ZfT2 , Perhaps you could take a look at pull request #3324 and then reconsider... I'm really sorry, but no one is going to look at +6000 source code changes if the implementation of problems such as model and is not implemented step by step. Best regards, |
|
Ahh ok, I didn't see that there is #3324 already. My change here tries to cover both: ex date and booking date. First for dividend, second for account statements. Regarding the size of changes: As I already explaind, it is only because of the method renaming. It is no problem to add a delegate method and the change count becomes much smaller. |
|
@ZfT2 Thanks for putting this on the agenda. @Nirus2000 would say "again" and hope for "finally included" ;-) In short: my opinion is that PP should suport the Ex-dividend date (ex-date) but not separate between booking and valuta date. My understanding is this:
All transactions could carry a booking and valuta data, only dividend transactions (and maybe interest?) additionally have a third date, the ex-dividend date. I get the argument to include the "ex-dividend date" for dividend payments. To be 1000% correct, one would record the dividend on the ex-dividend date as performance (that is when the instrument is trading without the dividends) even if it only shows up on the account on the booking/valuta date. In fact, some users do it this way: record the dividend on an extra account, and then transfer it to the reference account on the date of the valuta date. We can discuss the implementation later, but briefly that would mean extending the AccountTransaction with an exDate (of course, subclassing AccountTransaction could be an option as well, but let's see how that would complicate the code base), then update the UI to allow editing the ex-date, update the PDF importer with a correct import, update the performance calculation (e.g. with an virtual account for the accrued dividends). I do not get the argument about the booking vs. valuta date. PP would need to calculate always with the valuta date. Yes, some operations would be easier for the user to document (say when the bank is "fixing" an old transaction, it has a current booking date but an old valuta date). However, overall I have the feeling that it would unnecessarily complicate the user interface and user experience with - I feel - limited benefits. I would also argue that 3 out of the 4 links in the description actually point to the "ex-dividend date" and not the "booking/valuta date". If you see this different, please make the argument here! |
Thank you for your thoughts about this, @buchen :)
But the interest here is paid for the financial investment in 2025. So if saving both dates, we have the change to represent this in the stats later on... |
@ZfT2 Ok, but what do you want PP to do differently now? What algorithm do you want PP to change? I understand the preference to choose whether to assign it to 2025 or keep it with the valuta date. But that seems to be a change on the level of each transaction. And then how do you imagine the user telling PP which date to use? Please do not get me wrong: I push back to get to the best argument. My fear is that it clutters the user experience (two rows of dates, more input fields in the dialogs, more explanation what the difference is and when it matters and when not). I just looked at a dividend payment. Here are the dates I found:
Here I see why I support (now) adding an ex-date for dividends. And the ex-date has specific semantics: performance is recorded on ex-date (on 13 March), kept in a separate "accrued dividends" account, and then moved to the original account on 28 March. But the separating of booking date and valuta date seems negligible. BTW, my Deutsche Bank PDF document does not contain the ex-date itself. @Nirus2000 is this different for other bank documents? Because even if we extend the model with the ex-date, filling it properly requires the info in the document. Do you have a gut feeling how many banks report the ex-date? |
No worries, to be honest, I still have not thought about it in detail :) As described, I wanted to provide a "first step change" to store it, purely informational, without any impact on calculations or performance. If storing it, first, purely informational, my personal use case would be I use the PP PDF importers to import transactions from my daily savings and fixed accounts from different banks. Of course, to track the performance in PP, but for those banks, who doesn’t provide a FinTS / HBCI interface, I use the PP CSV export and then import the CSV file in my homebanking software, which has also two date fields.
SBroker, Raiffeisen, Postbank, Onvista, Traderepublic, Baaderbank, ING Diba, DKB, Santander, Targobank, Scalable ... and some more seem to provide it. Try a Text search over the PDF debug files with "Ex-Tag" to get an overview :) |
I would prefer to separate ex-date from the booking date. My gut feeling is that mixing both concerns makes it harder. And a dividend transaction can also have a valuta date and a booking date. @ZfT2 Would you be willing to - maybe as a separate pull request - to create a first draft? At an "exDate". I assume only the date, not with a timestamp. To the AccountTransaction. Used only for the Dividends. Add a check that ensure consistency.
That is a good idea. Also for the ex-date because I do not think that the majority of the users would want to look up and maintain the ex-date. There also the UI should remain simple.
Yes, one could add such an option, but what does it mean to switch globally between valuta and booking date? And out of curiosity, what is your home banking software doing with those two dates (in terms of calculation)?
Ok, that is a "purely informational" und "pass-thru use case" that would not require any UI. But it is also not a primary use case for PP... But I understand your use case. Maybe it could be an option to keep this things hidden from normal users, but one can activate a "nerd mode". |
Good point. In my files I have no dividend transactions with different valuta and booking date, but who knows...
What do you mean with consistency check? Yes, I can do that. So I would:
Is it too much or anything else for the "MVP"?
If, I think I would make sense not to have the option globally, but (at least) per account. So one could set it for the accounts where the bank books the account settlement with different dates, overlapping the reporting period.
Nothing :) But it enables me to verify the interest calculation ;)
Would be really nice to have it... Yes, no UI is required for that, just storing the complete booking like the bank is providing it. I think if with "nerd mode" or not, should not matter, but both is fine for me. And don't be afraid the files are blown up :) In my experience, most bookings have only on date, so we can also check here too to add the second date only if it is different. |
No. I think we need to know if the user has entered an ex-date (even if it is the same as the valuta date). Therefore I would propose: it is null (uses almost no storage) or it is given (uses little storage if it is the same).
I hope there are no existing test cases to change (unless we change one importer). The "ex-date" should add functionality, but should not change existing functionality (assuming that existing dividend transactions have no ex-date).
You can do so. But keep it as a separate commit on the same pull request. I also think we should keep the pull requests separately. Let's first focus on adding the ex-date. |
Here is a first draft to introduce a second date field to the PP files for handling the different dates used inside the transaction, see issues:
https://forum.portfolio-performance.info/t/buchung-von-dividenden-am-ex-tag-oder-bei-gutschrift
#2173
#2074
https://forum.portfolio-performance.info/t/buchungsdatum-vs-valutadatum
I tried to keep it small and simple (don't worry about the changed files count, I will explain it below ;) ) :
So the PR wants, as a first step, only provide the possibility to store a second date for each transaction from the PDF transaction files.
It can be the basis, that one can extend PP later on to use the right date for the performance / calculation stats :)
Here the main steps I did:
Through the renaming from "date" to "dateValue" all the 200+ PDF importers are shown as changed. But its is just the method name change :)
Only, as a demonstration, I already adjusted the Nordax PDF importer to use both dates, dateValue AND dateBooking.
Open points from my side:
naming: For now, I named the date fields, as explained, dateValue and dateBooking, but maybe that is not the best?
Should I, as "value" has already a meaning in a programming language, better call it "dateValuta" or something else?
I guess "dateBooking" is fine for account statements, but for dividends, dateEx is better? Or a more generic name, maybe something like "dateTransaction"?
To avoid that every PDF importer looks changed with this PR, maybe keep a setDate() and getDate() method in Transaction and delegate it to get/set dateValue?
Comments are welcome :)