Bug 381057 - Dashboard portfolio widget: More accurate initial amount
Summary: Dashboard portfolio widget: More accurate initial amount
Status: RESOLVED INTENTIONAL
Alias: None
Product: skrooge
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Neon Linux
: NOR wishlist
Target Milestone: 25.1.0
Assignee: Stephane MANKOWSKI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-10 07:13 UTC by Bernhard Scheirle
Modified: 2017-06-10 11:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.