diff options
Diffstat (limited to 'kmymoney2/mymoney/mymoneyforecast.cpp')
-rw-r--r-- | kmymoney2/mymoney/mymoneyforecast.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/kmymoney2/mymoney/mymoneyforecast.cpp b/kmymoney2/mymoney/mymoneyforecast.cpp index bfecce0..c1c88c7 100644 --- a/kmymoney2/mymoney/mymoneyforecast.cpp +++ b/kmymoney2/mymoney/mymoneyforecast.cpp @@ -651,7 +651,7 @@ void MyMoneyForecast::addScheduledTransactions (void) TQValueList<MyMoneySchedule> schedule; schedule = file->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - TQDate::currentDate(), forecastEndDate()); + TQDate(), forecastEndDate()); if(schedule.count() > 0) { TQValueList<MyMoneySchedule>::Iterator it; do { @@ -871,8 +871,21 @@ MyMoneyMoney MyMoneyForecast::accountCycleVariation(const MyMoneyAccount& acc) MyMoneyMoney cycleVariation; if (forecastMethod() == eHistoric) { - for(int t_day = 1; t_day <= accountsCycle() ; ++t_day) { - cycleVariation += m_accountTrendList[acc.id()][t_day]; + switch(historyMethod()) { + case 0: + case 1: + { + for(int t_day = 1; t_day <= accountsCycle() ; ++t_day) { + cycleVariation += m_accountTrendList[acc.id()][t_day]; + } + } + break; + + case 2: + { + cycleVariation = m_accountList[acc.id()][TQDate::currentDate().addDays(accountsCycle())] - m_accountList[acc.id()][TQDate::currentDate()]; + } + break; } } return cycleVariation; |