diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-14 14:08:52 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-14 14:08:52 -0600 |
commit | 8654cea10f6902719006d5975db7dc07b2fcc713 (patch) | |
tree | 6cf0608a089c234056746a467f739722687b645a /kmymoney2/mymoney/mymoneyforecast.cpp | |
parent | 2a54aa58cfe166f48d6f1395cbc6c9bfd5e31bfc (diff) | |
download | kmymoney-8654cea10f6902719006d5975db7dc07b2fcc713.tar.gz kmymoney-8654cea10f6902719006d5975db7dc07b2fcc713.zip |
Update to upstream stable version 1.0.5
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; |