Bug 236097

Summary: Forecast reports do not include overdue scheduled transactions
Product: [Applications] kmymoney Reporter: Ian Neal <iann_bugzilla>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: CLOSED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description Ian Neal 2010-05-03 00:31:50 UTC
Version:           3.97.2 (using KDE 4.4.2)
Compiler:          gcc 4.4.1 
OS:                Linux
Installed from:    Fedora RPMs

Steps to reproduce:
1) Set up an account with some scheduled transactions in the past
2) Create a forecast report for that account
3) Run forecast report

Expected result
1) Forecast report includes overdue transactions

Actual result
1) Forecast report excludes overdue transactions

This also happens on 1.0.x
Comment 1 Alvaro Soliverez 2010-05-03 01:17:44 UTC
SVN commit 1122019 by asoliverez:

Make sure the schedules list for forecast calculation includes the overdues
BUG:236097

 M  +1 -1      mymoneyforecast.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1122019
Comment 2 Alvaro Soliverez 2010-05-03 01:21:54 UTC
The forecast was only looking for schedules from current date on, so the overdues were left out. Fixed now.
Comment 3 Ian Neal 2010-05-03 11:16:02 UTC
This is definitely better but still not 100% fixed.
Scheduled transactions that are overdue do go into the forecast but are put in for tomorrow and not today.
I did try looking at it and if you change the mymoneyforecast.cpp code where it says (lines 680 and 707):
forecastDate = QDate::currentDate().addDays(1);
to:
forecastDate = QDate::currentDate();
Those overdue transactions disappear completely due to the line (at 684):
for (QDate f_day = QDate::currentDate(); f_day < forecastDate;) {
Should that be f_day <= forecastDate?
Comment 4 Alvaro Soliverez 2010-05-03 11:41:13 UTC
The logic behind that, is that when the forecast informs the current balance, it is the real, actual balance. 

So, any overdue transaction is informed after that. That's the way it has always been, and I don't see that changing.
Comment 5 Ian Neal 2010-05-03 11:56:26 UTC
(In reply to comment #4)
> The logic behind that, is that when the forecast informs the current balance,
> it is the real, actual balance. 
> 
> So, any overdue transaction is informed after that. That's the way it has
> always been, and I don't see that changing.

So the forecast assumes no additional transactions will be happening on the current date? If that is so, should we not be starting the forecast report from tomorrow not today?
Comment 6 Alvaro Soliverez 2010-05-03 12:21:06 UTC
Informing you today has the purpose of telling you what your current balance is. That is an actual and known data, and as such, serves as reference for the user.
After all, forecast is nothing else than an inference, and we should give to the users as much info as possible to make their own conclusions.
Comment 7 Ian Neal 2010-05-03 12:32:56 UTC
Can this be also backported to 1.0.x?
Verifying that overdue scheduled transactions now do show up on the forecast report.
Comment 8 Alvaro Soliverez 2010-05-04 01:52:18 UTC
I have backported it to 1.0.4 SVN