diff --git a/kmymoney/dialogs/kreportconfigurationfilterdlg.cpp b/kmymoney/dialogs/kreportconfigurationfilterdlg.cpp --- a/kmymoney/dialogs/kreportconfigurationfilterdlg.cpp +++ b/kmymoney/dialogs/kreportconfigurationfilterdlg.cpp @@ -242,6 +242,7 @@ m_currentState.setDetailLevel(m_tab3->findChild("m_checkHideSplitDetails")->isChecked() ? MyMoneyReport::eDetailNone : MyMoneyReport::eDetailAll); + m_currentState.setHideTransactions(m_tab3->findChild("m_checkHideTransactions")->isChecked()); } if (m_tabChart) { @@ -439,8 +440,11 @@ m_tab3->findChild("m_checkInvestments")->setChecked(m_initialState.isInvestmentsOnly()); m_tab3->findChild("m_checkLoans")->setChecked(m_initialState.isLoansOnly()); + m_tab3->findChild("m_checkHideTransactions")->setChecked(m_initialState.isHideTransactions()); + m_tab3->findChild("m_checkHideSplitDetails")->setEnabled(!m_initialState.isHideTransactions()); + m_tab3->findChild("m_checkHideSplitDetails")->setChecked - (m_initialState.detailLevel() == MyMoneyReport::eDetailNone); + (m_initialState.detailLevel() == MyMoneyReport::eDetailNone || m_initialState.isHideTransactions()); } if (m_tabChart) { diff --git a/kmymoney/html/kmymoney.css b/kmymoney/html/kmymoney.css --- a/kmymoney/html/kmymoney.css +++ b/kmymoney/html/kmymoney.css @@ -216,6 +216,11 @@ color:WindowText; } + table.report tr.sectionfooterbasic td { /* totals for without top border */ + padding: 0 0.5em 0.5em 0.5em; + color:WindowText; + } + table.report tr.sectionfooter td { /* totals for each section -subtotals */ border-top: 1px solid black; padding: 0 0.5em 0.5em 0.5em; diff --git a/kmymoney/mymoney/mymoneyreport.h b/kmymoney/mymoney/mymoneyreport.h --- a/kmymoney/mymoney/mymoneyreport.h +++ b/kmymoney/mymoney/mymoneyreport.h @@ -140,6 +140,9 @@ EDetailLevel detailLevel() const { return m_detailLevel; } + bool isHideTransactions() const { + return m_hideTransactions; + } EChartType chartType() const { return m_chartType; } @@ -263,6 +266,9 @@ void setDetailLevel(EDetailLevel _detail) { m_detailLevel = _detail; } + void setHideTransactions(bool _f) { + m_hideTransactions = _f; + } void setChartType(EChartType _type) { m_chartType = _type; } @@ -559,6 +565,10 @@ */ enum EDetailLevel m_detailLevel; /** + * Whether to show transactions or just totals. + */ + bool m_hideTransactions; + /** * Whether to convert all currencies to the base currency of the file (true). * If this is false, it's up to the report generator to decide how to handle * the currency. diff --git a/kmymoney/mymoney/mymoneyreport.cpp b/kmymoney/mymoney/mymoneyreport.cpp --- a/kmymoney/mymoney/mymoneyreport.cpp +++ b/kmymoney/mymoney/mymoneyreport.cpp @@ -57,6 +57,7 @@ m_tax(false), m_investments(false), m_loans(false), + m_hideTransactions(false), m_reportType(kTypeArray[eExpenseIncome]), m_rowType(eExpenseIncome), m_columnType(eMonths), @@ -106,6 +107,7 @@ m_tax(false), m_investments(false), m_loans(false), + m_hideTransactions(false), m_reportType(kTypeArray[_rt]), m_rowType(_rt), m_columnsAreDays(false), @@ -347,6 +349,7 @@ e.setAttribute("tax", m_tax); e.setAttribute("investments", m_investments); e.setAttribute("loans", m_loans); + e.setAttribute("hidetransactions", m_hideTransactions); e.setAttribute("rowtype", kRowTypeText[m_rowType]); e.setAttribute("datelock", kDateLockText[m_dateLock]); e.setAttribute("datalock", kDataLockText[m_dataLock]); @@ -383,10 +386,10 @@ e.setAttribute("dataMinorTick", m_dataMinorTick); e.setAttribute("dataLock", m_dataLock); e.setAttribute("skipZero", m_skipZero); + e.setAttribute("detail", kDetailLevelText[m_detailLevel]); if (m_reportType == ePivotTable) { e.setAttribute("type", "pivottable 1.15"); - e.setAttribute("detail", kDetailLevelText[m_detailLevel]); e.setAttribute("columntype", kColumnTypeText[m_columnType]); e.setAttribute("showrowtotals", m_showRowTotals); } else if (m_reportType == eQueryTable) { @@ -405,7 +408,6 @@ e.setAttribute("querycolumns", columns.join(",")); } else if (m_reportType == eInfoTable) { e.setAttribute("type", "infotable 1.0"); - e.setAttribute("detail", kDetailLevelText[m_detailLevel]); e.setAttribute("showrowtotals", m_showRowTotals); } @@ -649,6 +651,7 @@ m_tax = e.attribute("tax", "0").toUInt(); m_investments = e.attribute("investments", "0").toUInt(); m_loans = e.attribute("loans", "0").toUInt(); + m_hideTransactions = e.attribute("hidetransactions", "0").toUInt(); m_includeSchedules = e.attribute("includeschedules", "0").toUInt(); m_columnsAreDays = e.attribute("columnsaredays", "0").toUInt(); m_includeTransfers = e.attribute("includestransfers", "0").toUInt(); diff --git a/kmymoney/reports/listtable.cpp b/kmymoney/reports/listtable.cpp --- a/kmymoney/reports/listtable.cpp +++ b/kmymoney/reports/listtable.cpp @@ -242,6 +242,7 @@ // bool row_odd = true; + bool isHigherGroupTotal = false; // hack to inform whether to put separator line or not // ***DV*** MyMoneyMoney startingBalance; @@ -260,48 +261,60 @@ // detect whether any of groups changed and display new group header in that case for (int i = 0; i < groups.count(); ++i) { if (prevGrpNames.at(i) != (*it_row)[groups.at(i)]) { - row_odd = true; - result += "" - "" + - (*it_row)[groups.at(i)] + "\n"; - csv += "\"" + (*it_row)[groups.at(i)] + "\"\n"; + // group header of lowest group doesn't bring any useful information + // if hide transaction is enabled, so don't display it + if (!m_config.isHideTransactions() || i != groups.count() - 1) { + row_odd = true; + result += "" + "" + + (*it_row)[groups.at(i)] + "\n"; + csv += "\"" + (*it_row)[groups.at(i)] + "\"\n"; + } + if (i == groups.count() - 1) // lowest group has been switched... + isHigherGroupTotal = false; // ...so expect lowest group total prevGrpNames.replace(i, (*it_row)[groups.at(i)]); } } // // Columns // - // skip the opening and closing balance row, - // if the balance column is not shown - // rank = 0 for opening balance, rank = 3 for closing balance - if ((columns.contains("balance") == 0) && ((*it_row)["rank"] == "0" || (*it_row)["rank"] == "3")) - continue; - bool need_label = true; QString tlink; // link information to account and transaction - // ***DV*** - if ((* it_row)["rank"] == "1") { - row_odd = ! row_odd; - tlink = QString("id=%1&tid=%2") - .arg((* it_row)["accountid"], (* it_row)["id"]); - } - if ((*it_row)["rank"] == "0" || (*it_row)["rank"] == "3") - result += QString("").arg((* it_row)["id"]); - else if ((* it_row)["rank"] == "2") - result += QString("").arg(row_odd ? "item1" : "item0"); - else if ((* it_row)["rank"] == "4") { - if (m_config.rowType() == MyMoneyReport::eTag || //If we order by Tags don't show the Grand total as we can have multiple tags per transaction - !m_config.isConvertCurrency() && std::next(it_row) == m_rows.end())// grand total may be invalid if multiple currencies are used, so don't display it - continue; - else - result += QString(""); + if (!m_config.isHideTransactions() || (*it_row)["rank"] == "4") { // if hide transaction is enabled display only total rows i.e. rank = 4 + if ((*it_row)["rank"] == "0" || (*it_row)["rank"] == "3") { + // skip the opening and closing balance row, + // if the balance column is not shown + // rank = 0 for opening balance, rank = 3 for closing balance + if (!columns.contains("balance")) + continue; + result += QString("").arg((* it_row)["id"]); + // ***DV*** + } else if ((* it_row)["rank"] == "1") { + row_odd = ! row_odd; + tlink = QString("id=%1&tid=%2") + .arg((* it_row)["accountid"], (* it_row)["id"]); + result += QString("").arg(row_odd ? "row-odd " : "row-even"); + } else if ((* it_row)["rank"] == "2") + result += QString("").arg(row_odd ? "item1" : "item0"); + else if ((* it_row)["rank"] == "4") { + if ((m_config.rowType() == MyMoneyReport::eTag) || //If we order by Tags don't show the Grand total as we can have multiple tags per transaction + (!m_config.isConvertCurrency() && std::next(it_row) == m_rows.end()))// grand total may be invalid if multiple currencies are used, so don't display it + continue; + // display special footer (i.e. without horizontal separator) only for lowest group totals + else if (m_config.isHideTransactions() && !isHigherGroupTotal && std::next(it_row) != m_rows.end()) { + result += QString(""); + isHigherGroupTotal = true; + } else + result += QString(""); + } else + result += QString("").arg(row_odd ? "row-odd " : "row-even"); } else - result += QString("").arg(row_odd ? "row-odd " : "row-even"); + continue; QStringList::const_iterator it_column = columns.constBegin(); while (it_column != columns.constEnd()) { diff --git a/kmymoney/widgets/kmymoneyreportconfigtab3decl.ui b/kmymoney/widgets/kmymoneyreportconfigtab3decl.ui --- a/kmymoney/widgets/kmymoneyreportconfigtab3decl.ui +++ b/kmymoney/widgets/kmymoneyreportconfigtab3decl.ui @@ -1,460 +1,520 @@ - - - - - kMyMoneyReportConfigTab3Decl - - - - 0 - 0 - 617 - 267 - - - - - 1 - 1 - 0 - 0 - - - - Rows/Columns Tab - - - - - - <p>On this tab, you configure how you would like the rows and columns to be selected and organized.</p> - - - - - - - - - 1 - 0 - 0 - 0 - - - - - - - Organize by: - - - false - - - - - - - true - - - - 1 - 0 - 0 - 0 - - - - <p>Choose how to group the transactions in this report</p> - - - - Categories - - - - - Top Categories - - - - - Tags - - - - - Payees - - - - - Accounts - - - - - Top Accounts - - - - - Month - - - - - Week - - - - - - - - - 358 - 16 - - - - QSizePolicy::Expanding - - - Qt::Horizontal - - - - - - - - - - - true - - - - 1 - 0 - 0 - 0 - - - - Show Columns - - - <p>Choose which columns should be shown in the report.</p><p>The date and transaction amount are always shown.</p> - - - - 2 - - - - - - 0 - 0 - - - - Memo - - - <p>Select this option to show the Memo column</p> - - - buttonGroup1 - - - - - - - Shares - - - <p>Select this option to show the Shares column for investments</p> - - - buttonGroup1 - - - - - - - Price - - - <p>Select this option to show the Price column for investments</p> - - - buttonGroup1 - - - - - - - Reconciled - - - <p>Select this option to show the Reconciled column</p> - - - buttonGroup1 - - - - - - - Account - - - <p>Select this option to show the Account column</p> - - - buttonGroup1 - - - - - - - - 0 - 0 - - - - Number - - - <p>Select this option to show the Number column</p> - - - buttonGroup1 - - - - - - - - 0 - 0 - - - - Tag - - - <p>Select this option to show the Tag column</p> - - - buttonGroup1 - - - - - - - - 0 - 0 - - - - Payee - - - <p>Select this option to show the Payee column</p> - - - buttonGroup1 - - - - - - - - 0 - 0 - - - - Category - - - <p>Select this option to show the Category column</p> - - - buttonGroup1 - - - - - - - Action - - - <p>Select this option to show the Action column</p> - - - buttonGroup1 - - - - - - - Balance - - - <p>Select this option to show the Running balance column</p> - - - buttonGroup1 - - - - - - - - - - - 205 - 20 - - - - QSizePolicy::Expanding - - - Qt::Horizontal - - - - - - - - - - - Include only Loan accounts - - - - - - - Include only Investment accounts - - - <p>Check this box to include only those categories which have been marked to "Include on Tax Reports"</p> - - - - - - - Hide Split Transaction Details - - - Do not display the individual transactions that make up a split transaction - - - - - - - Include only Tax categories - - - <p>Check this box to include only those categories which have been marked to "Include on Tax Reports"</p> - - - - - - - - - - 20 - 16 - + + kMyMoneyReportConfigTab3Decl + + + + 0 + 0 + 730 + 267 + + + + + 0 + 0 + + + + Rows/Columns Tab + + + + + + <p>On this tab, you configure how you would like the rows and columns to be selected and organized.</p> + + + + + + + + + 0 + 0 + + + + + + + Organize by: + + + false + + + + + + + true + + + + 0 + 0 + + + + <p>Choose how to group the transactions in this report</p> + + + + Categories + + + + + Top Categories + + + + + Tags + + + + + Payees + + + + + Accounts + + + + + Top Accounts + + + + + Month + + + + + Week + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 358 + 16 + + + + + + + + + + + + true + + + + 0 + 0 + + + + <p>Choose which columns should be shown in the report.</p><p>The date and transaction amount are always shown.</p> + + + Show Columns + + + + 2 + + + + + + 0 + 0 + + + + <p>Select this option to show the Memo column</p> + + + Memo + + + buttonGroup1 + + + + + + + <p>Select this option to show the Shares column for investments</p> + + + Shares + + + buttonGroup1 + + + + + + + <p>Select this option to show the Price column for investments</p> + + + Price + + + buttonGroup1 + + + + + + + <p>Select this option to show the Reconciled column</p> + + + Reconciled + + + buttonGroup1 + + + + + + + <p>Select this option to show the Account column</p> + + + Account + + + buttonGroup1 + + + + + + + + 0 + 0 + + + + <p>Select this option to show the Number column</p> - - QSizePolicy::Expanding + + Number - - Qt::Vertical + + buttonGroup1 + + + + + + + + 0 + 0 + - - + + <p>Select this option to show the Tag column</p> + + + Tag + + + buttonGroup1 + + + + + + + + 0 + 0 + + + + <p>Select this option to show the Payee column</p> + + + Payee + + + buttonGroup1 + + + + + + + + 0 + 0 + + + + <p>Select this option to show the Category column</p> + + + Category + + + buttonGroup1 + + + + + + + <p>Select this option to show the Action column</p> + + + Action + + + buttonGroup1 + + + + + + + <p>Select this option to show the Running balance column</p> + + + Balance + + + buttonGroup1 + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 205 + 20 + + + + + + + + + + + + Include only Loan accounts + + + + + + + <p>Check this box to include only those categories which have been marked to "Include on Tax Reports"</p> + + + Include only Investment accounts + + + + + + + Do not display the individual transactions that make up a split transaction + + + Hide Split Transaction Details + + + + + + + <p>Check this box to include only those categories which have been marked to "Include on Tax Reports"</p> + + + Include only Tax categories + + + + + + + Do not display the transactions, leaving only totals displayed. + + + Hide Transactions + + + - - - - - m_checkTax - toggled(bool) - m_checkInvestments - setDisabled(bool) - - - m_checkTax - toggled(bool) - m_checkLoans - setDisabled(bool) - - - m_checkInvestments - toggled(bool) - m_checkTax - setDisabled(bool) - - - m_checkInvestments - toggled(bool) - m_checkLoans - setDisabled(bool) - - - m_checkLoans - toggled(bool) - m_checkTax - setDisabled(bool) - - - m_checkLoans - toggled(bool) - m_checkInvestments - setDisabled(bool) - - - - - KComboBox - QComboBox -
kcombobox.h
-
-
- - - +
+ + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 16 + + + + + + + + + + KComboBox + QComboBox +
kcombobox.h
+
+
+ + + + m_checkTax + toggled(bool) + m_checkInvestments + setDisabled(bool) + + + 20 + 20 + + + 20 + 20 + + + + + m_checkTax + toggled(bool) + m_checkLoans + setDisabled(bool) + + + 20 + 20 + + + 20 + 20 + + + + + m_checkInvestments + toggled(bool) + m_checkTax + setDisabled(bool) + + + 20 + 20 + + + 20 + 20 + + + + + m_checkInvestments + toggled(bool) + m_checkLoans + setDisabled(bool) + + + 20 + 20 + + + 20 + 20 + + + + + m_checkLoans + toggled(bool) + m_checkTax + setDisabled(bool) + + + 20 + 20 + + + 20 + 20 + + + + + m_checkLoans + toggled(bool) + m_checkInvestments + setDisabled(bool) + + + 20 + 20 + + + 20 + 20 + + + + + + +
diff --git a/kmymoney/widgets/kmymoneyreportconfigtabimpl.h b/kmymoney/widgets/kmymoneyreportconfigtabimpl.h --- a/kmymoney/widgets/kmymoneyreportconfigtabimpl.h +++ b/kmymoney/widgets/kmymoneyreportconfigtabimpl.h @@ -54,11 +54,14 @@ class kMyMoneyReportConfigTab3Decl : public QWidget { + Q_OBJECT public: kMyMoneyReportConfigTab3Decl(QWidget *parent); virtual ~kMyMoneyReportConfigTab3Decl(); private: Ui::kMyMoneyReportConfigTab3Decl* ui; +private slots: + void slotHideTransactionsChanged(bool checked); }; class kMyMoneyReportConfigTabChartDecl : public QWidget diff --git a/kmymoney/widgets/kmymoneyreportconfigtabimpl.cpp b/kmymoney/widgets/kmymoneyreportconfigtabimpl.cpp --- a/kmymoney/widgets/kmymoneyreportconfigtabimpl.cpp +++ b/kmymoney/widgets/kmymoneyreportconfigtabimpl.cpp @@ -72,6 +72,14 @@ ui->buttonGroup1->setId(ui->m_checkCategory, 7); ui->buttonGroup1->setId(ui->m_checkAction, 8); ui->buttonGroup1->setId(ui->m_checkBalance, 9); + connect(ui->m_checkHideTransactions, SIGNAL(toggled(bool)), this, SLOT(slotHideTransactionsChanged(bool))); +} + +void kMyMoneyReportConfigTab3Decl::slotHideTransactionsChanged(bool checked) +{ + if (checked) // toggle m_checkHideSplitDetails only if it's mandatory + ui->m_checkHideSplitDetails->setChecked(checked); + ui->m_checkHideSplitDetails->setEnabled(!checked); // hiding transactions without hiding splits isn't allowed } kMyMoneyReportConfigTab3Decl::~kMyMoneyReportConfigTab3Decl()