Bug 381057

Summary: Dashboard portfolio widget: More accurate initial amount
Product: [Applications] skrooge Reporter: Bernhard Scheirle <bernhard+kde>
Component: generalAssignee: Stephane MANKOWSKI <stephane>
Status: RESOLVED INTENTIONAL    
Severity: wishlist CC: stephane
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: 25.1.0   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Bernhard Scheirle 2017-06-10 07:13:05 UTC
Currently the dashboard portfolio widget calculates the initial amount with the unit value at the end of the buy month.

I propose to change this so the initial amount will be computed from the unit value at the end of the buy *day*.
(I know that this is still not 100% accurate, since you could buy multiple times in a single day for different costs. But that is fine with me.)

Date     Cost per unit   Amount bought
15.5.17  242,169€        0,809
31.5.17  237,650€        0,000
07.6.17  240,599€        0,814
09.6.17  242,520€        0,000

Current  initial amount: 393,32€ = 0,809 * 237,650€ + 0,814 * 242,520€
Proposed initial amount: 391,76€ = 0,809 * 242,169€ + 0,814 * 240,599€       


Skrooge Version: 2.8.1
Comment 1 Stephane MANKOWSKI 2017-06-10 10:13:07 UTC
Hi Bernhard,

I checked the code, the initial amount is computed like this:
current.initalAmount += obj.getAmount(obj.getDate());

So, it means that the initial amount is computed at the date of the operation, as expected.

Could you check on your side?
Comment 2 Bernhard Scheirle 2017-06-10 11:52:00 UTC
Hi Stephane,

you're right.
My data is wrong, and I even checked it twice before I opened this issue. -.- 

Sorry for the noise.
Comment 3 Stephane MANKOWSKI 2017-06-10 11:59:58 UTC
No problem. I close this incident.