Bug 223349 - Use adjustedDate in Calendar View and Forecast Reports
Summary: Use adjustedDate in Calendar View and Forecast Reports
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Fedora RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-18 23:59 UTC by Ian Neal
Modified: 2010-01-20 01:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Payment Dates patch v0.1 (17.98 KB, patch)
2010-01-19 02:02 UTC, Ian Neal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Neal 2010-01-18 23:59:20 UTC
Version:           3.95 (using KDE 4.3.4)
OS:                Linux
Installed from:    Fedora RPMs

At the moment neither the Calendar View of Scheduled Transactions nor any of the Forecast Reports take any notice of scheduled transaction that get moved from non-processing days. This causes both to give an invalid representation of the future state of accounts.
Comment 1 KMyMoney Devel Mailing List 2010-01-19 00:49:01 UTC
Both use the nextPayment method. If an alternative nextAdjustedPayment is provided, then it's an easy fix.
Comment 2 Ian Neal 2010-01-19 02:02:36 UTC
Created attachment 40023 [details]
Payment Dates patch v0.1

This patch:
* Creates a new method in mymoneyscheduled.cpp called adjustedNextPayment that returns a date adjusted, where appropriate, for non-processing days;
* addScheduledTransactions in mymoneyforecast.cpp makes use of new method to calculate the correct totals of each day of each schedule;
* Tidies up adjustedNextDueDate;
* paymentDates in mymoneyscheduled.cpp makes use of adjustedDate to create a properly adjusted for non-processing days list of dates for a scheduled transaction;
* updates mymoneyscheduletest.cpp so testPaymentDates does not fail with adjusted dates.
Comment 3 KMyMoney Devel Mailing List 2010-01-19 03:31:01 UTC
It looks good to me. 

There is one more place to change for the reports, in pivottable.cpp, line 193 and on.
Comment 4 Alvaro Soliverez 2010-01-19 03:43:10 UTC
SVN commit 1076906 by asoliverez:

Have forecast and reports use the adjusted date.
The calendar view is still to go.
BUG:223349

 M  +4 -3      mymoney/mymoneyforecast.cpp  
 M  +34 -36    mymoney/mymoneyscheduled.cpp  
 M  +14 -0     mymoney/mymoneyscheduled.h  
 M  +40 -23    mymoney/mymoneyscheduletest.cpp  
 M  +1 -1      reports/pivottable.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1076906
Comment 5 KMyMoney Devel Mailing List 2010-01-19 03:50:45 UTC
I commited the patch by Ian Neal. The calendar view will be a bit more tricky.
Comment 6 Ian Neal 2010-01-19 23:06:38 UTC
As far as I am aware the calendar view uses the widget kmymoneyscheduledcalendar which in turn uses the kMyMoneyScheduledDateTbl widget. That uses scheduleListEx which is implemented by the various storage methods all of which, as far as I can see, use paymentDates to generate the list of scheduled transactions that are due to occur on a particular day.
As this patch fixed paymentDates, is there anything else that is needed for calendar view?
Comment 7 KMyMoney Devel Mailing List 2010-01-19 23:23:03 UTC
You are right. It should be fixed then. Can you confirm?
Comment 8 Ian Neal 2010-01-19 23:46:56 UTC
(In reply to comment #7)
> You are right. It should be fixed then. Can you confirm?

Yes, all seems fixed for all the tests I can do.