Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/reports/pivottable.cpp
Context not available. | |||||
130 | // Initialize outer groups of the grid | 130 | // Initialize outer groups of the grid | ||
---|---|---|---|---|---|
131 | // | 131 | // | ||
132 | if (m_config.rowType() == MyMoneyReport::eAssetLiability) { | 132 | if (m_config.rowType() == MyMoneyReport::eAssetLiability) { | ||
133 | m_grid.insert(KMyMoneyUtils::accountTypeToString(MyMoneyAccount::Asset), PivotOuterGroup(m_numColumns)); | 133 | m_grid.insert(KMyMoneyUtils::accountTypeToString(eMyMoney::Account::Asset), PivotOuterGroup(m_numColumns)); | ||
134 | m_grid.insert(KMyMoneyUtils::accountTypeToString(MyMoneyAccount::Liability), PivotOuterGroup(m_numColumns, PivotOuterGroup::m_kDefaultSortOrder, true /* inverted */)); | 134 | m_grid.insert(KMyMoneyUtils::accountTypeToString(eMyMoney::Account::Liability), PivotOuterGroup(m_numColumns, PivotOuterGroup::m_kDefaultSortOrder, true /* inverted */)); | ||
135 | } else { | 135 | } else { | ||
136 | m_grid.insert(KMyMoneyUtils::accountTypeToString(MyMoneyAccount::Income), PivotOuterGroup(m_numColumns, PivotOuterGroup::m_kDefaultSortOrder - 2)); | 136 | m_grid.insert(KMyMoneyUtils::accountTypeToString(eMyMoney::Account::Income), PivotOuterGroup(m_numColumns, PivotOuterGroup::m_kDefaultSortOrder - 2)); | ||
137 | m_grid.insert(KMyMoneyUtils::accountTypeToString(MyMoneyAccount::Expense), PivotOuterGroup(m_numColumns, PivotOuterGroup::m_kDefaultSortOrder - 1, true /* inverted */)); | 137 | m_grid.insert(KMyMoneyUtils::accountTypeToString(eMyMoney::Account::Expense), PivotOuterGroup(m_numColumns, PivotOuterGroup::m_kDefaultSortOrder - 1, true /* inverted */)); | ||
138 | // | 138 | // | ||
139 | // Create rows for income/expense reports with all accounts included | 139 | // Create rows for income/expense reports with all accounts included | ||
140 | // | 140 | // | ||
Context not available. | |||||
269 | const MyMoneySplit& split = tx.amortizationSplit(); | 269 | const MyMoneySplit& split = tx.amortizationSplit(); | ||
270 | if (!split.id().isEmpty()) { | 270 | if (!split.id().isEmpty()) { | ||
271 | ReportAccount splitAccount = file->account(split.accountId()); | 271 | ReportAccount splitAccount = file->account(split.accountId()); | ||
272 | MyMoneyAccount::accountTypeE type = splitAccount.accountGroup(); | 272 | eMyMoney::Account type = splitAccount.accountGroup(); | ||
273 | QString outergroup = KMyMoneyUtils::accountTypeToString(type); | 273 | QString outergroup = KMyMoneyUtils::accountTypeToString(type); | ||
274 | 274 | | |||
275 | //if the account is included in the report, calculate the balance from the cells | 275 | //if the account is included in the report, calculate the balance from the cells | ||
Context not available. | |||||
315 | 315 | | |||
316 | MyMoneyMoney value; | 316 | MyMoneyMoney value; | ||
317 | // the outer group is the account class (major account type) | 317 | // the outer group is the account class (major account type) | ||
318 | MyMoneyAccount::accountTypeE type = splitAccount.accountGroup(); | 318 | eMyMoney::Account type = splitAccount.accountGroup(); | ||
319 | QString outergroup = KMyMoneyUtils::accountTypeToString(type); | 319 | QString outergroup = KMyMoneyUtils::accountTypeToString(type); | ||
320 | 320 | | |||
321 | value = (*it_split).shares(); | 321 | value = (*it_split).shares(); | ||
Context not available. | |||||
330 | } | 330 | } | ||
331 | 331 | | |||
332 | // Except in the case of transfers on an income/expense report | 332 | // Except in the case of transfers on an income/expense report | ||
333 | if (al_transfers && (type == MyMoneyAccount::Asset || type == MyMoneyAccount::Liability)) { | 333 | if (al_transfers && (type == eMyMoney::Account::Asset || type == eMyMoney::Account::Liability)) { | ||
334 | outergroup = i18n("Transfers"); | 334 | outergroup = i18n("Transfers"); | ||
335 | value = -value; | 335 | value = -value; | ||
336 | } | 336 | } | ||
Context not available. | |||||
884 | 884 | | |||
885 | //include the budget account only if it is included in the report | 885 | //include the budget account only if it is included in the report | ||
886 | if (m_config.includes(splitAccount)) { | 886 | if (m_config.includes(splitAccount)) { | ||
887 | MyMoneyAccount::accountTypeE type = splitAccount.accountGroup(); | 887 | eMyMoney::Account type = splitAccount.accountGroup(); | ||
888 | QString outergroup = KMyMoneyUtils::accountTypeToString(type); | 888 | QString outergroup = KMyMoneyUtils::accountTypeToString(type); | ||
889 | 889 | | |||
890 | // reverse sign to match common notation for cash flow direction, only for expense/income splits | 890 | // reverse sign to match common notation for cash flow direction, only for expense/income splits | ||
891 | MyMoneyMoney reverse((splitAccount.accountType() == MyMoneyAccount::Expense) ? -1 : 1, 1); | 891 | MyMoneyMoney reverse((splitAccount.accountType() == eMyMoney::Account::Expense) ? -1 : 1, 1); | ||
892 | 892 | | |||
893 | const QMap<QDate, MyMoneyBudget::PeriodGroup>& periods = (*it_bacc).getPeriods(); | 893 | const QMap<QDate, MyMoneyBudget::PeriodGroup>& periods = (*it_bacc).getPeriods(); | ||
894 | 894 | | |||
Context not available. | |||||
1402 | for (int i = 0; i < m_rowTypeList.size(); ++i) | 1402 | for (int i = 0; i < m_rowTypeList.size(); ++i) | ||
1403 | isUsed |= it_row.value()[ m_rowTypeList[i] ][0].isUsed(); | 1403 | isUsed |= it_row.value()[ m_rowTypeList[i] ][0].isUsed(); | ||
1404 | 1404 | | |||
1405 | if (it_row.key().accountType() != MyMoneyAccount::Investment) { | 1405 | if (it_row.key().accountType() != eMyMoney::Account::Investment) { | ||
1406 | while (column < m_numColumns) { | 1406 | while (column < m_numColumns) { | ||
1407 | 1407 | | |||
1408 | //show columns | 1408 | //show columns | ||
Context not available. | |||||
1703 | pricePrecision = 0; // new row => new account => new precision | 1703 | pricePrecision = 0; // new row => new account => new precision | ||
1704 | currencyPrecision = 0; | 1704 | currencyPrecision = 0; | ||
1705 | bool isUsed = it_row.value()[eActual][0].isUsed(); | 1705 | bool isUsed = it_row.value()[eActual][0].isUsed(); | ||
1706 | if (it_row.key().accountType() != MyMoneyAccount::Investment) { | 1706 | if (it_row.key().accountType() != eMyMoney::Account::Investment) { | ||
1707 | while (column < m_numColumns) { | 1707 | while (column < m_numColumns) { | ||
1708 | QString lb; | 1708 | QString lb; | ||
1709 | if (column > 0) | 1709 | if (column > 0) | ||
Context not available. | |||||
1964 | while (it_row != (*it_innergroup).end()) { | 1964 | while (it_row != (*it_innergroup).end()) { | ||
1965 | int column = m_startColumn; | 1965 | int column = m_startColumn; | ||
1966 | switch (it_row.key().accountGroup()) { | 1966 | switch (it_row.key().accountGroup()) { | ||
1967 | case MyMoneyAccount::Income: | 1967 | case eMyMoney::Account::Income: | ||
1968 | case MyMoneyAccount::Asset: | 1968 | case eMyMoney::Account::Asset: | ||
1969 | while (column < m_numColumns) { | 1969 | while (column < m_numColumns) { | ||
1970 | it_row.value()[eBudgetDiff][column] = it_row.value()[eActual][column] - it_row.value()[eBudget][column]; | 1970 | it_row.value()[eBudgetDiff][column] = it_row.value()[eActual][column] - it_row.value()[eBudget][column]; | ||
1971 | ++column; | 1971 | ++column; | ||
1972 | } | 1972 | } | ||
1973 | break; | 1973 | break; | ||
1974 | case MyMoneyAccount::Expense: | 1974 | case eMyMoney::Account::Expense: | ||
1975 | case MyMoneyAccount::Liability: | 1975 | case eMyMoney::Account::Liability: | ||
1976 | while (column < m_numColumns) { | 1976 | while (column < m_numColumns) { | ||
1977 | it_row.value()[eBudgetDiff][column] = it_row.value()[eBudget][column] - it_row.value()[eActual][column]; | 1977 | it_row.value()[eBudgetDiff][column] = it_row.value()[eBudget][column] - it_row.value()[eActual][column]; | ||
1978 | ++column; | 1978 | ++column; | ||
Context not available. | |||||
2297 | QStringList::const_iterator it_a, it_b; | 2297 | QStringList::const_iterator it_a, it_b; | ||
2298 | for (it_a = accountList.constBegin(); it_a != accountList.constEnd(); ++it_a) { | 2298 | for (it_a = accountList.constBegin(); it_a != accountList.constEnd(); ++it_a) { | ||
2299 | MyMoneyAccount acc = MyMoneyFile::instance()->account(*it_a); | 2299 | MyMoneyAccount acc = MyMoneyFile::instance()->account(*it_a); | ||
2300 | if (acc.accountType() == MyMoneyAccount::Investment) { | 2300 | if (acc.accountType() == eMyMoney::Account::Investment) { | ||
2301 | for (it_b = acc.accountList().constBegin(); it_b != acc.accountList().constEnd(); ++it_b) { | 2301 | for (it_b = acc.accountList().constBegin(); it_b != acc.accountList().constEnd(); ++it_b) { | ||
2302 | if (!accountList.contains(*it_b)) { | 2302 | if (!accountList.contains(*it_b)) { | ||
2303 | m_config.addAccount(*it_b); | 2303 | m_config.addAccount(*it_b); | ||
Context not available. |