From kde-commits Mon Apr 30 22:47:40 2012 From: Alvaro Soliverez Date: Mon, 30 Apr 2012 22:47:40 +0000 To: kde-commits Subject: [kmymoney] kmymoney/reports: Bugdet reports: Skip budget account if periods for the account Message-Id: <20120430224740.B7CE7A60A9 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=133582619310476 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() =3D=3D MyMoneyAcc= ount::Expense) ? -1 : 1, 1); = const QMap& periods =3D (*it_ba= cc).getPeriods(); + + // skip the account if it has no periods + if (periods.count() < 1) { + ++it_bacc; + continue; + } + MyMoneyMoney value =3D (*periods.begin()).amount() * reverse; - MyMoneyMoney price =3D MyMoneyMoney(1, 1); int column =3D 1; = // based on the kind of budget it is, deal accordingly