[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kmymoney] kmymoney/reports: Bugdet reports: Skip budget account if periods for the account
From:       Alvaro Soliverez <asoliverez () kde ! org>
Date:       2012-04-30 22:47:40
Message-ID: 20120430224740.B7CE7A60A9 () git ! kde ! org
[Download RAW message or body]

Git commit 9a70a400fedd6ac704f99c244bd0882da81145b8 by Alvaro Soliverez.
Committed on 28/04/2012 at 00:23.
Pushed by asoliverez into branch 'master'.

Bugdet reports: Skip budget account if periods for the account
have not been loaded
BUG:290737
REVIEW:104766

M  +7    -1    kmymoney/reports/pivottable.cpp

http://commits.kde.org/kmymoney/9a70a400fedd6ac704f99c244bd0882da81145b8

diff --git a/kmymoney/reports/pivottable.cpp b/kmymoney/reports/pivottable.cpp
index 565c71b..37716c0 100644
--- a/kmymoney/reports/pivottable.cpp
+++ b/kmymoney/reports/pivottable.cpp
@@ -877,8 +877,14 @@ void PivotTable::calculateBudgetMapping(void)
         MyMoneyMoney reverse((splitAccount.accountType() == MyMoneyAccount::Expense) ? -1 : 1, 1);
 
         const QMap<QDate, MyMoneyBudget::PeriodGroup>& periods = (*it_bacc).getPeriods();
+
+        // skip the account if it has no periods
+        if (periods.count() < 1) {
+            ++it_bacc;
+            continue;
+        }
+
         MyMoneyMoney value = (*periods.begin()).amount() * reverse;
-        MyMoneyMoney price = MyMoneyMoney(1, 1);
         int column = 1;
 
         // based on the kind of budget it is, deal accordingly
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic