From 8654cea10f6902719006d5975db7dc07b2fcc713 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 14 Jan 2012 14:08:52 -0600 Subject: Update to upstream stable version 1.0.5 --- kmymoney2/mymoney/mymoneyforecast.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'kmymoney2/mymoney') 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 schedule; schedule = file->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - TQDate::currentDate(), forecastEndDate()); + TQDate(), forecastEndDate()); if(schedule.count() > 0) { TQValueList::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; -- cgit v1.2.1