diff --git a/kmymoney/dialogs/kbalancechartdlg.cpp b/kmymoney/dialogs/kbalancechartdlg.cpp --- a/kmymoney/dialogs/kbalancechartdlg.cpp +++ b/kmymoney/dialogs/kbalancechartdlg.cpp @@ -85,8 +85,8 @@ KReportChartView* KBalanceChartDlg::drawChart(const MyMoneyAccount& account) { MyMoneyReport reportCfg = MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, eMyMoney::TransactionFilter::Date::Last3ToNext3Months, MyMoneyReport::eDetailTotal, i18n("%1 Balance History", account.name()), diff --git a/kmymoney/dialogs/kreportconfigurationfilterdlg.cpp b/kmymoney/dialogs/kreportconfigurationfilterdlg.cpp --- a/kmymoney/dialogs/kreportconfigurationfilterdlg.cpp +++ b/kmymoney/dialogs/kreportconfigurationfilterdlg.cpp @@ -94,7 +94,7 @@ }; KReportConfigurationFilterDlg::KReportConfigurationFilterDlg(MyMoneyReport report, QWidget *parent) : - KFindTransactionDlg(*new KReportConfigurationFilterDlgPrivate(this), parent, (report.rowType() == MyMoneyReport::eAccount)) + KFindTransactionDlg(*new KReportConfigurationFilterDlgPrivate(this), parent, (report.rowType() == MyMoneyReport::Row::Account)) { Q_D(KReportConfigurationFilterDlg); @@ -123,7 +123,7 @@ d->m_tabGeneral = new ReportTabGeneral(d->ui->m_criteriaTab); d->ui->m_criteriaTab->insertTab(0, d->m_tabGeneral, i18nc("General tab", "General")); - if (d->m_initialState.reportType() == MyMoneyReport::ePivotTable) { + if (d->m_initialState.reportType() == MyMoneyReport::Report::PivotTable) { int tabNr = 1; if (!(d->m_initialState.isIncludingPrice() || d->m_initialState.isIncludingAveragePrice())) { d->m_tabRowColPivot = new ReportTabRowColPivot(d->ui->m_criteriaTab); @@ -155,18 +155,18 @@ connect(d->m_tabRange->ui->m_comboColumns, static_cast(&QComboBox::activated), this, static_cast(&KReportConfigurationFilterDlg::slotUpdateColumnsCombo)); } connect(d->m_tabChart->ui->m_logYaxis, &QCheckBox::stateChanged, this, &KReportConfigurationFilterDlg::slotLogAxisChanged); - } else if (d->m_initialState.reportType() == MyMoneyReport::eQueryTable) { + } else if (d->m_initialState.reportType() == MyMoneyReport::Report::QueryTable) { // eInvestmentHoldings is a special-case report, and you cannot configure the // rows & columns of that report. - if (d->m_initialState.rowType() < MyMoneyReport::eAccountByTopAccount) { + if (d->m_initialState.rowType() < MyMoneyReport::Row::AccountByTopAccount) { d->m_tabRowColQuery = new ReportTabRowColQuery(d->ui->m_criteriaTab); d->ui->m_criteriaTab->insertTab(1, d->m_tabRowColQuery, i18n("Rows/Columns")); } - if (d->m_initialState.queryColumns() & MyMoneyReport::eQCcapitalgain) { + if (d->m_initialState.queryColumns() & MyMoneyReport::QueryColumns::Capitalgain) { d->m_tabCapitalGain = new ReportTabCapitalGain(d->ui->m_criteriaTab); d->ui->m_criteriaTab->insertTab(1, d->m_tabCapitalGain, i18n("Report")); } - if (d->m_initialState.queryColumns() & MyMoneyReport::eQCperformance) { + if (d->m_initialState.queryColumns() & MyMoneyReport::QueryColumns::Performance) { d->m_tabPerformance = new ReportTabPerformance(d->ui->m_criteriaTab); d->ui->m_criteriaTab->insertTab(1, d->m_tabPerformance, i18n("Report")); } @@ -220,7 +220,7 @@ // modify the rowtype only if the widget is enabled if (d->m_tabRowColPivot->ui->m_comboRows->isEnabled()) { - MyMoneyReport::ERowType rt[2] = { MyMoneyReport::eExpenseIncome, MyMoneyReport::eAssetLiability }; + MyMoneyReport::Row::Type rt[2] = { MyMoneyReport::Row::ExpenseIncome, MyMoneyReport::Row::AssetLiability }; d->m_currentState.setRowType(rt[d->m_tabRowColPivot->ui->m_comboRows->currentIndex()]); } @@ -236,7 +236,7 @@ d->m_currentState.setIncludingUnusedAccounts(d->m_tabRowColPivot->ui->m_checkUnused->isChecked()); if (d->m_tabRowColPivot->ui->m_comboBudget->isEnabled()) { - d->m_currentState.setBudget(d->m_budgets[d->m_tabRowColPivot->ui->m_comboBudget->currentItem()].id(), d->m_initialState.rowType() == MyMoneyReport::eBudgetActual); + d->m_currentState.setBudget(d->m_budgets[d->m_tabRowColPivot->ui->m_comboBudget->currentItem()].id(), d->m_initialState.rowType() == MyMoneyReport::Row::BudgetActual); } else { d->m_currentState.setBudget(QString(), false); } @@ -246,39 +246,39 @@ d->m_currentState.setMovingAverageDays(d->m_tabRowColPivot->ui->m_movingAverageDays->value()); } } else if (d->m_tabRowColQuery) { - MyMoneyReport::ERowType rtq[8] = { MyMoneyReport::eCategory, MyMoneyReport::eTopCategory, MyMoneyReport::eTag, MyMoneyReport::ePayee, MyMoneyReport::eAccount, MyMoneyReport::eTopAccount, MyMoneyReport::eMonth, MyMoneyReport::eWeek }; + MyMoneyReport::Row::Type rtq[8] = { MyMoneyReport::Row::Category, MyMoneyReport::Row::TopCategory, MyMoneyReport::Row::Tag, MyMoneyReport::Row::Payee, MyMoneyReport::Row::Account, MyMoneyReport::Row::TopAccount, MyMoneyReport::Row::Month, MyMoneyReport::Row::Week }; d->m_currentState.setRowType(rtq[d->m_tabRowColQuery->ui->m_comboOrganizeBy->currentIndex()]); - unsigned qc = MyMoneyReport::eQCnone; + unsigned qc = MyMoneyReport::QueryColumns::None; - if (d->m_currentState.queryColumns() & MyMoneyReport::eQCloan) + if (d->m_currentState.queryColumns() & MyMoneyReport::QueryColumns::Loan) // once a loan report, always a loan report - qc = MyMoneyReport::eQCloan; + qc = MyMoneyReport::QueryColumns::Loan; if (d->m_tabRowColQuery->ui->m_checkNumber->isChecked()) - qc |= MyMoneyReport::eQCnumber; + qc |= MyMoneyReport::QueryColumns::Number; if (d->m_tabRowColQuery->ui->m_checkPayee->isChecked()) - qc |= MyMoneyReport::eQCpayee; + qc |= MyMoneyReport::QueryColumns::Payee; if (d->m_tabRowColQuery->ui->m_checkTag->isChecked()) - qc |= MyMoneyReport::eQCtag; + qc |= MyMoneyReport::QueryColumns::Tag; if (d->m_tabRowColQuery->ui->m_checkCategory->isChecked()) - qc |= MyMoneyReport::eQCcategory; + qc |= MyMoneyReport::QueryColumns::Category; if (d->m_tabRowColQuery->ui->m_checkMemo->isChecked()) - qc |= MyMoneyReport::eQCmemo; + qc |= MyMoneyReport::QueryColumns::Memo; if (d->m_tabRowColQuery->ui->m_checkAccount->isChecked()) - qc |= MyMoneyReport::eQCaccount; + qc |= MyMoneyReport::QueryColumns::Account; if (d->m_tabRowColQuery->ui->m_checkReconciled->isChecked()) - qc |= MyMoneyReport::eQCreconciled; + qc |= MyMoneyReport::QueryColumns::Reconciled; if (d->m_tabRowColQuery->ui->m_checkAction->isChecked()) - qc |= MyMoneyReport::eQCaction; + qc |= MyMoneyReport::QueryColumns::Action; if (d->m_tabRowColQuery->ui->m_checkShares->isChecked()) - qc |= MyMoneyReport::eQCshares; + qc |= MyMoneyReport::QueryColumns::Shares; if (d->m_tabRowColQuery->ui->m_checkPrice->isChecked()) - qc |= MyMoneyReport::eQCprice; + qc |= MyMoneyReport::QueryColumns::Price; if (d->m_tabRowColQuery->ui->m_checkBalance->isChecked()) - qc |= MyMoneyReport::eQCbalance; + qc |= MyMoneyReport::QueryColumns::Balance; - d->m_currentState.setQueryColumns(static_cast(qc)); + d->m_currentState.setQueryColumns(static_cast(qc)); d->m_currentState.setTax(d->m_tabRowColQuery->ui->m_checkTax->isChecked()); d->m_currentState.setInvestmentsOnly(d->m_tabRowColQuery->ui->m_checkInvestments->isChecked()); @@ -310,7 +310,7 @@ d->m_currentState.setYLabelsPrecision(d->m_tabRange->ui->m_yLabelsPrecision->value()); d->m_currentState.setDataFilter((MyMoneyReport::dataOptionE)d->m_tabRange->ui->m_dataLock->currentIndex()); - MyMoneyReport::EColumnType ct[6] = { MyMoneyReport::eDays, MyMoneyReport::eWeeks, MyMoneyReport::eMonths, MyMoneyReport::eBiMonths, MyMoneyReport::eQuarters, MyMoneyReport::eYears }; + MyMoneyReport::Column::Type ct[6] = { MyMoneyReport::Column::Days, MyMoneyReport::Column::Weeks, MyMoneyReport::Column::Months, MyMoneyReport::Column::BiMonths, MyMoneyReport::Column::Quarters, MyMoneyReport::Column::Years }; bool dy[6] = { true, true, false, false, false, false }; d->m_currentState.setColumnType(ct[d->m_tabRange->ui->m_comboColumns->currentIndex()]); @@ -421,9 +421,9 @@ combo = d->m_tabRowColPivot->ui->m_comboRows; switch (d->m_initialState.rowType()) { - case MyMoneyReport::eExpenseIncome: - case MyMoneyReport::eBudget: - case MyMoneyReport::eBudgetActual: + case MyMoneyReport::Row::ExpenseIncome: + case MyMoneyReport::Row::Budget: + case MyMoneyReport::Row::BudgetActual: combo->setCurrentItem(i18n("Income & Expenses"), false); // income / expense break; default: @@ -436,8 +436,8 @@ slotRowTypeChanged(combo->currentIndex()); //load budgets combo - if (d->m_initialState.rowType() == MyMoneyReport::eBudget - || d->m_initialState.rowType() == MyMoneyReport::eBudgetActual) { + if (d->m_initialState.rowType() == MyMoneyReport::Row::Budget + || d->m_initialState.rowType() == MyMoneyReport::Row::BudgetActual) { d->m_tabRowColPivot->ui->m_comboRows->setEnabled(false); d->m_tabRowColPivot->ui->m_budgetFrame->setEnabled(!d->m_budgets.empty()); auto i = 0; @@ -464,47 +464,47 @@ } else if (d->m_tabRowColQuery) { KComboBox *combo = d->m_tabRowColQuery->ui->m_comboOrganizeBy; switch (d->m_initialState.rowType()) { - case MyMoneyReport::eNoColumns: - case MyMoneyReport::eCategory: + case MyMoneyReport::Column::NoColumns: + case MyMoneyReport::Row::Category: combo->setCurrentItem(i18n("Categories"), false); break; - case MyMoneyReport::eTopCategory: + case MyMoneyReport::Row::TopCategory: combo->setCurrentItem(i18n("Top Categories"), false); break; - case MyMoneyReport::eTag: + case MyMoneyReport::Row::Tag: combo->setCurrentItem(i18n("Tags"), false); break; - case MyMoneyReport::ePayee: + case MyMoneyReport::Row::Payee: combo->setCurrentItem(i18n("Payees"), false); break; - case MyMoneyReport::eAccount: + case MyMoneyReport::Row::Account: combo->setCurrentItem(i18n("Accounts"), false); break; - case MyMoneyReport::eTopAccount: + case MyMoneyReport::Row::TopAccount: combo->setCurrentItem(i18n("Top Accounts"), false); break; - case MyMoneyReport::eMonth: + case MyMoneyReport::Row::Month: combo->setCurrentItem(i18n("Month"), false); break; - case MyMoneyReport::eWeek: + case MyMoneyReport::Row::Week: combo->setCurrentItem(i18n("Week"), false); break; default: throw MYMONEYEXCEPTION("KReportConfigurationFilterDlg::slotReset(): QueryTable report has invalid rowtype"); } unsigned qc = d->m_initialState.queryColumns(); - d->m_tabRowColQuery->ui->m_checkNumber->setChecked(qc & MyMoneyReport::eQCnumber); - d->m_tabRowColQuery->ui->m_checkPayee->setChecked(qc & MyMoneyReport::eQCpayee); - d->m_tabRowColQuery->ui->m_checkTag->setChecked(qc & MyMoneyReport::eQCtag); - d->m_tabRowColQuery->ui->m_checkCategory->setChecked(qc & MyMoneyReport::eQCcategory); - d->m_tabRowColQuery->ui->m_checkMemo->setChecked(qc & MyMoneyReport::eQCmemo); - d->m_tabRowColQuery->ui->m_checkAccount->setChecked(qc & MyMoneyReport::eQCaccount); - d->m_tabRowColQuery->ui->m_checkReconciled->setChecked(qc & MyMoneyReport::eQCreconciled); - d->m_tabRowColQuery->ui->m_checkAction->setChecked(qc & MyMoneyReport::eQCaction); - d->m_tabRowColQuery->ui->m_checkShares->setChecked(qc & MyMoneyReport::eQCshares); - d->m_tabRowColQuery->ui->m_checkPrice->setChecked(qc & MyMoneyReport::eQCprice); - d->m_tabRowColQuery->ui->m_checkBalance->setChecked(qc & MyMoneyReport::eQCbalance); + d->m_tabRowColQuery->ui->m_checkNumber->setChecked(qc & MyMoneyReport::QueryColumns::Number); + d->m_tabRowColQuery->ui->m_checkPayee->setChecked(qc & MyMoneyReport::QueryColumns::Payee); + d->m_tabRowColQuery->ui->m_checkTag->setChecked(qc & MyMoneyReport::QueryColumns::Tag); + d->m_tabRowColQuery->ui->m_checkCategory->setChecked(qc & MyMoneyReport::QueryColumns::Category); + d->m_tabRowColQuery->ui->m_checkMemo->setChecked(qc & MyMoneyReport::QueryColumns::Memo); + d->m_tabRowColQuery->ui->m_checkAccount->setChecked(qc & MyMoneyReport::QueryColumns::Account); + d->m_tabRowColQuery->ui->m_checkReconciled->setChecked(qc & MyMoneyReport::QueryColumns::Reconciled); + d->m_tabRowColQuery->ui->m_checkAction->setChecked(qc & MyMoneyReport::QueryColumns::Action); + d->m_tabRowColQuery->ui->m_checkShares->setChecked(qc & MyMoneyReport::QueryColumns::Shares); + d->m_tabRowColQuery->ui->m_checkPrice->setChecked(qc & MyMoneyReport::QueryColumns::Price); + d->m_tabRowColQuery->ui->m_checkBalance->setChecked(qc & MyMoneyReport::QueryColumns::Balance); d->m_tabRowColQuery->ui->m_checkTax->setChecked(d->m_initialState.isTax()); d->m_tabRowColQuery->ui->m_checkInvestments->setChecked(d->m_initialState.isInvestmentsOnly()); @@ -553,29 +553,29 @@ KComboBox *combo = d->m_tabRange->ui->m_comboColumns; if (d->m_initialState.isColumnsAreDays()) { switch (d->m_initialState.columnType()) { - case MyMoneyReport::eNoColumns: - case MyMoneyReport::eDays: + case MyMoneyReport::Column::NoColumns: + case MyMoneyReport::Column::Days: combo->setCurrentItem(i18nc("@item the columns will display daily data", "Daily"), false); break; - case MyMoneyReport::eWeeks: + case MyMoneyReport::Column::Weeks: combo->setCurrentItem(i18nc("@item the columns will display weekly data", "Weekly"), false); break; default: break; } } else { switch (d->m_initialState.columnType()) { - case MyMoneyReport::eNoColumns: - case MyMoneyReport::eMonths: + case MyMoneyReport::Column::NoColumns: + case MyMoneyReport::Column::Months: combo->setCurrentItem(i18nc("@item the columns will display monthly data", "Monthly"), false); break; - case MyMoneyReport::eBiMonths: + case MyMoneyReport::Column::BiMonths: combo->setCurrentItem(i18nc("@item the columns will display bi-monthly data", "Bi-Monthly"), false); break; - case MyMoneyReport::eQuarters: + case MyMoneyReport::Column::Quarters: combo->setCurrentItem(i18nc("@item the columns will display quarterly data", "Quarterly"), false); break; - case MyMoneyReport::eYears: + case MyMoneyReport::Column::Years: combo->setCurrentItem(i18nc("@item the columns will display yearly data", "Yearly"), false); break; default: diff --git a/kmymoney/mymoney/mymoneyreport.h b/kmymoney/mymoney/mymoneyreport.h --- a/kmymoney/mymoney/mymoneyreport.h +++ b/kmymoney/mymoney/mymoneyreport.h @@ -71,30 +71,59 @@ public: // When adding a new row type, be sure to add a corresponding entry in kTypeArray - enum ERowType { eNoRows = 0, eAssetLiability, eExpenseIncome, eCategory, eTopCategory, eAccount, eTag, ePayee, eMonth, eWeek, eTopAccount, eAccountByTopAccount, eEquityType, eAccountType, eInstitution, eBudget, eBudgetActual, eSchedule, eAccountInfo, eAccountLoanInfo, eAccountReconcile, eCashFlow}; - enum EReportType { eNoReport = 0, ePivotTable, eQueryTable, eInfoTable }; - enum EColumnType { eNoColumns = 0, eDays = 1, eMonths = 1, eBiMonths = 2, eQuarters = 3, eWeeks = 7, eYears = 12 }; - - // if you add bits to this bitmask, start with the value currently assigned to eQCend and update its value afterwards - // also don't forget to add column names to kQueryColumnsText in mymoneyreport.cpp - enum EQueryColumns { eQCnone = 0x0, eQCbegin = 0x1, eQCnumber = 0x1, eQCpayee = 0x2, eQCcategory = 0x4, eQCtag = 0x8, eQCmemo = 0x10, eQCaccount = 0x20, eQCreconciled = 0x40, eQCaction = 0x80, eQCshares = 0x100, eQCprice = 0x200, eQCperformance = 0x400, eQCloan = 0x800, eQCbalance = 0x1000, eQCcapitalgain = 0x2000, eQCend = 0x4000 }; + class Row { + public: + enum Type { NoRows = 0, AssetLiability, ExpenseIncome, Category, TopCategory, Account, Tag, Payee, Month, Week, TopAccount, AccountByTopAccount, EquityType, AccountType, Institution, Budget, BudgetActual, Schedule, AccountInfo, AccountLoanInfo, AccountReconcile, CashFlow}; + /** + * Return row type as string. + * + * @param type type to get string for + * @return row type converted to string + */ + static QString toString(Type type); + static const QStringList kText; + }; + + + class Report { + public: + enum Type { NoReport = 0, PivotTable, QueryTable, InfoTable }; + /** + * Return report type as string. + * + * @param type report type to get string for + * @return report type converted to string + */ + static QString toString(Type type); + static const Type kTypeArray[]; + }; + + class Column { + public: + enum Type { NoColumns = 0, Days = 1, Months = 1, BiMonths = 2, Quarters = 3, Weeks = 7, Years = 12 }; + static const QStringList kText; + }; + + // if you add bits to this bitmask, start with the value currently assigned to end and update its value afterwards + // also don't forget to add column names to QueryColumns::kText in mymoneyreport.cpp + class QueryColumns { + public: + enum Type { None = 0x0, Begin = 0x1, Number = 0x1, Payee = 0x2, Category = 0x4, Tag = 0x8, Memo = 0x10, Account = 0x20, Reconciled = 0x40, Action = 0x80, Shares = 0x100, Price = 0x200, Performance = 0x400, Loan = 0x800, Balance = 0x1000, Capitalgain = 0x2000, End = 0x4000 }; + static const QStringList kText; + }; enum EDetailLevel { eDetailNone = 0, eDetailAll, eDetailTop, eDetailGroup, eDetailTotal, eDetailEnd }; enum EInvestmentSum { eSumPeriod = 0, eSumOwnedAndSold, eSumOwned, eSumSold, eSumBought}; enum EChartType { eChartNone = 0, eChartLine, eChartBar, eChartPie, eChartRing, eChartStackedBar, eChartEnd }; enum dataOptionE { automatic = 0, userDefined, dataOptionCount }; - static const QStringList kRowTypeText; - static const QStringList kColumnTypeText; - static const QStringList kQueryColumnsText; static const QStringList kDetailLevelText; static const QStringList kChartTypeText; - static const EReportType kTypeArray[]; public: MyMoneyReport(); - explicit MyMoneyReport(ERowType rt, + explicit MyMoneyReport(Row::Type rt, unsigned ct, eMyMoney::TransactionFilter::Date dl, EDetailLevel ss, @@ -117,7 +146,7 @@ ~MyMoneyReport(); - EReportType reportType() const; + Report::Type reportType() const; QString name() const; void setName(const QString& s); @@ -128,22 +157,22 @@ bool isShowingColumnTotals() const; void setShowingColumnTotals(bool f); - ERowType rowType() const; - void setRowType(ERowType rt); + Row::Type rowType() const; + void setRowType(Row::Type rt); bool isRunningSum() const; - EColumnType columnType() const; - void setColumnType(EColumnType ct); + Column::Type columnType() const; + void setColumnType(Column::Type ct); bool isConvertCurrency() const; void setConvertCurrency(bool f); uint columnPitch() const; QString comment() const; void setComment(const QString& comment); - EQueryColumns queryColumns() const; - void setQueryColumns(EQueryColumns qc); + QueryColumns::Type queryColumns() const; + void setQueryColumns(QueryColumns::Type qc); QString group() const; void setGroup(const QString& group); @@ -452,15 +481,15 @@ * @param type type to get string for * @return row type converted to string */ - static QString toString(ERowType type); + static QString toString(Row::Type type); /** * Return report type as string. * * @param type report type to get string for * @return report type converted to string */ - static QString toString(EReportType type); + static QString toString(Report::Type type); }; inline void swap(MyMoneyReport& first, MyMoneyReport& second) // krazy:exclude=inline diff --git a/kmymoney/mymoney/mymoneyreport.cpp b/kmymoney/mymoney/mymoneyreport.cpp --- a/kmymoney/mymoney/mymoneyreport.cpp +++ b/kmymoney/mymoney/mymoneyreport.cpp @@ -44,14 +44,14 @@ // define this to debug reports // #define DEBUG_REPORTS -const QStringList MyMoneyReport::kRowTypeText = QString("none,assetliability,expenseincome,category,topcategory,account,tag,payee,month,week,topaccount,topaccount-account,equitytype,accounttype,institution,budget,budgetactual,schedule,accountinfo,accountloaninfo,accountreconcile,cashflow").split(','); -const QStringList MyMoneyReport::kColumnTypeText = QString("none,months,bimonths,quarters,4,5,6,weeks,8,9,10,11,years").split(','); +const QStringList MyMoneyReport::Row::kText = QString("none,assetliability,expenseincome,category,topcategory,account,tag,payee,month,week,topaccount,topaccount-account,equitytype,accounttype,institution,budget,budgetactual,schedule,accountinfo,accountloaninfo,accountreconcile,cashflow").split(','); +const QStringList MyMoneyReport::Column::kText = QString("none,months,bimonths,quarters,4,5,6,weeks,8,9,10,11,years").split(','); -// if you add names here, don't forget to update the bitmap for EQueryColumns -// and shift the bit for eQCend one position to the left -const QStringList MyMoneyReport::kQueryColumnsText = QString("none,number,payee,category,tag,memo,account,reconcileflag,action,shares,price,performance,loan,balance,capitalgain").split(','); +// if you add names here, don't forget to update the bitmap for QueryColumns::Type +// and shift the bit for QueryColumns::end one position to the left +const QStringList MyMoneyReport::QueryColumns::kText = QString("none,number,payee,category,tag,memo,account,reconcileflag,action,shares,price,performance,loan,balance").split(','); -const MyMoneyReport::EReportType MyMoneyReport::kTypeArray[] = { eNoReport, ePivotTable, ePivotTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, ePivotTable, ePivotTable, eInfoTable, eInfoTable, eInfoTable, eQueryTable, eQueryTable, eNoReport }; +const MyMoneyReport::Report::Type MyMoneyReport::Report::kTypeArray[] = { NoReport, PivotTable, PivotTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, PivotTable, PivotTable, InfoTable, InfoTable, InfoTable, QueryTable, QueryTable, NoReport }; const QStringList MyMoneyReport::kDetailLevelText = QString("none,all,top,group,total,invalid").split(','); const QStringList MyMoneyReport::kChartTypeText = QString("none,line,bar,pie,ring,stackedbar").split(','); @@ -75,11 +75,11 @@ d->m_tax = false; d->m_investments = false; d->m_loans = false; - d->m_reportType = kTypeArray[eExpenseIncome]; - d->m_rowType = eExpenseIncome; - d->m_columnType = eMonths; + d->m_reportType = Report::kTypeArray[Row::ExpenseIncome]; + d->m_rowType = Row::ExpenseIncome; + d->m_columnType = Column::Months; d->m_columnsAreDays = false; - d->m_queryColumns = eQCnone; + d->m_queryColumns = QueryColumns::None; d->m_dateLock = TransactionFilter::Date::UserDefined; d->m_accountGroupFilter = false; d->m_chartType = eChartLine; @@ -114,7 +114,7 @@ d->m_chartLineWidth = m_lineWidth; } -MyMoneyReport::MyMoneyReport(ERowType rt, +MyMoneyReport::MyMoneyReport(Row::Type rt, unsigned ct, TransactionFilter::Date dl, EDetailLevel ss, @@ -126,18 +126,18 @@ d->m_name = name; d->m_comment = comment; d->m_detailLevel = ss; - d->m_investmentSum = ct & eQCcapitalgain ? eSumSold : eSumPeriod; + d->m_investmentSum = ct & QueryColumns::Capitalgain ? eSumSold : eSumPeriod; d->m_hideTransactions = false; d->m_convertCurrency = true; d->m_favorite = false; d->m_tax = false; d->m_investments = false; d->m_loans = false; - d->m_reportType = kTypeArray[rt]; + d->m_reportType = Report::kTypeArray[rt]; d->m_rowType = rt; - d->m_columnType = eMonths; + d->m_columnType = Column::Months; d->m_columnsAreDays = false; - d->m_queryColumns = eQCnone; + d->m_queryColumns = QueryColumns::None; d->m_dateLock = dl; d->m_accountGroupFilter = false; d->m_chartType = eChartLine; @@ -174,24 +174,24 @@ d->m_chartLineWidth = m_lineWidth; //set report type - if (d->m_reportType == ePivotTable) - d->m_columnType = static_cast(ct); - if (d->m_reportType == eQueryTable) - d->m_queryColumns = static_cast(ct); + if (d->m_reportType == Report::PivotTable) + d->m_columnType = static_cast(ct); + if (d->m_reportType == Report::QueryTable) + d->m_queryColumns = static_cast(ct); setDateFilter(dl); //throw exception if the type is inconsistent - if ((rt > static_cast(sizeof(kTypeArray) / sizeof(kTypeArray[0]))) - || (d->m_reportType == eNoReport)) + if ((rt > static_cast(sizeof(Report::kTypeArray) / sizeof(Report::kTypeArray[0]))) + || (d->m_reportType == Report::NoReport)) throw MYMONEYEXCEPTION("Invalid report type"); //add the corresponding account groups - if (rt == MyMoneyReport::eAssetLiability) { + if (rt == MyMoneyReport::Row::AssetLiability) { addAccountGroup(Account::Type::Asset); addAccountGroup(Account::Type::Liability); d->m_showRowTotals = true; } - if (rt == MyMoneyReport::eAccount) { + if (rt == MyMoneyReport::Row::Account) { addAccountGroup(Account::Type::Asset); addAccountGroup(Account::Type::AssetLoan); addAccountGroup(Account::Type::Cash); @@ -207,22 +207,22 @@ addAccountGroup(Account::Type::Stock); d->m_showRowTotals = true; } - if (rt == MyMoneyReport::eExpenseIncome) { + if (rt == MyMoneyReport::Row::ExpenseIncome) { addAccountGroup(Account::Type::Expense); addAccountGroup(Account::Type::Income); d->m_showRowTotals = true; } //FIXME take this out once we have sorted out all issues regarding budget of assets and liabilities -- asoliverez@gmail.com - if (rt == MyMoneyReport::eBudget || rt == MyMoneyReport::eBudgetActual) { + if (rt == MyMoneyReport::Row::Budget || rt == MyMoneyReport::Row::BudgetActual) { addAccountGroup(Account::Type::Expense); addAccountGroup(Account::Type::Income); } - if (rt == MyMoneyReport::eAccountInfo) { + if (rt == MyMoneyReport::Row::AccountInfo) { addAccountGroup(Account::Type::Asset); addAccountGroup(Account::Type::Liability); } //cash flow reports show splits for all account groups - if (rt == MyMoneyReport::eCashFlow) { + if (rt == MyMoneyReport::Row::CashFlow) { addAccountGroup(Account::Type::Expense); addAccountGroup(Account::Type::Income); addAccountGroup(Account::Type::Asset); @@ -268,7 +268,7 @@ { } -MyMoneyReport::EReportType MyMoneyReport::reportType() const +MyMoneyReport::Report::Type MyMoneyReport::reportType() const { Q_D(const MyMoneyReport); return d->m_reportType; @@ -310,44 +310,44 @@ d->m_showColumnTotals = f; } -MyMoneyReport::ERowType MyMoneyReport::rowType() const +MyMoneyReport::Row::Type MyMoneyReport::rowType() const { Q_D(const MyMoneyReport); return d->m_rowType; } -void MyMoneyReport::setRowType(ERowType rt) +void MyMoneyReport::setRowType(Row::Type rt) { Q_D(MyMoneyReport); d->m_rowType = rt; - d->m_reportType = kTypeArray[rt]; + d->m_reportType = Report::kTypeArray[rt]; d->m_accountGroupFilter = false; d->m_accountGroups.clear(); - if (rt == MyMoneyReport::eAssetLiability) { + if (rt == MyMoneyReport::Row::AssetLiability) { addAccountGroup(Account::Type::Asset); addAccountGroup(Account::Type::Liability); } - if (rt == MyMoneyReport::eExpenseIncome) { + if (rt == MyMoneyReport::Row::ExpenseIncome) { addAccountGroup(Account::Type::Expense); addAccountGroup(Account::Type::Income); } } bool MyMoneyReport::isRunningSum() const { Q_D(const MyMoneyReport); - return (d->m_rowType == eAssetLiability); + return (d->m_rowType == Row::AssetLiability); } -MyMoneyReport::EColumnType MyMoneyReport::columnType() const +MyMoneyReport::Column::Type MyMoneyReport::columnType() const { Q_D(const MyMoneyReport); return d->m_columnType; } -void MyMoneyReport::setColumnType(EColumnType ct) +void MyMoneyReport::setColumnType(Column::Type ct) { Q_D(MyMoneyReport); d->m_columnType = ct; @@ -383,13 +383,13 @@ d->m_comment = comment; } -MyMoneyReport::EQueryColumns MyMoneyReport::queryColumns() const +MyMoneyReport::QueryColumns::Type MyMoneyReport::queryColumns() const { Q_D(const MyMoneyReport); return d->m_queryColumns; } -void MyMoneyReport::setQueryColumns(EQueryColumns qc) +void MyMoneyReport::setQueryColumns(QueryColumns::Type qc) { Q_D(MyMoneyReport); d->m_queryColumns = qc; @@ -1007,7 +1007,7 @@ { Q_D(const MyMoneyReport); bool result = (! d->m_accountGroupFilter) - || (isIncludingTransfers() && d->m_rowType == MyMoneyReport::eExpenseIncome) + || (isIncludingTransfers() && d->m_rowType == MyMoneyReport::Row::ExpenseIncome) || d->m_accountGroups.contains(type); return result; @@ -1033,7 +1033,7 @@ result = acc.isLoan() && includesAccount(acc.id()); else if (isInvestmentsOnly()) result = acc.isInvest() && includesAccount(acc.id()); - else if (isIncludingTransfers() && d->m_rowType == MyMoneyReport::eExpenseIncome) + else if (isIncludingTransfers() && d->m_rowType == MyMoneyReport::Row::ExpenseIncome) // If transfers are included, ONLY include this account if it is NOT // included in the report itself!! result = ! includesAccount(acc.id()); @@ -1060,125 +1060,125 @@ // Feel free to change the minor type every time a change is made here. // write report's internals - if (d->m_reportType == ePivotTable) - e.setAttribute(d->getAttrName(Report::Attribute::Type), "pivottable 1.15"); - else if (d->m_reportType == eQueryTable) - e.setAttribute(d->getAttrName(Report::Attribute::Type), "querytable 1.14"); - else if (d->m_reportType == eInfoTable) - e.setAttribute(d->getAttrName(Report::Attribute::Type), "infotable 1.0"); + if (d->m_reportType == Report::PivotTable) + e.setAttribute(d->getAttrName(Reporting::Attribute::Type), "pivottable 1.15"); + else if (d->m_reportType == Report::QueryTable) + e.setAttribute(d->getAttrName(Reporting::Attribute::Type), "querytable 1.14"); + else if (d->m_reportType == Report::InfoTable) + e.setAttribute(d->getAttrName(Reporting::Attribute::Type), "infotable 1.0"); - e.setAttribute(d->getAttrName(Report::Attribute::Group), d->m_group); - e.setAttribute(d->getAttrName(Report::Attribute::ID), d->m_id); + e.setAttribute(d->getAttrName(Reporting::Attribute::Group), d->m_group); + e.setAttribute(d->getAttrName(Reporting::Attribute::ID), d->m_id); // write general tab if (anonymous) { - e.setAttribute(d->getAttrName(Report::Attribute::Name), d->m_id); - e.setAttribute(d->getAttrName(Report::Attribute::Comment), QString(d->m_comment).fill('x')); + e.setAttribute(d->getAttrName(Reporting::Attribute::Name), d->m_id); + e.setAttribute(d->getAttrName(Reporting::Attribute::Comment), QString(d->m_comment).fill('x')); } else { - e.setAttribute(d->getAttrName(Report::Attribute::Name), d->m_name); - e.setAttribute(d->getAttrName(Report::Attribute::Comment), d->m_comment); + e.setAttribute(d->getAttrName(Reporting::Attribute::Name), d->m_name); + e.setAttribute(d->getAttrName(Reporting::Attribute::Comment), d->m_comment); } - e.setAttribute(d->getAttrName(Report::Attribute::ConvertCurrency), d->m_convertCurrency); - e.setAttribute(d->getAttrName(Report::Attribute::Favorite), d->m_favorite); - e.setAttribute(d->getAttrName(Report::Attribute::SkipZero), d->m_skipZero); + e.setAttribute(d->getAttrName(Reporting::Attribute::ConvertCurrency), d->m_convertCurrency); + e.setAttribute(d->getAttrName(Reporting::Attribute::Favorite), d->m_favorite); + e.setAttribute(d->getAttrName(Reporting::Attribute::SkipZero), d->m_skipZero); - e.setAttribute(d->getAttrName(Report::Attribute::DateLock), kDateLockText[(int)d->m_dateLock]); + e.setAttribute(d->getAttrName(Reporting::Attribute::DateLock), kDateLockText[(int)d->m_dateLock]); - if (d->m_reportType == ePivotTable) { + if (d->m_reportType == Report::PivotTable) { // write report's internals - e.setAttribute(d->getAttrName(Report::Attribute::IncludesActuals), d->m_includeBudgetActuals); - e.setAttribute(d->getAttrName(Report::Attribute::IncludesForecast), d->m_includeForecast); - e.setAttribute(d->getAttrName(Report::Attribute::IncludesPrice), d->m_includePrice); - e.setAttribute(d->getAttrName(Report::Attribute::IncludesAveragePrice), d->m_includeAveragePrice); - e.setAttribute(d->getAttrName(Report::Attribute::MixedTime), d->m_mixedTime); - e.setAttribute(d->getAttrName(Report::Attribute::Investments), d->m_investments); // it's setable in rows/columns tab of querytable, but here it is internal setting + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesActuals), d->m_includeBudgetActuals); + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesForecast), d->m_includeForecast); + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesPrice), d->m_includePrice); + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesAveragePrice), d->m_includeAveragePrice); + e.setAttribute(d->getAttrName(Reporting::Attribute::MixedTime), d->m_mixedTime); + e.setAttribute(d->getAttrName(Reporting::Attribute::Investments), d->m_investments); // it's setable in rows/columns tab of querytable, but here it is internal setting // write rows/columns tab if (!d->m_budgetId.isEmpty()) - e.setAttribute(d->getAttrName(Report::Attribute::Budget), d->m_budgetId); + e.setAttribute(d->getAttrName(Reporting::Attribute::Budget), d->m_budgetId); - e.setAttribute(d->getAttrName(Report::Attribute::RowType), kRowTypeText[d->m_rowType]); - e.setAttribute(d->getAttrName(Report::Attribute::ShowRowTotals), d->m_showRowTotals); - e.setAttribute(d->getAttrName(Report::Attribute::ShowColumnTotals), d->m_showColumnTotals); - e.setAttribute(d->getAttrName(Report::Attribute::Detail), kDetailLevelText[d->m_detailLevel]); + e.setAttribute(d->getAttrName(Reporting::Attribute::RowType), Row::kText[d->m_rowType]); + e.setAttribute(d->getAttrName(Reporting::Attribute::ShowRowTotals), d->m_showRowTotals); + e.setAttribute(d->getAttrName(Reporting::Attribute::ShowColumnTotals), d->m_showColumnTotals); + e.setAttribute(d->getAttrName(Reporting::Attribute::Detail), kDetailLevelText[d->m_detailLevel]); - e.setAttribute(d->getAttrName(Report::Attribute::IncludesMovingAverage), d->m_includeMovingAverage); + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesMovingAverage), d->m_includeMovingAverage); if (d->m_includeMovingAverage) - e.setAttribute(d->getAttrName(Report::Attribute::MovingAverageDays), d->m_movingAverageDays); + e.setAttribute(d->getAttrName(Reporting::Attribute::MovingAverageDays), d->m_movingAverageDays); - e.setAttribute(d->getAttrName(Report::Attribute::IncludesSchedules), d->m_includeSchedules); - e.setAttribute(d->getAttrName(Report::Attribute::IncludesTransfers), d->m_includeTransfers); - e.setAttribute(d->getAttrName(Report::Attribute::IncludesUnused), d->m_includeUnusedAccounts); - e.setAttribute(d->getAttrName(Report::Attribute::ColumnsAreDays), d->m_columnsAreDays); + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesSchedules), d->m_includeSchedules); + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesTransfers), d->m_includeTransfers); + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesUnused), d->m_includeUnusedAccounts); + e.setAttribute(d->getAttrName(Reporting::Attribute::ColumnsAreDays), d->m_columnsAreDays); // write chart tab if (d->m_chartType < 0 || d->m_chartType >= kChartTypeText.size()) { qDebug("m_chartType out of bounds with %d on report of type %d. Default to none.", d->m_chartType, d->m_reportType); - e.setAttribute(d->getAttrName(Report::Attribute::ChartType), kChartTypeText[eChartNone]); + e.setAttribute(d->getAttrName(Reporting::Attribute::ChartType), kChartTypeText[eChartNone]); } else - e.setAttribute(d->getAttrName(Report::Attribute::ChartType), kChartTypeText[d->m_chartType]); - - e.setAttribute(d->getAttrName(Report::Attribute::ChartCHGridLines), d->m_chartCHGridLines); - e.setAttribute(d->getAttrName(Report::Attribute::ChartSVGridLines), d->m_chartSVGridLines); - e.setAttribute(d->getAttrName(Report::Attribute::ChartDataLabels), d->m_chartDataLabels); - e.setAttribute(d->getAttrName(Report::Attribute::ChartByDefault), d->m_chartByDefault); - e.setAttribute(d->getAttrName(Report::Attribute::LogYAxis), d->m_logYaxis); - e.setAttribute(d->getAttrName(Report::Attribute::ChartLineWidth), d->m_chartLineWidth); - e.setAttribute(d->getAttrName(Report::Attribute::ColumnType), kColumnTypeText[d->m_columnType]); - e.setAttribute(d->getAttrName(Report::Attribute::DataLock), kDataLockText[d->m_dataLock]); - e.setAttribute(d->getAttrName(Report::Attribute::DataRangeStart), d->m_dataRangeStart); - e.setAttribute(d->getAttrName(Report::Attribute::DataRangeEnd), d->m_dataRangeEnd); - e.setAttribute(d->getAttrName(Report::Attribute::DataMajorTick), d->m_dataMajorTick); - e.setAttribute(d->getAttrName(Report::Attribute::DataMinorTick), d->m_dataMinorTick); - e.setAttribute(d->getAttrName(Report::Attribute::YLabelsPrecision), d->m_yLabelsPrecision); - } else if (d->m_reportType == eQueryTable) { + e.setAttribute(d->getAttrName(Reporting::Attribute::ChartType), kChartTypeText[d->m_chartType]); + + e.setAttribute(d->getAttrName(Reporting::Attribute::ChartCHGridLines), d->m_chartCHGridLines); + e.setAttribute(d->getAttrName(Reporting::Attribute::ChartSVGridLines), d->m_chartSVGridLines); + e.setAttribute(d->getAttrName(Reporting::Attribute::ChartDataLabels), d->m_chartDataLabels); + e.setAttribute(d->getAttrName(Reporting::Attribute::ChartByDefault), d->m_chartByDefault); + e.setAttribute(d->getAttrName(Reporting::Attribute::LogYAxis), d->m_logYaxis); + e.setAttribute(d->getAttrName(Reporting::Attribute::ChartLineWidth), d->m_chartLineWidth); + e.setAttribute(d->getAttrName(Reporting::Attribute::ColumnType), Column::kText[d->m_columnType]); + e.setAttribute(d->getAttrName(Reporting::Attribute::DataLock), kDataLockText[d->m_dataLock]); + e.setAttribute(d->getAttrName(Reporting::Attribute::DataRangeStart), d->m_dataRangeStart); + e.setAttribute(d->getAttrName(Reporting::Attribute::DataRangeEnd), d->m_dataRangeEnd); + e.setAttribute(d->getAttrName(Reporting::Attribute::DataMajorTick), d->m_dataMajorTick); + e.setAttribute(d->getAttrName(Reporting::Attribute::DataMinorTick), d->m_dataMinorTick); + e.setAttribute(d->getAttrName(Reporting::Attribute::YLabelsPrecision), d->m_yLabelsPrecision); + } else if (d->m_reportType == Report::QueryTable) { // write rows/columns tab - e.setAttribute(d->getAttrName(Report::Attribute::RowType), kRowTypeText[d->m_rowType]); + e.setAttribute(d->getAttrName(Reporting::Attribute::RowType), Row::kText[d->m_rowType]); QStringList columns; unsigned qc = d->m_queryColumns; - unsigned it_qc = eQCbegin; + unsigned it_qc = QueryColumns::Type::Begin; unsigned index = 1; - while (it_qc != eQCend) { + while (it_qc != QueryColumns::Type::End) { if (qc & it_qc) - columns += kQueryColumnsText[index]; + columns += QueryColumns::kText[index]; it_qc *= 2; index++; } - e.setAttribute(d->getAttrName(Report::Attribute::QueryColumns), columns.join(",")); + e.setAttribute(d->getAttrName(Reporting::Attribute::QueryColumns), columns.join(",")); - e.setAttribute(d->getAttrName(Report::Attribute::Tax), d->m_tax); - e.setAttribute(d->getAttrName(Report::Attribute::Investments), d->m_investments); - e.setAttribute(d->getAttrName(Report::Attribute::Loans), d->m_loans); - e.setAttribute(d->getAttrName(Report::Attribute::HideTransactions), d->m_hideTransactions); - e.setAttribute(d->getAttrName(Report::Attribute::ShowColumnTotals), d->m_showColumnTotals); - e.setAttribute(d->getAttrName(Report::Attribute::Detail), kDetailLevelText[d->m_detailLevel]); + e.setAttribute(d->getAttrName(Reporting::Attribute::Tax), d->m_tax); + e.setAttribute(d->getAttrName(Reporting::Attribute::Investments), d->m_investments); + e.setAttribute(d->getAttrName(Reporting::Attribute::Loans), d->m_loans); + e.setAttribute(d->getAttrName(Reporting::Attribute::HideTransactions), d->m_hideTransactions); + e.setAttribute(d->getAttrName(Reporting::Attribute::ShowColumnTotals), d->m_showColumnTotals); + e.setAttribute(d->getAttrName(Reporting::Attribute::Detail), kDetailLevelText[d->m_detailLevel]); // write performance tab - if (d->m_queryColumns & eQCperformance || d->m_queryColumns & eQCcapitalgain) - e.setAttribute(d->getAttrName(Report::Attribute::InvestmentSum), d->m_investmentSum); + if (d->m_queryColumns & QueryColumns::Performance || d->m_queryColumns & QueryColumns::Capitalgain) + e.setAttribute(d->getAttrName(Reporting::Attribute::InvestmentSum), d->m_investmentSum); // write capital gains tab - if (d->m_queryColumns & eQCcapitalgain) { + if (d->m_queryColumns & QueryColumns::Capitalgain) { if (d->m_investmentSum == MyMoneyReport::eSumSold) { - e.setAttribute(d->getAttrName(Report::Attribute::SettlementPeriod), d->m_settlementPeriod); - e.setAttribute(d->getAttrName(Report::Attribute::ShowSTLTCapitalGains), d->m_showSTLTCapitalGains); - e.setAttribute(d->getAttrName(Report::Attribute::TermsSeparator), d->m_tseparator.toString(Qt::ISODate)); + e.setAttribute(d->getAttrName(Reporting::Attribute::SettlementPeriod), d->m_settlementPeriod); + e.setAttribute(d->getAttrName(Reporting::Attribute::ShowSTLTCapitalGains), d->m_showSTLTCapitalGains); + e.setAttribute(d->getAttrName(Reporting::Attribute::TermsSeparator), d->m_tseparator.toString(Qt::ISODate)); } } - } else if (d->m_reportType == eInfoTable) - e.setAttribute(d->getAttrName(Report::Attribute::ShowRowTotals), d->m_showRowTotals); + } else if (d->m_reportType == Report::InfoTable) + e.setAttribute(d->getAttrName(Reporting::Attribute::ShowRowTotals), d->m_showRowTotals); // // Text Filter // QRegExp textfilter; if (textFilter(textfilter)) { - QDomElement f = doc->createElement(d->getElName(Report::Element::Text)); - f.setAttribute(d->getAttrName(Report::Attribute::Pattern), textfilter.pattern()); - f.setAttribute(d->getAttrName(Report::Attribute::CaseSensitive), (textfilter.caseSensitivity() == Qt::CaseSensitive) ? 1 : 0); - f.setAttribute(d->getAttrName(Report::Attribute::RegEx), (textfilter.patternSyntax() == QRegExp::Wildcard) ? 1 : 0); - f.setAttribute(d->getAttrName(Report::Attribute::InvertText), MyMoneyTransactionFilter::isInvertingText()); + QDomElement f = doc->createElement(d->getElName(Reporting::Element::Text)); + f.setAttribute(d->getAttrName(Reporting::Attribute::Pattern), textfilter.pattern()); + f.setAttribute(d->getAttrName(Reporting::Attribute::CaseSensitive), (textfilter.caseSensitivity() == Qt::CaseSensitive) ? 1 : 0); + f.setAttribute(d->getAttrName(Reporting::Attribute::RegEx), (textfilter.patternSyntax() == QRegExp::Wildcard) ? 1 : 0); + f.setAttribute(d->getAttrName(Reporting::Attribute::InvertText), MyMoneyTransactionFilter::isInvertingText()); e.appendChild(f); } @@ -1190,8 +1190,8 @@ // iterate over payees, and add each one QList::const_iterator it_type = typelist.constBegin(); while (it_type != typelist.constEnd()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::Type)); - p.setAttribute(d->getAttrName(Report::Attribute::Type), kTypeText[*it_type]); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::Type)); + p.setAttribute(d->getAttrName(Reporting::Attribute::Type), kTypeText[*it_type]); e.appendChild(p); ++it_type; @@ -1203,8 +1203,8 @@ // iterate over payees, and add each one QList::const_iterator it_state = statelist.constBegin(); while (it_state != statelist.constEnd()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::State)); - p.setAttribute(d->getAttrName(Report::Attribute::State), kStateText[*it_state]); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::State)); + p.setAttribute(d->getAttrName(Reporting::Attribute::State), kStateText[*it_state]); e.appendChild(p); ++it_state; @@ -1216,9 +1216,9 @@ QString nrFrom, nrTo; if (numberFilter(nrFrom, nrTo)) { - QDomElement f = doc->createElement(d->getElName(Report::Element::Number)); - f.setAttribute(d->getAttrName(Report::Attribute::From), nrFrom); - f.setAttribute(d->getAttrName(Report::Attribute::To), nrTo); + QDomElement f = doc->createElement(d->getElName(Reporting::Element::Number)); + f.setAttribute(d->getAttrName(Reporting::Attribute::From), nrFrom); + f.setAttribute(d->getAttrName(Reporting::Attribute::To), nrTo); e.appendChild(f); } @@ -1228,9 +1228,9 @@ MyMoneyMoney from, to; if (amountFilter(from, to)) { // bool getAmountFilter(MyMoneyMoney&,MyMoneyMoney&); - QDomElement f = doc->createElement(d->getElName(Report::Element::Amount)); - f.setAttribute(d->getAttrName(Report::Attribute::From), from.toString()); - f.setAttribute(d->getAttrName(Report::Attribute::To), to.toString()); + QDomElement f = doc->createElement(d->getElName(Reporting::Element::Amount)); + f.setAttribute(d->getAttrName(Reporting::Attribute::From), from.toString()); + f.setAttribute(d->getAttrName(Reporting::Attribute::To), to.toString()); e.appendChild(f); } @@ -1241,14 +1241,14 @@ QStringList payeelist; if (payees(payeelist)) { if (payeelist.empty()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::Payee)); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::Payee)); e.appendChild(p); } else { // iterate over payees, and add each one QStringList::const_iterator it_payee = payeelist.constBegin(); while (it_payee != payeelist.constEnd()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::Payee)); - p.setAttribute(d->getAttrName(Report::Attribute::ID), *it_payee); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::Payee)); + p.setAttribute(d->getAttrName(Reporting::Attribute::ID), *it_payee); e.appendChild(p); ++it_payee; @@ -1263,14 +1263,14 @@ QStringList taglist; if (tags(taglist)) { if (taglist.empty()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::Tag)); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::Tag)); e.appendChild(p); } else { // iterate over tags, and add each one QStringList::const_iterator it_tag = taglist.constBegin(); while (it_tag != taglist.constEnd()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::Tag)); - p.setAttribute(d->getAttrName(Report::Attribute::ID), *it_tag); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::Tag)); + p.setAttribute(d->getAttrName(Reporting::Attribute::ID), *it_tag); e.appendChild(p); ++it_tag; @@ -1287,8 +1287,8 @@ // iterate over accounts, and add each one QList::const_iterator it_group = accountgrouplist.constBegin(); while (it_group != accountgrouplist.constEnd()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::AccountGroup)); - p.setAttribute(d->getAttrName(Report::Attribute::Group), kAccountTypeText[(int)*it_group]); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::AccountGroup)); + p.setAttribute(d->getAttrName(Reporting::Attribute::Group), kAccountTypeText[(int)*it_group]); e.appendChild(p); ++it_group; @@ -1304,8 +1304,8 @@ // iterate over accounts, and add each one QStringList::const_iterator it_account = accountlist.constBegin(); while (it_account != accountlist.constEnd()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::Account)); - p.setAttribute(d->getAttrName(Report::Attribute::ID), *it_account); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::Account)); + p.setAttribute(d->getAttrName(Reporting::Attribute::ID), *it_account); e.appendChild(p); ++it_account; @@ -1321,8 +1321,8 @@ // iterate over accounts, and add each one QStringList::const_iterator it_account = accountlist.constBegin(); while (it_account != accountlist.constEnd()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::Category)); - p.setAttribute(d->getAttrName(Report::Attribute::ID), *it_account); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::Category)); + p.setAttribute(d->getAttrName(Reporting::Attribute::ID), *it_account); e.appendChild(p); ++it_account; @@ -1336,11 +1336,11 @@ if (d->m_dateLock == TransactionFilter::Date::UserDefined) { QDate dateFrom, dateTo; if (dateFilter(dateFrom, dateTo)) { - QDomElement f = doc->createElement(d->getElName(Report::Element::Dates)); + QDomElement f = doc->createElement(d->getElName(Reporting::Element::Dates)); if (dateFrom.isValid()) - f.setAttribute(d->getAttrName(Report::Attribute::From), dateFrom.toString(Qt::ISODate)); + f.setAttribute(d->getAttrName(Reporting::Attribute::From), dateFrom.toString(Qt::ISODate)); if (dateTo.isValid()) - f.setAttribute(d->getAttrName(Report::Attribute::To), dateTo.toString(Qt::ISODate)); + f.setAttribute(d->getAttrName(Reporting::Attribute::To), dateTo.toString(Qt::ISODate)); e.appendChild(f); } } @@ -1358,23 +1358,23 @@ return false; // read report's internals - QString type = e.attribute(d->getAttrName(Report::Attribute::Type)); + QString type = e.attribute(d->getAttrName(Reporting::Attribute::Type)); if (type.startsWith(QLatin1String("pivottable"))) - d->m_reportType = ePivotTable; + d->m_reportType = Report::PivotTable; else if (type.startsWith(QLatin1String("querytable"))) - d->m_reportType = eQueryTable; + d->m_reportType = Report::QueryTable; else if (type.startsWith(QLatin1String("infotable"))) - d->m_reportType = eInfoTable; + d->m_reportType = Report::InfoTable; else return false; - d->m_group = e.attribute(d->getAttrName(Report::Attribute::Group)); - d->m_id = e.attribute(d->getAttrName(Report::Attribute::ID)); + d->m_group = e.attribute(d->getAttrName(Reporting::Attribute::Group)); + d->m_id = e.attribute(d->getAttrName(Reporting::Attribute::ID)); clearTransactionFilter(); // read date tab - QString datelockstr = e.attribute(d->getAttrName(Report::Attribute::DateLock), "userdefined"); + QString datelockstr = e.attribute(d->getAttrName(Reporting::Attribute::DateLock), "userdefined"); // Handle the pivot 1.2/query 1.1 case where the values were saved as // numbers bool ok = false; @@ -1387,171 +1387,171 @@ setDateFilter(static_cast(i)); // read general tab - d->m_name = e.attribute(d->getAttrName(Report::Attribute::Name)); - d->m_comment = e.attribute(d->getAttrName(Report::Attribute::Comment), "Extremely old report"); - d->m_convertCurrency = e.attribute(d->getAttrName(Report::Attribute::ConvertCurrency), "1").toUInt(); - d->m_favorite = e.attribute(d->getAttrName(Report::Attribute::Favorite), "0").toUInt(); - d->m_skipZero = e.attribute(d->getAttrName(Report::Attribute::SkipZero), "0").toUInt(); + d->m_name = e.attribute(d->getAttrName(Reporting::Attribute::Name)); + d->m_comment = e.attribute(d->getAttrName(Reporting::Attribute::Comment), "Extremely old report"); + d->m_convertCurrency = e.attribute(d->getAttrName(Reporting::Attribute::ConvertCurrency), "1").toUInt(); + d->m_favorite = e.attribute(d->getAttrName(Reporting::Attribute::Favorite), "0").toUInt(); + d->m_skipZero = e.attribute(d->getAttrName(Reporting::Attribute::SkipZero), "0").toUInt(); - if (d->m_reportType == ePivotTable) { + if (d->m_reportType == Report::PivotTable) { // read report's internals - d->m_includeBudgetActuals = e.attribute(d->getAttrName(Report::Attribute::IncludesActuals), "0").toUInt(); - d->m_includeForecast = e.attribute(d->getAttrName(Report::Attribute::IncludesForecast), "0").toUInt(); - d->m_includePrice = e.attribute(d->getAttrName(Report::Attribute::IncludesPrice), "0").toUInt(); - d->m_includeAveragePrice = e.attribute(d->getAttrName(Report::Attribute::IncludesAveragePrice), "0").toUInt(); - d->m_mixedTime = e.attribute(d->getAttrName(Report::Attribute::MixedTime), "0").toUInt(); - d->m_investments = e.attribute(d->getAttrName(Report::Attribute::Investments), "0").toUInt(); + d->m_includeBudgetActuals = e.attribute(d->getAttrName(Reporting::Attribute::IncludesActuals), "0").toUInt(); + d->m_includeForecast = e.attribute(d->getAttrName(Reporting::Attribute::IncludesForecast), "0").toUInt(); + d->m_includePrice = e.attribute(d->getAttrName(Reporting::Attribute::IncludesPrice), "0").toUInt(); + d->m_includeAveragePrice = e.attribute(d->getAttrName(Reporting::Attribute::IncludesAveragePrice), "0").toUInt(); + d->m_mixedTime = e.attribute(d->getAttrName(Reporting::Attribute::MixedTime), "0").toUInt(); + d->m_investments = e.attribute(d->getAttrName(Reporting::Attribute::Investments), "0").toUInt(); // read rows/columns tab - if (e.hasAttribute(d->getAttrName(Report::Attribute::Budget))) - d->m_budgetId = e.attribute(d->getAttrName(Report::Attribute::Budget)); + if (e.hasAttribute(d->getAttrName(Reporting::Attribute::Budget))) + d->m_budgetId = e.attribute(d->getAttrName(Reporting::Attribute::Budget)); - i = kRowTypeText.indexOf(e.attribute(d->getAttrName(Report::Attribute::RowType))); + i = Row::kText.indexOf(e.attribute(d->getAttrName(Reporting::Attribute::RowType))); if (i != -1) - setRowType(static_cast(i)); + setRowType(static_cast(i)); else - setRowType(eExpenseIncome); + setRowType(Row::ExpenseIncome); - if (e.hasAttribute(d->getAttrName(Report::Attribute::ShowRowTotals))) - d->m_showRowTotals = e.attribute(d->getAttrName(Report::Attribute::ShowRowTotals)).toUInt(); - else if (rowType() == eExpenseIncome) // for backward compatibility + if (e.hasAttribute(d->getAttrName(Reporting::Attribute::ShowRowTotals))) + d->m_showRowTotals = e.attribute(d->getAttrName(Reporting::Attribute::ShowRowTotals)).toUInt(); + else if (rowType() == Row::ExpenseIncome) // for backward compatibility d->m_showRowTotals = true; - d->m_showColumnTotals = e.attribute(d->getAttrName(Report::Attribute::ShowColumnTotals), "1").toUInt(); + d->m_showColumnTotals = e.attribute(d->getAttrName(Reporting::Attribute::ShowColumnTotals), "1").toUInt(); //check for reports with older settings which didn't have the detail attribute - i = kDetailLevelText.indexOf(e.attribute(d->getAttrName(Report::Attribute::Detail))); + i = kDetailLevelText.indexOf(e.attribute(d->getAttrName(Reporting::Attribute::Detail))); if (i != -1) d->m_detailLevel = static_cast(i); else d->m_detailLevel = eDetailAll; - d->m_includeMovingAverage = e.attribute(d->getAttrName(Report::Attribute::IncludesMovingAverage), "0").toUInt(); + d->m_includeMovingAverage = e.attribute(d->getAttrName(Reporting::Attribute::IncludesMovingAverage), "0").toUInt(); if (d->m_includeMovingAverage) - d->m_movingAverageDays = e.attribute(d->getAttrName(Report::Attribute::MovingAverageDays), "1").toUInt(); - d->m_includeSchedules = e.attribute(d->getAttrName(Report::Attribute::IncludesSchedules), "0").toUInt(); - d->m_includeTransfers = e.attribute(d->getAttrName(Report::Attribute::IncludesTransfers), "0").toUInt(); - d->m_includeUnusedAccounts = e.attribute(d->getAttrName(Report::Attribute::IncludesUnused), "0").toUInt(); - d->m_columnsAreDays = e.attribute(d->getAttrName(Report::Attribute::ColumnsAreDays), "0").toUInt(); + d->m_movingAverageDays = e.attribute(d->getAttrName(Reporting::Attribute::MovingAverageDays), "1").toUInt(); + d->m_includeSchedules = e.attribute(d->getAttrName(Reporting::Attribute::IncludesSchedules), "0").toUInt(); + d->m_includeTransfers = e.attribute(d->getAttrName(Reporting::Attribute::IncludesTransfers), "0").toUInt(); + d->m_includeUnusedAccounts = e.attribute(d->getAttrName(Reporting::Attribute::IncludesUnused), "0").toUInt(); + d->m_columnsAreDays = e.attribute(d->getAttrName(Reporting::Attribute::ColumnsAreDays), "0").toUInt(); // read chart tab - i = kChartTypeText.indexOf(e.attribute(d->getAttrName(Report::Attribute::ChartType))); + i = kChartTypeText.indexOf(e.attribute(d->getAttrName(Reporting::Attribute::ChartType))); if (i != -1) d->m_chartType = static_cast(i); else d->m_chartType = eChartNone; - d->m_chartCHGridLines = e.attribute(d->getAttrName(Report::Attribute::ChartCHGridLines), "1").toUInt(); - d->m_chartSVGridLines = e.attribute(d->getAttrName(Report::Attribute::ChartSVGridLines), "1").toUInt(); - d->m_chartDataLabels = e.attribute(d->getAttrName(Report::Attribute::ChartDataLabels), "1").toUInt(); - d->m_chartByDefault = e.attribute(d->getAttrName(Report::Attribute::ChartByDefault), "0").toUInt(); - d->m_logYaxis = e.attribute(d->getAttrName(Report::Attribute::LogYAxis), "0").toUInt(); - d->m_chartLineWidth = e.attribute(d->getAttrName(Report::Attribute::ChartLineWidth), QString(m_lineWidth)).toUInt(); + d->m_chartCHGridLines = e.attribute(d->getAttrName(Reporting::Attribute::ChartCHGridLines), "1").toUInt(); + d->m_chartSVGridLines = e.attribute(d->getAttrName(Reporting::Attribute::ChartSVGridLines), "1").toUInt(); + d->m_chartDataLabels = e.attribute(d->getAttrName(Reporting::Attribute::ChartDataLabels), "1").toUInt(); + d->m_chartByDefault = e.attribute(d->getAttrName(Reporting::Attribute::ChartByDefault), "0").toUInt(); + d->m_logYaxis = e.attribute(d->getAttrName(Reporting::Attribute::LogYAxis), "0").toUInt(); + d->m_chartLineWidth = e.attribute(d->getAttrName(Reporting::Attribute::ChartLineWidth), QString(m_lineWidth)).toUInt(); // read range tab - i = kColumnTypeText.indexOf(e.attribute(d->getAttrName(Report::Attribute::ColumnType))); + i = Column::kText.indexOf(e.attribute(d->getAttrName(Reporting::Attribute::ColumnType))); if (i != -1) - setColumnType(static_cast(i)); + setColumnType(static_cast(i)); else - setColumnType(eMonths); + setColumnType(Column::Months); - i = kDataLockText.indexOf(e.attribute(d->getAttrName(Report::Attribute::DataLock))); + i = kDataLockText.indexOf(e.attribute(d->getAttrName(Reporting::Attribute::DataLock))); if (i != -1) setDataFilter(static_cast(i)); else setDataFilter(MyMoneyReport::automatic); - d->m_dataRangeStart = e.attribute(d->getAttrName(Report::Attribute::DataRangeStart), "0"); - d->m_dataRangeEnd= e.attribute(d->getAttrName(Report::Attribute::DataRangeEnd), "0"); - d->m_dataMajorTick = e.attribute(d->getAttrName(Report::Attribute::DataMajorTick), "0"); - d->m_dataMinorTick = e.attribute(d->getAttrName(Report::Attribute::DataMinorTick), "0"); - d->m_yLabelsPrecision = e.attribute(d->getAttrName(Report::Attribute::YLabelsPrecision), "2").toUInt(); - } else if (d->m_reportType == eQueryTable) { + d->m_dataRangeStart = e.attribute(d->getAttrName(Reporting::Attribute::DataRangeStart), "0"); + d->m_dataRangeEnd= e.attribute(d->getAttrName(Reporting::Attribute::DataRangeEnd), "0"); + d->m_dataMajorTick = e.attribute(d->getAttrName(Reporting::Attribute::DataMajorTick), "0"); + d->m_dataMinorTick = e.attribute(d->getAttrName(Reporting::Attribute::DataMinorTick), "0"); + d->m_yLabelsPrecision = e.attribute(d->getAttrName(Reporting::Attribute::YLabelsPrecision), "2").toUInt(); + } else if (d->m_reportType == Report::QueryTable) { // read rows/columns tab - i = kRowTypeText.indexOf(e.attribute(d->getAttrName(Report::Attribute::RowType))); + i = Row::kText.indexOf(e.attribute(d->getAttrName(Reporting::Attribute::RowType))); if (i != -1) - setRowType(static_cast(i)); + setRowType(static_cast(i)); else - setRowType(eAccount); + setRowType(Row::Account); unsigned qc = 0; - QStringList columns = e.attribute(d->getAttrName(Report::Attribute::QueryColumns), "none").split(','); + QStringList columns = e.attribute(d->getAttrName(Reporting::Attribute::QueryColumns), "none").split(','); foreach (const auto column, columns) { - i = kQueryColumnsText.indexOf(column); + i = QueryColumns::kText.indexOf(column); if (i > 0) qc |= (1 << (i - 1)); } - setQueryColumns(static_cast(qc)); + setQueryColumns(static_cast(qc)); - d->m_tax = e.attribute(d->getAttrName(Report::Attribute::Tax), "0").toUInt(); - d->m_investments = e.attribute(d->getAttrName(Report::Attribute::Investments), "0").toUInt(); - d->m_loans = e.attribute(d->getAttrName(Report::Attribute::Loans), "0").toUInt(); - d->m_hideTransactions = e.attribute(d->getAttrName(Report::Attribute::HideTransactions), "0").toUInt(); - d->m_showColumnTotals = e.attribute(d->getAttrName(Report::Attribute::ShowColumnTotals), "1").toUInt(); - d->m_detailLevel = kDetailLevelText.indexOf(e.attribute(d->getAttrName(Report::Attribute::Detail), "none")) == eDetailAll ? eDetailAll : eDetailNone; + d->m_tax = e.attribute(d->getAttrName(Reporting::Attribute::Tax), "0").toUInt(); + d->m_investments = e.attribute(d->getAttrName(Reporting::Attribute::Investments), "0").toUInt(); + d->m_loans = e.attribute(d->getAttrName(Reporting::Attribute::Loans), "0").toUInt(); + d->m_hideTransactions = e.attribute(d->getAttrName(Reporting::Attribute::HideTransactions), "0").toUInt(); + d->m_showColumnTotals = e.attribute(d->getAttrName(Reporting::Attribute::ShowColumnTotals), "1").toUInt(); + d->m_detailLevel = kDetailLevelText.indexOf(e.attribute(d->getAttrName(Reporting::Attribute::Detail), "none")) == eDetailAll ? eDetailAll : eDetailNone; // read performance or capital gains tab - if (d->m_queryColumns & eQCperformance) - d->m_investmentSum = static_cast(e.attribute(d->getAttrName(Report::Attribute::InvestmentSum), QString().setNum(MyMoneyReport::eSumPeriod)).toInt()); + if (d->m_queryColumns & QueryColumns::Performance) + d->m_investmentSum = static_cast(e.attribute(d->getAttrName(Reporting::Attribute::InvestmentSum), QString().setNum(MyMoneyReport::eSumPeriod)).toInt()); // read capital gains tab - if (d->m_queryColumns & eQCcapitalgain) { - d->m_investmentSum = static_cast(e.attribute(d->getAttrName(Report::Attribute::InvestmentSum), QString().setNum(MyMoneyReport::eSumSold)).toInt()); + if (d->m_queryColumns & QueryColumns::Capitalgain) { + d->m_investmentSum = static_cast(e.attribute(d->getAttrName(Reporting::Attribute::InvestmentSum), QString().setNum(MyMoneyReport::eSumSold)).toInt()); if (d->m_investmentSum == MyMoneyReport::eSumSold) { - d->m_showSTLTCapitalGains = e.attribute(d->getAttrName(Report::Attribute::ShowSTLTCapitalGains), "0").toUInt(); - d->m_settlementPeriod = e.attribute(d->getAttrName(Report::Attribute::SettlementPeriod), "3").toUInt(); - d->m_tseparator = QDate::fromString(e.attribute(d->getAttrName(Report::Attribute::TermsSeparator), QDate::currentDate().addYears(-1).toString(Qt::ISODate)),Qt::ISODate); + d->m_showSTLTCapitalGains = e.attribute(d->getAttrName(Reporting::Attribute::ShowSTLTCapitalGains), "0").toUInt(); + d->m_settlementPeriod = e.attribute(d->getAttrName(Reporting::Attribute::SettlementPeriod), "3").toUInt(); + d->m_tseparator = QDate::fromString(e.attribute(d->getAttrName(Reporting::Attribute::TermsSeparator), QDate::currentDate().addYears(-1).toString(Qt::ISODate)),Qt::ISODate); } } - } else if (d->m_reportType == eInfoTable) { - if (e.hasAttribute(d->getAttrName(Report::Attribute::ShowRowTotals))) - d->m_showRowTotals = e.attribute(d->getAttrName(Report::Attribute::ShowRowTotals)).toUInt(); + } else if (d->m_reportType == Report::InfoTable) { + if (e.hasAttribute(d->getAttrName(Reporting::Attribute::ShowRowTotals))) + d->m_showRowTotals = e.attribute(d->getAttrName(Reporting::Attribute::ShowRowTotals)).toUInt(); else d->m_showRowTotals = true; } QDomNode child = e.firstChild(); while (!child.isNull() && child.isElement()) { QDomElement c = child.toElement(); - if (d->getElName(Report::Element::Text) == c.tagName() && c.hasAttribute(d->getAttrName(Report::Attribute::Pattern))) { - setTextFilter(QRegExp(c.attribute(d->getAttrName(Report::Attribute::Pattern)), - c.attribute(d->getAttrName(Report::Attribute::CaseSensitive), "1").toUInt() + if (d->getElName(Reporting::Element::Text) == c.tagName() && c.hasAttribute(d->getAttrName(Reporting::Attribute::Pattern))) { + setTextFilter(QRegExp(c.attribute(d->getAttrName(Reporting::Attribute::Pattern)), + c.attribute(d->getAttrName(Reporting::Attribute::CaseSensitive), "1").toUInt() ? Qt::CaseSensitive : Qt::CaseInsensitive, - c.attribute(d->getAttrName(Report::Attribute::RegEx), "1").toUInt() + c.attribute(d->getAttrName(Reporting::Attribute::RegEx), "1").toUInt() ? QRegExp::Wildcard : QRegExp::RegExp), - c.attribute(d->getAttrName(Report::Attribute::InvertText), "0").toUInt()); + c.attribute(d->getAttrName(Reporting::Attribute::InvertText), "0").toUInt()); } - if (d->getElName(Report::Element::Type) == c.tagName() && c.hasAttribute(d->getAttrName(Report::Attribute::Type))) { - i = kTypeText.indexOf(c.attribute(d->getAttrName(Report::Attribute::Type))); + if (d->getElName(Reporting::Element::Type) == c.tagName() && c.hasAttribute(d->getAttrName(Reporting::Attribute::Type))) { + i = kTypeText.indexOf(c.attribute(d->getAttrName(Reporting::Attribute::Type))); if (i != -1) addType(i); } - if (d->getElName(Report::Element::State) == c.tagName() && c.hasAttribute(d->getAttrName(Report::Attribute::State))) { - i = kStateText.indexOf(c.attribute(d->getAttrName(Report::Attribute::State))); + if (d->getElName(Reporting::Element::State) == c.tagName() && c.hasAttribute(d->getAttrName(Reporting::Attribute::State))) { + i = kStateText.indexOf(c.attribute(d->getAttrName(Reporting::Attribute::State))); if (i != -1) addState(i); } - if (d->getElName(Report::Element::Number) == c.tagName()) - setNumberFilter(c.attribute(d->getAttrName(Report::Attribute::From)), c.attribute(d->getAttrName(Report::Attribute::To))); - if (d->getElName(Report::Element::Amount) == c.tagName()) - setAmountFilter(MyMoneyMoney(c.attribute(d->getAttrName(Report::Attribute::From), "0/100")), MyMoneyMoney(c.attribute(d->getAttrName(Report::Attribute::To), "0/100"))); - if (d->getElName(Report::Element::Dates) == c.tagName()) { + if (d->getElName(Reporting::Element::Number) == c.tagName()) + setNumberFilter(c.attribute(d->getAttrName(Reporting::Attribute::From)), c.attribute(d->getAttrName(Reporting::Attribute::To))); + if (d->getElName(Reporting::Element::Amount) == c.tagName()) + setAmountFilter(MyMoneyMoney(c.attribute(d->getAttrName(Reporting::Attribute::From), "0/100")), MyMoneyMoney(c.attribute(d->getAttrName(Reporting::Attribute::To), "0/100"))); + if (d->getElName(Reporting::Element::Dates) == c.tagName()) { QDate from, to; - if (c.hasAttribute(d->getAttrName(Report::Attribute::From))) - from = QDate::fromString(c.attribute(d->getAttrName(Report::Attribute::From)), Qt::ISODate); - if (c.hasAttribute(d->getAttrName(Report::Attribute::To))) - to = QDate::fromString(c.attribute(d->getAttrName(Report::Attribute::To)), Qt::ISODate); + if (c.hasAttribute(d->getAttrName(Reporting::Attribute::From))) + from = QDate::fromString(c.attribute(d->getAttrName(Reporting::Attribute::From)), Qt::ISODate); + if (c.hasAttribute(d->getAttrName(Reporting::Attribute::To))) + to = QDate::fromString(c.attribute(d->getAttrName(Reporting::Attribute::To)), Qt::ISODate); MyMoneyTransactionFilter::setDateFilter(from, to); } - if (d->getElName(Report::Element::Payee) == c.tagName()) - addPayee(c.attribute(d->getAttrName(Report::Attribute::ID))); - if (d->getElName(Report::Element::Tag) == c.tagName()) - addTag(c.attribute(d->getAttrName(Report::Attribute::ID))); - if (d->getElName(Report::Element::Category) == c.tagName() && c.hasAttribute(d->getAttrName(Report::Attribute::ID))) - addCategory(c.attribute(d->getAttrName(Report::Attribute::ID))); - if (d->getElName(Report::Element::Account) == c.tagName() && c.hasAttribute(d->getAttrName(Report::Attribute::ID))) - addAccount(c.attribute(d->getAttrName(Report::Attribute::ID))); - if (d->getElName(Report::Element::AccountGroup) == c.tagName() && c.hasAttribute(d->getAttrName(Report::Attribute::Group))) { - i = kAccountTypeText.indexOf(c.attribute(d->getAttrName(Report::Attribute::Group))); + if (d->getElName(Reporting::Element::Payee) == c.tagName()) + addPayee(c.attribute(d->getAttrName(Reporting::Attribute::ID))); + if (d->getElName(Reporting::Element::Tag) == c.tagName()) + addTag(c.attribute(d->getAttrName(Reporting::Attribute::ID))); + if (d->getElName(Reporting::Element::Category) == c.tagName() && c.hasAttribute(d->getAttrName(Reporting::Attribute::ID))) + addCategory(c.attribute(d->getAttrName(Reporting::Attribute::ID))); + if (d->getElName(Reporting::Element::Account) == c.tagName() && c.hasAttribute(d->getAttrName(Reporting::Attribute::ID))) + addAccount(c.attribute(d->getAttrName(Reporting::Attribute::ID))); + if (d->getElName(Reporting::Element::AccountGroup) == c.tagName() && c.hasAttribute(d->getAttrName(Reporting::Attribute::Group))) { + i = kAccountTypeText.indexOf(c.attribute(d->getAttrName(Reporting::Attribute::Group))); if (i != -1) addAccountGroup(static_cast(i)); } @@ -1587,42 +1587,42 @@ m_lineWidth = width; } -QString MyMoneyReport::toString(ERowType type) +QString MyMoneyReport::toString(Row::Type type) { switch(type) { - case eNoRows : return "eNoRows"; - case eAssetLiability : return "eAssetLiability"; - case eExpenseIncome : return "eExpenseIncome"; - case eCategory : return "eCategory"; - case eTopCategory : return "eTopCategory"; - case eAccount : return "eAccount"; - case eTag : return "eTag"; - case ePayee : return "ePayee"; - case eMonth : return "eMonth"; - case eWeek : return "eWeek"; - case eTopAccount : return "eTopAccount"; - case eAccountByTopAccount: return "eAccountByTopAccount"; - case eEquityType : return "eEquityType"; - case eAccountType : return "eAccountType"; - case eInstitution : return "eInstitution"; - case eBudget : return "eBudget"; - case eBudgetActual : return "eBudgetActual"; - case eSchedule : return "eSchedule"; - case eAccountInfo : return "eAccountInfo"; - case eAccountLoanInfo : return "eAccountLoanInfo"; - case eAccountReconcile : return "eAccountReconcile"; - case eCashFlow : return "eCashFlow"; + case Row::NoRows : return "NoRows"; + case Row::AssetLiability : return "AssetLiability"; + case Row::ExpenseIncome : return "ExpenseIncome"; + case Row::Category : return "Category"; + case Row::TopCategory : return "TopCategory"; + case Row::Account : return "Account"; + case Row::Tag : return "Tag"; + case Row::Payee : return "Payee"; + case Row::Month : return "Month"; + case Row::Week : return "Week"; + case Row::TopAccount : return "TopAccount"; + case Row::AccountByTopAccount: return "AccountByTopAccount"; + case Row::EquityType : return "EquityType"; + case Row::AccountType : return "AccountType"; + case Row::Institution : return "Institution"; + case Row::Budget : return "Budget"; + case Row::BudgetActual : return "BudgetActual"; + case Row::Schedule : return "Schedule"; + case Row::AccountInfo : return "AccountInfo"; + case Row::AccountLoanInfo : return "AccountLoanInfo"; + case Row::AccountReconcile : return "AccountReconcile"; + case Row::CashFlow : return "CashFlow"; default : return "undefined"; } } -QString MyMoneyReport::toString(MyMoneyReport::EReportType type) +QString MyMoneyReport::toString(MyMoneyReport::Report::Type type) { switch(type) { - case eNoReport: return "eNoReport"; - case ePivotTable: return "ePivotTable"; - case eQueryTable: return "eQueryTable"; - case eInfoTable: return "eInfoTable"; + case Report::NoReport: return "NoReport"; + case Report::PivotTable: return "PivotTable"; + case Report::QueryTable: return "QueryTable"; + case Report::InfoTable: return "InfoTable"; default: return "undefined"; } } diff --git a/kmymoney/mymoney/mymoneyreport_p.h b/kmymoney/mymoney/mymoneyreport_p.h --- a/kmymoney/mymoney/mymoneyreport_p.h +++ b/kmymoney/mymoney/mymoneyreport_p.h @@ -40,7 +40,7 @@ using namespace eMyMoney; -namespace Report +namespace Reporting { enum class Element { Payee, Tag, @@ -84,82 +84,82 @@ { public: - static QString getElName(const Report::Element el) + static QString getElName(const Reporting::Element el) { - static const QHash elNames { - {Report::Element::Payee, QStringLiteral("PAYEE")}, - {Report::Element::Tag, QStringLiteral("TAG")}, - {Report::Element::Account, QStringLiteral("ACCOUNT")}, - {Report::Element::Text, QStringLiteral("TEXT")}, - {Report::Element::Type, QStringLiteral("TYPE")}, - {Report::Element::State, QStringLiteral("STATE")}, - {Report::Element::Number, QStringLiteral("NUMBER")}, - {Report::Element::Amount, QStringLiteral("AMOUNT")}, - {Report::Element::Dates, QStringLiteral("DATES")}, - {Report::Element::Category, QStringLiteral("CATEGORY")}, - {Report::Element::AccountGroup, QStringLiteral("ACCOUNTGROUP")} + static const QHash elNames { + {Reporting::Element::Payee, QStringLiteral("PAYEE")}, + {Reporting::Element::Tag, QStringLiteral("TAG")}, + {Reporting::Element::Account, QStringLiteral("ACCOUNT")}, + {Reporting::Element::Text, QStringLiteral("TEXT")}, + {Reporting::Element::Type, QStringLiteral("TYPE")}, + {Reporting::Element::State, QStringLiteral("STATE")}, + {Reporting::Element::Number, QStringLiteral("NUMBER")}, + {Reporting::Element::Amount, QStringLiteral("AMOUNT")}, + {Reporting::Element::Dates, QStringLiteral("DATES")}, + {Reporting::Element::Category, QStringLiteral("CATEGORY")}, + {Reporting::Element::AccountGroup, QStringLiteral("ACCOUNTGROUP")} }; return elNames[el]; } - static QString getAttrName(const Report::Attribute attr) + static QString getAttrName(const Reporting::Attribute attr) { - static const QHash attrNames { - {Report::Attribute::ID, QStringLiteral("id")}, - {Report::Attribute::Group, QStringLiteral("group")}, - {Report::Attribute::Type, QStringLiteral("type")}, - {Report::Attribute::Name, QStringLiteral("name")}, - {Report::Attribute::Comment, QStringLiteral("comment")}, - {Report::Attribute::ConvertCurrency, QStringLiteral("convertcurrency")}, - {Report::Attribute::Favorite, QStringLiteral("favorite")}, - {Report::Attribute::SkipZero, QStringLiteral("skipZero")}, - {Report::Attribute::DateLock, QStringLiteral("datelock")}, - {Report::Attribute::DataLock, QStringLiteral("datalock")}, - {Report::Attribute::MovingAverageDays, QStringLiteral("movingaveragedays")}, - {Report::Attribute::IncludesActuals, QStringLiteral("includesactuals")}, - {Report::Attribute::IncludesForecast, QStringLiteral("includesforecast")}, - {Report::Attribute::IncludesPrice, QStringLiteral("includesprice")}, - {Report::Attribute::IncludesAveragePrice, QStringLiteral("includesaverageprice")}, - {Report::Attribute::IncludesMovingAverage, QStringLiteral("includesmovingaverage")}, - {Report::Attribute::IncludesSchedules, QStringLiteral("includeschedules")}, - {Report::Attribute::IncludesTransfers, QStringLiteral("includestransfers")}, - {Report::Attribute::IncludesUnused, QStringLiteral("includeunused")}, - {Report::Attribute::MixedTime, QStringLiteral("mixedtime")}, - {Report::Attribute::Investments, QStringLiteral("investments")}, - {Report::Attribute::Budget, QStringLiteral("budget")}, - {Report::Attribute::ShowRowTotals, QStringLiteral("showrowtotals")}, - {Report::Attribute::ShowColumnTotals, QStringLiteral("showcolumntotals")}, - {Report::Attribute::Detail, QStringLiteral("detail")}, - {Report::Attribute::ColumnsAreDays, QStringLiteral("columnsaredays")}, - {Report::Attribute::ChartType, QStringLiteral("charttype")}, - {Report::Attribute::ChartCHGridLines, QStringLiteral("chartchgridlines")}, - {Report::Attribute::ChartSVGridLines, QStringLiteral("chartsvgridlines")}, - {Report::Attribute::ChartDataLabels, QStringLiteral("chartdatalabels")}, - {Report::Attribute::ChartByDefault, QStringLiteral("chartbydefault")}, - {Report::Attribute::LogYAxis, QStringLiteral("logYaxis")}, - {Report::Attribute::ChartLineWidth, QStringLiteral("chartlinewidth")}, - {Report::Attribute::ColumnType, QStringLiteral("columntype")}, - {Report::Attribute::RowType, QStringLiteral("rowtype")}, - {Report::Attribute::DataRangeStart, QStringLiteral("dataRangeStart")}, - {Report::Attribute::DataRangeEnd, QStringLiteral("dataRangeEnd")}, - {Report::Attribute::DataMajorTick, QStringLiteral("dataMajorTick")}, - {Report::Attribute::DataMinorTick, QStringLiteral("dataMinorTick")}, - {Report::Attribute::YLabelsPrecision, QStringLiteral("yLabelsPrecision")}, - {Report::Attribute::QueryColumns, QStringLiteral("querycolumns")}, - {Report::Attribute::Tax, QStringLiteral("tax")}, - {Report::Attribute::Loans, QStringLiteral("loans")}, - {Report::Attribute::HideTransactions, QStringLiteral("hidetransactions")}, - {Report::Attribute::InvestmentSum, QStringLiteral("investmentsum")}, - {Report::Attribute::SettlementPeriod, QStringLiteral("settlementperiod")}, - {Report::Attribute::ShowSTLTCapitalGains, QStringLiteral("showSTLTCapitalGains")}, - {Report::Attribute::TermsSeparator, QStringLiteral("tseparator")}, - {Report::Attribute::Pattern, QStringLiteral("pattern")}, - {Report::Attribute::CaseSensitive, QStringLiteral("casesensitive")}, - {Report::Attribute::RegEx, QStringLiteral("regex")}, - {Report::Attribute::InvertText, QStringLiteral("inverttext")}, - {Report::Attribute::State, QStringLiteral("state")}, - {Report::Attribute::From, QStringLiteral("from")}, - {Report::Attribute::To, QStringLiteral("to")} + static const QHash attrNames { + {Reporting::Attribute::ID, QStringLiteral("id")}, + {Reporting::Attribute::Group, QStringLiteral("group")}, + {Reporting::Attribute::Type, QStringLiteral("type")}, + {Reporting::Attribute::Name, QStringLiteral("name")}, + {Reporting::Attribute::Comment, QStringLiteral("comment")}, + {Reporting::Attribute::ConvertCurrency, QStringLiteral("convertcurrency")}, + {Reporting::Attribute::Favorite, QStringLiteral("favorite")}, + {Reporting::Attribute::SkipZero, QStringLiteral("skipZero")}, + {Reporting::Attribute::DateLock, QStringLiteral("datelock")}, + {Reporting::Attribute::DataLock, QStringLiteral("datalock")}, + {Reporting::Attribute::MovingAverageDays, QStringLiteral("movingaveragedays")}, + {Reporting::Attribute::IncludesActuals, QStringLiteral("includesactuals")}, + {Reporting::Attribute::IncludesForecast, QStringLiteral("includesforecast")}, + {Reporting::Attribute::IncludesPrice, QStringLiteral("includesprice")}, + {Reporting::Attribute::IncludesAveragePrice, QStringLiteral("includesaverageprice")}, + {Reporting::Attribute::IncludesMovingAverage, QStringLiteral("includesmovingaverage")}, + {Reporting::Attribute::IncludesSchedules, QStringLiteral("includeschedules")}, + {Reporting::Attribute::IncludesTransfers, QStringLiteral("includestransfers")}, + {Reporting::Attribute::IncludesUnused, QStringLiteral("includeunused")}, + {Reporting::Attribute::MixedTime, QStringLiteral("mixedtime")}, + {Reporting::Attribute::Investments, QStringLiteral("investments")}, + {Reporting::Attribute::Budget, QStringLiteral("budget")}, + {Reporting::Attribute::ShowRowTotals, QStringLiteral("showrowtotals")}, + {Reporting::Attribute::ShowColumnTotals, QStringLiteral("showcolumntotals")}, + {Reporting::Attribute::Detail, QStringLiteral("detail")}, + {Reporting::Attribute::ColumnsAreDays, QStringLiteral("columnsaredays")}, + {Reporting::Attribute::ChartType, QStringLiteral("charttype")}, + {Reporting::Attribute::ChartCHGridLines, QStringLiteral("chartchgridlines")}, + {Reporting::Attribute::ChartSVGridLines, QStringLiteral("chartsvgridlines")}, + {Reporting::Attribute::ChartDataLabels, QStringLiteral("chartdatalabels")}, + {Reporting::Attribute::ChartByDefault, QStringLiteral("chartbydefault")}, + {Reporting::Attribute::LogYAxis, QStringLiteral("logYaxis")}, + {Reporting::Attribute::ChartLineWidth, QStringLiteral("chartlinewidth")}, + {Reporting::Attribute::ColumnType, QStringLiteral("columntype")}, + {Reporting::Attribute::RowType, QStringLiteral("rowtype")}, + {Reporting::Attribute::DataRangeStart, QStringLiteral("dataRangeStart")}, + {Reporting::Attribute::DataRangeEnd, QStringLiteral("dataRangeEnd")}, + {Reporting::Attribute::DataMajorTick, QStringLiteral("dataMajorTick")}, + {Reporting::Attribute::DataMinorTick, QStringLiteral("dataMinorTick")}, + {Reporting::Attribute::YLabelsPrecision, QStringLiteral("yLabelsPrecision")}, + {Reporting::Attribute::QueryColumns, QStringLiteral("querycolumns")}, + {Reporting::Attribute::Tax, QStringLiteral("tax")}, + {Reporting::Attribute::Loans, QStringLiteral("loans")}, + {Reporting::Attribute::HideTransactions, QStringLiteral("hidetransactions")}, + {Reporting::Attribute::InvestmentSum, QStringLiteral("investmentsum")}, + {Reporting::Attribute::SettlementPeriod, QStringLiteral("settlementperiod")}, + {Reporting::Attribute::ShowSTLTCapitalGains, QStringLiteral("showSTLTCapitalGains")}, + {Reporting::Attribute::TermsSeparator, QStringLiteral("tseparator")}, + {Reporting::Attribute::Pattern, QStringLiteral("pattern")}, + {Reporting::Attribute::CaseSensitive, QStringLiteral("casesensitive")}, + {Reporting::Attribute::RegEx, QStringLiteral("regex")}, + {Reporting::Attribute::InvertText, QStringLiteral("inverttext")}, + {Reporting::Attribute::State, QStringLiteral("state")}, + {Reporting::Attribute::From, QStringLiteral("from")}, + {Reporting::Attribute::To, QStringLiteral("to")} }; return attrNames[attr]; } @@ -217,18 +217,18 @@ /** * What sort of algorithm should be used to run the report */ - MyMoneyReport::EReportType m_reportType; + MyMoneyReport::Report::Type m_reportType; /** * What sort of values should show up on the ROWS of this report */ - MyMoneyReport::ERowType m_rowType; + MyMoneyReport::Row::Type m_rowType; /** * What sort of values should show up on the COLUMNS of this report, * in the case of a 'PivotTable' report. Really this is used more as a * QUANTITY of months or days. Whether it's months or days is determined * by m_columnsAreDays. */ - MyMoneyReport::EColumnType m_columnType; + MyMoneyReport::Column::Type m_columnType; /** * Whether the base unit of columns of this report is days. Only applies to * 'PivotTable' reports. If false, then columns are months or multiples thereof. @@ -238,7 +238,7 @@ * What sort of values should show up on the COLUMNS of this report, * in the case of a 'QueryTable' report */ - MyMoneyReport::EQueryColumns m_queryColumns; + MyMoneyReport::QueryColumns::Type m_queryColumns; /** * The plain-language description of what the date range should be locked diff --git a/kmymoney/mymoney/tests/mymoneyreport-test.cpp b/kmymoney/mymoney/tests/mymoneyreport-test.cpp --- a/kmymoney/mymoney/tests/mymoneyreport-test.cpp +++ b/kmymoney/mymoney/tests/mymoneyreport-test.cpp @@ -36,18 +36,18 @@ void MyMoneyReportTest::testElementNames() { - for (auto i = (int)Report::Element::Payee; i <= (int)Report::Element::AccountGroup; ++i) { - auto isEmpty = MyMoneyReportPrivate::getElName(static_cast(i)).isEmpty(); + for (auto i = (int)Reporting::Element::Payee; i <= (int)Reporting::Element::AccountGroup; ++i) { + auto isEmpty = MyMoneyReportPrivate::getElName(static_cast(i)).isEmpty(); if (isEmpty) qWarning() << "Empty element's name " << i; QVERIFY(!isEmpty); } } void MyMoneyReportTest::testAttributeNames() { - for (auto i = (int)Report::Attribute::ID; i < (int)Report::Attribute::LastAttribute; ++i) { - auto isEmpty = MyMoneyReportPrivate::getAttrName(static_cast(i)).isEmpty(); + for (auto i = (int)Reporting::Attribute::ID; i < (int)Reporting::Attribute::LastAttribute; ++i) { + auto isEmpty = MyMoneyReportPrivate::getAttrName(static_cast(i)).isEmpty(); if (isEmpty) qWarning() << "Empty attribute's name " << i; QVERIFY(!isEmpty); diff --git a/kmymoney/reports/listtable.cpp b/kmymoney/reports/listtable.cpp --- a/kmymoney/reports/listtable.cpp +++ b/kmymoney/reports/listtable.cpp @@ -206,7 +206,7 @@ result.append(QString::fromLatin1("").arg(row_odd ? QLatin1Char('1') : QLatin1Char('0'))); } else if (rowRank == 4 || rowRank == 5) { QList::const_iterator nextRow = std::next(it_row); - 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 + if ((m_config.rowType() == MyMoneyReport::Row::Tag)) { //If we order by Tags don't show the Grand total as we can have multiple tags per transaction continue; } else if (rowRank == 4) { if (nextRow != m_rows.end()) { diff --git a/kmymoney/reports/objectinfotable.cpp b/kmymoney/reports/objectinfotable.cpp --- a/kmymoney/reports/objectinfotable.cpp +++ b/kmymoney/reports/objectinfotable.cpp @@ -82,15 +82,15 @@ m_group.clear(); m_subtotal.clear(); switch (m_config.rowType()) { - case MyMoneyReport::eSchedule: + case MyMoneyReport::Row::Schedule: constructScheduleTable(); m_columns << ctNextDueDate << ctName; break; - case MyMoneyReport::eAccountInfo: + case MyMoneyReport::Row::AccountInfo: constructAccountTable(); m_columns << ctInstitution << ctType << ctName; break; - case MyMoneyReport::eAccountLoanInfo: + case MyMoneyReport::Row::AccountLoanInfo: constructAccountLoanTable(); m_columns << ctInstitution << ctType << ctName; break; @@ -102,12 +102,12 @@ m_subtotal << ctValue; switch (m_config.rowType()) { - case MyMoneyReport::eSchedule: + case MyMoneyReport::Row::Schedule: m_group << ctType; m_subtotal << ctValue; break; - case MyMoneyReport::eAccountInfo: - case MyMoneyReport::eAccountLoanInfo: + case MyMoneyReport::Row::AccountInfo: + case MyMoneyReport::Row::AccountLoanInfo: m_group << ctTopCategory << ctInstitution; m_subtotal << ctCurrentBalance; break; @@ -118,22 +118,22 @@ QVector sort = QVector::fromList(m_group) << QVector::fromList(m_columns) << ctID << ctRank; switch (m_config.rowType()) { - case MyMoneyReport::eSchedule: + case MyMoneyReport::Row::Schedule: if (m_config.detailLevel() == MyMoneyReport::eDetailAll) { m_columns << ctName << ctPayee << ctPaymentType << ctOccurrence << ctNextDueDate << ctCategory; } else { m_columns << ctName << ctPayee << ctPaymentType << ctOccurrence << ctNextDueDate; } break; - case MyMoneyReport::eAccountInfo: + case MyMoneyReport::Row::AccountInfo: m_columns << ctType << ctName << ctNumber << ctDescription << ctOpeningDate << ctCurrencyName << ctBalanceWarning << ctCreditWarning << ctMaxCreditLimit << ctTax << ctFavorite; break; - case MyMoneyReport::eAccountLoanInfo: + case MyMoneyReport::Row::AccountLoanInfo: m_columns << ctType << ctName << ctNumber << ctDescription << ctOpeningDate << ctCurrencyName << ctPayee << ctLoanAmount << ctInterestRate << ctNextInterestChange diff --git a/kmymoney/reports/pivottable.cpp b/kmymoney/reports/pivottable.cpp --- a/kmymoney/reports/pivottable.cpp +++ b/kmymoney/reports/pivottable.cpp @@ -136,7 +136,7 @@ // // Initialize outer groups of the grid // - if (m_config.rowType() == MyMoneyReport::eAssetLiability) { + if (m_config.rowType() == MyMoneyReport::Row::AssetLiability) { m_grid.insert(MyMoneyAccount::accountTypeToString(eMyMoney::Account::Type::Asset), PivotOuterGroup(m_numColumns)); m_grid.insert(MyMoneyAccount::accountTypeToString(eMyMoney::Account::Type::Liability), PivotOuterGroup(m_numColumns, PivotOuterGroup::m_kDefaultSortOrder, true /* inverted */)); } else { @@ -252,7 +252,7 @@ // whether asset & liability transactions are actually to be considered // transfers - bool al_transfers = (m_config.rowType() == MyMoneyReport::eExpenseIncome) && (m_config.isIncludingTransfers()); + bool al_transfers = (m_config.rowType() == MyMoneyReport::Row::ExpenseIncome) && (m_config.isIncludingTransfers()); //this is to store balance for loan accounts when not included in the report QMap loanBalances; @@ -919,10 +919,10 @@ case MyMoneyBudget::AccountGroup::eMonthly: // place the single monthly value in each column of the report // only add the value if columns are monthly or longer - if (m_config.columnType() == MyMoneyReport::eBiMonths - || m_config.columnType() == MyMoneyReport::eMonths - || m_config.columnType() == MyMoneyReport::eYears - || m_config.columnType() == MyMoneyReport::eQuarters) { + if (m_config.columnType() == MyMoneyReport::Column::BiMonths + || m_config.columnType() == MyMoneyReport::Column::Months + || m_config.columnType() == MyMoneyReport::Column::Years + || m_config.columnType() == MyMoneyReport::Column::Quarters) { QDate budgetDate = budget.budgetStart(); while (column < m_numColumns && budget.budgetStart().addYears(1) > budgetDate) { //only show budget values if the budget year and the column date match @@ -950,10 +950,10 @@ ++column; } else { switch (m_config.columnType()) { - case MyMoneyReport::eYears: - case MyMoneyReport::eBiMonths: - case MyMoneyReport::eQuarters: - case MyMoneyReport::eMonths: { + case MyMoneyReport::Column::Years: + case MyMoneyReport::Column::BiMonths: + case MyMoneyReport::Column::Quarters: + case MyMoneyReport::Column::Months: { if ((*it_period).startDate() >= m_beginDate.addDays(-m_beginDate.day() + 1) && (*it_period).startDate() <= m_endDate.addDays(m_endDate.daysInMonth() - m_endDate.day()) && (*it_period).startDate() > (columnDate(column).addMonths(-m_config.columnType()))) { @@ -1171,7 +1171,7 @@ // Outer Row Group Totals // - const bool isIncomeExpense = (m_config.rowType() == MyMoneyReport::eExpenseIncome); + const bool isIncomeExpense = (m_config.rowType() == MyMoneyReport::Row::ExpenseIncome); const bool invert_total = (*it_outergroup).m_inverted; auto column = 0; while (column < m_numColumns) { @@ -2022,7 +2022,7 @@ } //run forecast - if (m_config.rowType() == MyMoneyReport::eAssetLiability) { //asset and liability + if (m_config.rowType() == MyMoneyReport::Row::AssetLiability) { //asset and liability forecast.doForecast(); } else { //income and expenses MyMoneyBudget budget; @@ -2129,7 +2129,7 @@ int column = m_startColumn; //check whether columns are days or months - if (m_config.columnType() == MyMoneyReport::eDays) { + if (m_config.columnType() == MyMoneyReport::Column::Days) { while (column < m_numColumns) { MyMoneyMoney totalPrice = MyMoneyMoney(); @@ -2160,23 +2160,23 @@ //set the right start date depending on the column type switch (m_config.columnType()) { - case MyMoneyReport::eYears: { + case MyMoneyReport::Column::Years: { averageStart = QDate(columnDate(column).year(), 1, 1); break; } - case MyMoneyReport::eBiMonths: { + case MyMoneyReport::Column::BiMonths: { averageStart = QDate(columnDate(column).year(), columnDate(column).month(), 1).addMonths(-1); break; } - case MyMoneyReport::eQuarters: { + case MyMoneyReport::Column::Quarters: { averageStart = QDate(columnDate(column).year(), columnDate(column).month(), 1).addMonths(-1); break; } - case MyMoneyReport::eMonths: { + case MyMoneyReport::Column::Months: { averageStart = QDate(columnDate(column).year(), columnDate(column).month(), 1); break; } - case MyMoneyReport::eWeeks: { + case MyMoneyReport::Column::Weeks: { averageStart = columnDate(column).addDays(-columnDate(column).dayOfWeek() + 1); break; } diff --git a/kmymoney/reports/querytable.cpp b/kmymoney/reports/querytable.cpp --- a/kmymoney/reports/querytable.cpp +++ b/kmymoney/reports/querytable.cpp @@ -269,27 +269,27 @@ m_subtotal.clear(); m_postcolumns.clear(); switch (m_config.rowType()) { - case MyMoneyReport::eAccountByTopAccount: - case MyMoneyReport::eEquityType: - case MyMoneyReport::eAccountType: - case MyMoneyReport::eInstitution: + case MyMoneyReport::Row::AccountByTopAccount: + case MyMoneyReport::Row::EquityType: + case MyMoneyReport::Row::AccountType: + case MyMoneyReport::Row::Institution: constructAccountTable(); m_columns << ctAccount; break; - case MyMoneyReport::eAccount: + case MyMoneyReport::Row::Account: constructTransactionTable(); m_columns << ctAccountID << ctPostDate; break; - case MyMoneyReport::ePayee: - case MyMoneyReport::eTag: - case MyMoneyReport::eMonth: - case MyMoneyReport::eWeek: + case MyMoneyReport::Row::Payee: + case MyMoneyReport::Row::Tag: + case MyMoneyReport::Row::Month: + case MyMoneyReport::Row::Week: constructTransactionTable(); m_columns << ctPostDate << ctAccount; break; - case MyMoneyReport::eCashFlow: + case MyMoneyReport::Row::CashFlow: constructSplitsTable(); m_columns << ctPostDate; break; @@ -302,46 +302,46 @@ m_subtotal << ctValue; switch (m_config.rowType()) { - case MyMoneyReport::eCashFlow: + case MyMoneyReport::Row::CashFlow: m_group << ctCategoryType << ctTopCategory << ctCategory; break; - case MyMoneyReport::eCategory: + case MyMoneyReport::Row::Category: m_group << ctCategoryType << ctTopCategory << ctCategory; break; - case MyMoneyReport::eTopCategory: + case MyMoneyReport::Row::TopCategory: m_group << ctCategoryType << ctTopCategory; break; - case MyMoneyReport::eTopAccount: + case MyMoneyReport::Row::TopAccount: m_group << ctTopAccount << ctAccount; break; - case MyMoneyReport::eAccount: + case MyMoneyReport::Row::Account: m_group << ctAccount; break; - case MyMoneyReport::eAccountReconcile: + case MyMoneyReport::Row::AccountReconcile: m_group << ctAccount << ctReconcileFlag; break; - case MyMoneyReport::ePayee: + case MyMoneyReport::Row::Payee: m_group << ctPayee; break; - case MyMoneyReport::eTag: + case MyMoneyReport::Row::Tag: m_group << ctTag; break; - case MyMoneyReport::eMonth: + case MyMoneyReport::Row::Month: m_group << ctMonth; break; - case MyMoneyReport::eWeek: + case MyMoneyReport::Row::Week: m_group << ctWeek; break; - case MyMoneyReport::eAccountByTopAccount: + case MyMoneyReport::Row::AccountByTopAccount: m_group << ctTopAccount; break; - case MyMoneyReport::eEquityType: + case MyMoneyReport::Row::EquityType: m_group << ctEquityType; break; - case MyMoneyReport::eAccountType: + case MyMoneyReport::Row::AccountType: m_group << ctType; break; - case MyMoneyReport::eInstitution: + case MyMoneyReport::Row::Institution: m_group << ctInstitution << ctTopAccount; break; default: @@ -352,10 +352,10 @@ m_columns.clear(); switch (m_config.rowType()) { - case MyMoneyReport::eAccountByTopAccount: - case MyMoneyReport::eEquityType: - case MyMoneyReport::eAccountType: - case MyMoneyReport::eInstitution: + case MyMoneyReport::Row::AccountByTopAccount: + case MyMoneyReport::Row::EquityType: + case MyMoneyReport::Row::AccountType: + case MyMoneyReport::Row::Institution: m_columns << ctAccount; break; @@ -365,27 +365,27 @@ unsigned qc = m_config.queryColumns(); - if (qc & MyMoneyReport::eQCnumber) + if (qc & MyMoneyReport::QueryColumns::Number) m_columns << ctNumber; - if (qc & MyMoneyReport::eQCpayee) + if (qc & MyMoneyReport::QueryColumns::Payee) m_columns << ctPayee; - if (qc & MyMoneyReport::eQCtag) + if (qc & MyMoneyReport::QueryColumns::Tag) m_columns << ctTag; - if (qc & MyMoneyReport::eQCcategory) + if (qc & MyMoneyReport::QueryColumns::Category) m_columns << ctCategory; - if (qc & MyMoneyReport::eQCaccount) + if (qc & MyMoneyReport::QueryColumns::Account) m_columns << ctAccount; - if (qc & MyMoneyReport::eQCreconciled) + if (qc & MyMoneyReport::QueryColumns::Reconciled) m_columns << ctReconcileFlag; - if (qc & MyMoneyReport::eQCmemo) + if (qc & MyMoneyReport::QueryColumns::Memo) m_columns << ctMemo; - if (qc & MyMoneyReport::eQCaction) + if (qc & MyMoneyReport::QueryColumns::Action) m_columns << ctAction; - if (qc & MyMoneyReport::eQCshares) + if (qc & MyMoneyReport::QueryColumns::Shares) m_columns << ctShares; - if (qc & MyMoneyReport::eQCprice) + if (qc & MyMoneyReport::QueryColumns::Price) m_columns << ctPrice; - if (qc & MyMoneyReport::eQCperformance) { + if (qc & MyMoneyReport::QueryColumns::Performance) { m_subtotal.clear(); switch (m_config.investmentSum()) { case MyMoneyReport::eSumOwnedAndSold: @@ -417,7 +417,7 @@ break; } } - if (qc & MyMoneyReport::eQCcapitalgain) { + if (qc & MyMoneyReport::QueryColumns::Capitalgain) { m_subtotal.clear(); switch (m_config.investmentSum()) { case MyMoneyReport::eSumOwned: @@ -441,11 +441,11 @@ break; } } - if (qc & MyMoneyReport::eQCloan) { + if (qc & MyMoneyReport::QueryColumns::Loan) { m_columns << ctPayment << ctInterest << ctFees; m_postcolumns << ctBalance; } - if (qc & MyMoneyReport::eQCbalance) + if (qc & MyMoneyReport::QueryColumns::Balance) m_postcolumns << ctBalance; TableRow::setSortCriteria(sort); @@ -659,18 +659,18 @@ bool tag_special_case = false; switch (m_config.rowType()) { - case MyMoneyReport::eCategory: - case MyMoneyReport::eTopCategory: + case MyMoneyReport::Row::Category: + case MyMoneyReport::Row::TopCategory: use_summary = false; use_transfers = false; hide_details = false; break; - case MyMoneyReport::ePayee: + case MyMoneyReport::Row::Payee: use_summary = false; use_transfers = false; hide_details = (m_config.detailLevel() == MyMoneyReport::eDetailNone); break; - case MyMoneyReport::eTag: + case MyMoneyReport::Row::Tag: use_summary = false; use_transfers = false; hide_details = (m_config.detailLevel() == MyMoneyReport::eDetailNone); @@ -762,7 +762,7 @@ // split entries (qS) normally. bool loan_special_case = false; - if (m_config.queryColumns() & MyMoneyReport::eQCloan) { + if (m_config.queryColumns() & MyMoneyReport::QueryColumns::Loan) { ReportAccount splitAcc((*it_split).accountId()); loan_special_case = splitAcc.isLoan(); } @@ -1004,8 +1004,8 @@ //this applies when the transaction has only 2 splits, or each split is going to be //shown separately, eg. transactions by category switch (m_config.rowType()) { - case MyMoneyReport::eCategory: - case MyMoneyReport::eTopCategory: + case MyMoneyReport::Row::Category: + case MyMoneyReport::Row::TopCategory: if (splitAcc.isIncomeExpense()) qA[ctValue] = (-(*it_split).shares() * xr).convert(fraction).toString(); // needed for category reports, in case of multicurrency transaction it breaks it break; @@ -1142,15 +1142,15 @@ // now run through our accts list and add opening and closing balances switch (m_config.rowType()) { - case MyMoneyReport::eAccount: - case MyMoneyReport::eTopAccount: + case MyMoneyReport::Row::Account: + case MyMoneyReport::Row::TopAccount: break; - // case MyMoneyReport::eCategory: - // case MyMoneyReport::eTopCategory: - // case MyMoneyReport::ePayee: - // case MyMoneyReport::eMonth: - // case MyMoneyReport::eWeek: + // case MyMoneyReport::Row::Category: + // case MyMoneyReport::Row::TopCategory: + // case MyMoneyReport::Row::Payee: + // case MyMoneyReport::Row::Month: + // case MyMoneyReport::Row::Week: default: return; } @@ -1288,7 +1288,7 @@ newStartingDate = startingDate; newEndingDate = endingDate; - if (report.queryColumns() & MyMoneyReport::eQCcapitalgain) { + if (report.queryColumns() & MyMoneyReport::QueryColumns::Capitalgain) { // Saturday and Sunday aren't valid settlement dates if (endingDate.dayOfWeek() == Qt::Saturday) endingDate = endingDate.addDays(-1); @@ -1708,7 +1708,7 @@ TableRow qaccountrow; CashFlowList accountCashflow; // for total calculation switch(m_config.queryColumns()) { - case MyMoneyReport::eQCperformance: + case MyMoneyReport::QueryColumns::Performance: { constructPerformanceRow(account, qaccountrow, accountCashflow); if (!qaccountrow.isEmpty()) { @@ -1728,7 +1728,7 @@ } break; } - case MyMoneyReport::eQCcapitalgain: + case MyMoneyReport::QueryColumns::Capitalgain: constructCapitalGainRow(account, qaccountrow); break; default: @@ -1780,7 +1780,7 @@ } } - if (m_config.queryColumns() == MyMoneyReport::eQCperformance && m_config.isShowingColumnTotals()) { + if (m_config.queryColumns() == MyMoneyReport::QueryColumns::Performance && m_config.isShowingColumnTotals()) { TableRow qtotalsrow; qtotalsrow[ctRank] = QLatin1Char('4'); // add identification of row as total QMap currencyGrandCashFlow; @@ -1891,7 +1891,7 @@ // reference (loan) account (qA). however, we process the matching // split entries (qS) normally. bool loan_special_case = false; - if (m_config.queryColumns() & MyMoneyReport::eQCloan) { + if (m_config.queryColumns() & MyMoneyReport::QueryColumns::Loan) { ReportAccount splitAcc((*it_split).accountId()); loan_special_case = splitAcc.isLoan(); } @@ -2064,15 +2064,15 @@ // now run through our accts list and add opening and closing balances switch (m_config.rowType()) { - case MyMoneyReport::eAccount: - case MyMoneyReport::eTopAccount: + case MyMoneyReport::Row::Account: + case MyMoneyReport::Row::TopAccount: break; - // case MyMoneyReport::eCategory: - // case MyMoneyReport::eTopCategory: - // case MyMoneyReport::ePayee: - // case MyMoneyReport::eMonth: - // case MyMoneyReport::eWeek: + // case MyMoneyReport::Row::Category: + // case MyMoneyReport::Row::TopCategory: + // case MyMoneyReport::Row::Payee: + // case MyMoneyReport::Row::Month: + // case MyMoneyReport::Row::Week: default: return; } diff --git a/kmymoney/reports/tests/pivottable-test.cpp b/kmymoney/reports/tests/pivottable-test.cpp --- a/kmymoney/reports/tests/pivottable-test.cpp +++ b/kmymoney/reports/tests/pivottable-test.cpp @@ -99,7 +99,7 @@ { try { MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 1, 1), QDate(2004, 7, 1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); @@ -124,7 +124,7 @@ // that it calculates the totals correctly. MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); @@ -140,7 +140,7 @@ // the period of the report. MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2005, 8, 1), QDate(2005, 12, 31)); filter.setName("Net Worth Opening Prior 1"); XMLandback(filter); @@ -177,7 +177,7 @@ // so the report should be zero. MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 1, 1), QDate(2004, 2, 1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); @@ -207,7 +207,7 @@ TransactionHelper t13(QDate(2017, 7, 1), MyMoneySplit::ActionDeposit, MyMoneyMoney(-100000), acBasicAccount, ctBasicIncome); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2016, 1, 1), QDate(2017, 12, 31)); filter.addAccount(acBasicAccount); XMLandback(filter); @@ -234,7 +234,7 @@ // test a spending report with no entries MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); XMLandback(filter); PivotTable spending_f1(filter); QVERIFY(spending_f1.m_grid.m_total[eActual].m_total == moZero); @@ -250,7 +250,7 @@ TransactionHelper t(QDate(2004, 10, 31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); filter.setName("Spending with Single Transaction.html"); XMLandback(filter); @@ -264,7 +264,7 @@ QVERIFY(spending_f.m_grid.m_total[eActual].m_total == (-moSolo)); filter.clearTransactionFilter(); - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); @@ -280,7 +280,7 @@ TransactionHelper t3(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); filter.setDetailLevel(MyMoneyReport::eDetailAll); filter.setName("Spending with Sub-Account"); @@ -297,7 +297,7 @@ QVERIFY(spending_f.m_grid.m_total[eActual].m_total == (-moParent - moChild)); filter.clearTransactionFilter(); - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); filter.setName("Net Worth with Sub-Account"); XMLandback(filter); @@ -316,7 +316,7 @@ TransactionHelper t3(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); filter.addCategory(acChild); filter.addCategory(acSolo); @@ -337,7 +337,7 @@ TransactionHelper t3(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); filter.addAccount(acChecking); filter.addCategory(acChild); @@ -355,7 +355,7 @@ TransactionHelper t3(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); filter.addAccount(acChecking); QVERIFY(file->transactionList(filter).count() == 1); @@ -377,7 +377,7 @@ TransactionHelper t3(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); filter.addAccount(acCredit); filter.addCategory(acChild); @@ -463,7 +463,7 @@ #endif MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); filter.setDetailLevel(MyMoneyReport::eDetailAll); filter.setConvertCurrency(true); @@ -504,7 +504,7 @@ filter.setConvertCurrency(true); filter.clearTransactionFilter(); filter.setName("Multiple currency net worth"); - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); @@ -544,7 +544,7 @@ TransactionHelper t2(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); filter.setAmountFilter(moChild, moChild); XMLandback(filter); @@ -560,7 +560,7 @@ TransactionHelper t4(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, QString(), "Thomas Baumgart"); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); filter.addPayee(MyMoneyFile::instance()->payeeByName("Thomas Baumgart").id()); filter.setName("Spending with Payee Filter"); @@ -579,7 +579,7 @@ TransactionHelper t4(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moNoPayee, acCredit, acParent, QString(), QString()); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); filter.addPayee(QString()); XMLandback(filter); @@ -596,7 +596,7 @@ TransactionHelper t4(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, QString(), "Thomas Baumgart"); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); filter.setTextFilter(QRegExp("Thomas")); XMLandback(filter); @@ -610,7 +610,7 @@ TransactionHelper t3(QDate(2004, 11, 1), MyMoneySplit::ActionTransfer, moChild, acCredit, acChecking); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.addType((int)eMyMoney::TransactionFilter::Type::Payments); XMLandback(filter); PivotTable spending_f(filter); @@ -631,7 +631,7 @@ QVERIFY(spending_f3.m_grid.m_total[eActual].m_total == moZero); - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 1, 1), QDate(2004, 12, 31)); XMLandback(filter); PivotTable networth_f4(filter); @@ -665,7 +665,7 @@ t2.update(); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); filter.addState((int)eMyMoney::TransactionFilter::State::Cleared); XMLandback(filter); @@ -726,7 +726,7 @@ t4.update(); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); filter.setNumberFilter("1", "3"); XMLandback(filter); @@ -749,7 +749,7 @@ TransactionHelper t3y3(QDate(2005, 9, 1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(), QDate(2004, 7, 1)); XMLandback(filter); PivotTable spending_f(filter); @@ -781,10 +781,10 @@ TransactionHelper t3y2(QDate(2005, 9, 1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2003, 12, 31), QDate(2005, 12, 31)); - filter.setRowType(MyMoneyReport::eExpenseIncome); - filter.setColumnType(MyMoneyReport::eBiMonths); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); + filter.setColumnType(MyMoneyReport::Column::BiMonths); XMLandback(filter); PivotTable spending_b(filter); @@ -802,7 +802,7 @@ QVERIFY(spending_b.m_grid.m_total[eActual][11] == -moParent2); QVERIFY(spending_b.m_grid.m_total[eActual][12] == moZero); - filter.setColumnType(MyMoneyReport::eQuarters); + filter.setColumnType(MyMoneyReport::Column::Quarters); XMLandback(filter); PivotTable spending_q(filter); @@ -816,7 +816,7 @@ QVERIFY(spending_q.m_grid.m_total[eActual][7] == -moParent2); QVERIFY(spending_q.m_grid.m_total[eActual][8] == moZero); - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setName("Net Worth by Quarter"); XMLandback(filter); PivotTable networth_q(filter); @@ -832,17 +832,17 @@ QVERIFY(networth_q.m_grid.m_total[eActual][8] == -moParent2 - moParent1 - moSolo - moSolo - moParent - moSolo - moParent + moCheckingOpen + moCreditOpen); QVERIFY(networth_q.m_grid.m_total[eActual][9] == -moParent2 - moParent1 - moSolo - moSolo - moParent - moSolo - moParent + moCheckingOpen + moCreditOpen); - filter.setRowType(MyMoneyReport::eExpenseIncome); - filter.setColumnType(MyMoneyReport::eYears); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); + filter.setColumnType(MyMoneyReport::Column::Years); XMLandback(filter); PivotTable spending_y(filter); QVERIFY(spending_y.m_grid.m_total[eActual][0] == moZero); QVERIFY(spending_y.m_grid.m_total[eActual][1] == -moSolo - moParent - moSolo - moParent); QVERIFY(spending_y.m_grid.m_total[eActual][2] == -moSolo - moParent); QVERIFY(spending_y.m_grid.m_total[eActual].m_total == -moSolo - moParent - moSolo - moParent - moSolo - moParent); - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); XMLandback(filter); PivotTable networth_y(filter); @@ -865,8 +865,8 @@ TransactionHelper t3d3(QDate(2004, 8, 4), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent); filter.setDateFilter(QDate(2004, 7, 2), QDate(2004, 7, 14)); - filter.setRowType(MyMoneyReport::eExpenseIncome); - filter.setColumnType(MyMoneyReport::eMonths); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); + filter.setColumnType(MyMoneyReport::Column::Months); filter.setColumnsAreDays(true); filter.setName("Spending by Days"); @@ -882,8 +882,8 @@ QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedKingdom)); filter.setDateFilter(QDate(2004, 7, 2), QDate(2004, 8, 1)); - filter.setRowType(MyMoneyReport::eExpenseIncome); - filter.setColumnType(static_cast(7)); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); + filter.setColumnType(static_cast(7)); filter.setColumnsAreDays(true); filter.setName("Spending by Weeks"); @@ -934,7 +934,7 @@ // MyMoneyReport networth_r; - networth_r.setRowType(MyMoneyReport::eAssetLiability); + networth_r.setRowType(MyMoneyReport::Row::AssetLiability); networth_r.setDateFilter(QDate(2004, 1, 1), QDate(2004, 12, 31).addDays(-1)); XMLandback(networth_r); PivotTable networth(networth_r); @@ -987,8 +987,8 @@ BudgetHelper budget; budget += BudgetEntryHelper(QDate(2006, 1, 1), acSolo, false, MyMoneyMoney(100.0)); - MyMoneyReport report(MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport report(MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, eMyMoney::TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailTop, "Yearly Budgeted vs. Actual", "Default Report"); @@ -999,8 +999,8 @@ { BudgetHelper budget; budget += BudgetEntryHelper(QDate(2006, 1, 1), acParent, false, MyMoneyMoney(100.0)); - MyMoneyReport report(MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport report(MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, eMyMoney::TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailTop, "Yearly Budgeted vs. Actual", "Default Report"); @@ -1015,8 +1015,8 @@ { BudgetHelper budget; budget += BudgetEntryHelper(QDate(2006, 1, 1), acParent, true, MyMoneyMoney(100.0)); - MyMoneyReport report(MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport report(MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, eMyMoney::TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailTop , "Yearly Budgeted vs. Actual", "Default Report"); @@ -1032,8 +1032,8 @@ budget += BudgetEntryHelper(QDate(2006, 1, 1), acParent, false, MyMoneyMoney(100.0)); budget += BudgetEntryHelper(QDate(2006, 1, 1), acChild, false, MyMoneyMoney(100.0)); budget += BudgetEntryHelper(QDate(2006, 1, 1), acSecondChild, true, MyMoneyMoney(100.0)); - MyMoneyReport report(MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport report(MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, eMyMoney::TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailTop, "Yearly Budgeted vs. Actual", "Default Report"); @@ -1049,8 +1049,8 @@ { BudgetHelper budget; budget += BudgetEntryHelper(QDate(2006, 1, 1), acSolo, false, MyMoneyMoney(100.0)); - MyMoneyReport report(MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport report(MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, eMyMoney::TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailTop, "Yearly Budgeted vs. Actual", "Default Report"); @@ -1061,7 +1061,7 @@ void PivotTableTest::testHtmlEncoding() { MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); diff --git a/kmymoney/reports/tests/querytable-test.cpp b/kmymoney/reports/tests/querytable-test.cpp --- a/kmymoney/reports/tests/querytable-test.cpp +++ b/kmymoney/reports/tests/querytable-test.cpp @@ -109,9 +109,9 @@ unsigned cols; MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eCategory); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; - filter.setQueryColumns(static_cast(cols)); // + filter.setRowType(MyMoneyReport::Row::Category); + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account; + filter.setQueryColumns(static_cast(cols)); // filter.setName("Transactions by Category"); XMLandback(filter); QueryTable qtbl_1(filter); @@ -134,9 +134,9 @@ QVERIFY(MyMoneyMoney(rows[17][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3); QVERIFY(MyMoneyMoney(rows[18][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); - filter.setRowType(MyMoneyReport::eTopCategory); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; - filter.setQueryColumns(static_cast(cols)); // + filter.setRowType(MyMoneyReport::Row::TopCategory); + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account; + filter.setQueryColumns(static_cast(cols)); // filter.setName("Transactions by Top Category"); XMLandback(filter); QueryTable qtbl_2(filter); @@ -161,10 +161,10 @@ QVERIFY(MyMoneyMoney(rows[14][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3); QVERIFY(MyMoneyMoney(rows[15][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); - filter.setRowType(MyMoneyReport::eAccount); + filter.setRowType(MyMoneyReport::Row::Account); filter.setName("Transactions by Account"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; - filter.setQueryColumns(static_cast(cols)); // + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category; + filter.setQueryColumns(static_cast(cols)); // XMLandback(filter); QueryTable qtbl_3(filter); @@ -194,10 +194,10 @@ QVERIFY(MyMoneyMoney(rows[17][ListTable::ctValue]) == -(moParent1 + moParent2 + moChild) * 3 + moCreditOpen); QVERIFY(MyMoneyMoney(rows[18][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); - filter.setRowType(MyMoneyReport::ePayee); + filter.setRowType(MyMoneyReport::Row::Payee); filter.setName("Transactions by Payee"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCmemo | MyMoneyReport::eQCcategory; - filter.setQueryColumns(static_cast(cols)); // + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Memo | MyMoneyReport::QueryColumns::Category; + filter.setQueryColumns(static_cast(cols)); // XMLandback(filter); QueryTable qtbl_4(filter); @@ -219,10 +219,10 @@ QVERIFY(MyMoneyMoney(rows[12][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3); QVERIFY(MyMoneyMoney(rows[13][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); - filter.setRowType(MyMoneyReport::eMonth); + filter.setRowType(MyMoneyReport::Row::Month); filter.setName("Transactions by Month"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; - filter.setQueryColumns(static_cast(cols)); // + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category; + filter.setQueryColumns(static_cast(cols)); // XMLandback(filter); QueryTable qtbl_5(filter); @@ -246,10 +246,10 @@ QVERIFY(MyMoneyMoney(rows[9][ListTable::ctValue]) == -moParent1 + moCheckingOpen); QVERIFY(MyMoneyMoney(rows[22][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); - filter.setRowType(MyMoneyReport::eWeek); + filter.setRowType(MyMoneyReport::Row::Week); filter.setName("Transactions by Week"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; - filter.setQueryColumns(static_cast(cols)); // + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category; + filter.setQueryColumns(static_cast(cols)); // XMLandback(filter); QueryTable qtbl_6(filter); @@ -334,7 +334,7 @@ // MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eInstitution); + filter.setRowType(MyMoneyReport::Row::Institution); filter.setName("Accounts by Institution (No transactions)"); XMLandback(filter); QueryTable qtbl_1(filter); @@ -373,7 +373,7 @@ TransactionHelper t3y2(QDate(2005, 9, 1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent); TransactionHelper t4y2(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); - filter.setRowType(MyMoneyReport::eInstitution); + filter.setRowType(MyMoneyReport::Row::Institution); filter.setName("Accounts by Institution (With Transactions)"); XMLandback(filter); QueryTable qtbl_2(filter); @@ -392,7 +392,7 @@ // Account TYPES // - filter.setRowType(MyMoneyReport::eAccountType); + filter.setRowType(MyMoneyReport::Row::AccountType); filter.setName("Accounts by Type"); XMLandback(filter); QueryTable qtbl_3(filter); @@ -457,8 +457,8 @@ // MyMoneyReport invtran_r( - MyMoneyReport::eTopAccount, - MyMoneyReport::eQCaction | MyMoneyReport::eQCshares | MyMoneyReport::eQCprice, + MyMoneyReport::Row::TopAccount, + MyMoneyReport::QueryColumns::Action | MyMoneyReport::QueryColumns::Shares | MyMoneyReport::QueryColumns::Price, eMyMoney::TransactionFilter::Date::UserDefined, MyMoneyReport::eDetailAll, i18n("Investment Transactions"), @@ -557,8 +557,8 @@ // MyMoneyReport invhold_r( - MyMoneyReport::eAccountByTopAccount, - MyMoneyReport::eQCperformance, + MyMoneyReport::Row::AccountByTopAccount, + MyMoneyReport::QueryColumns::Performance, eMyMoney::TransactionFilter::Date::UserDefined, MyMoneyReport::eDetailAll, i18n("Investment Performance by Account"), @@ -640,8 +640,8 @@ // MyMoneyReport invhold_r( - MyMoneyReport::eAccountByTopAccount, - MyMoneyReport::eQCperformance, + MyMoneyReport::Row::AccountByTopAccount, + MyMoneyReport::QueryColumns::Performance, eMyMoney::TransactionFilter::Date::UserDefined, MyMoneyReport::eDetailAll, i18n("Investment Performance by Account"), @@ -680,11 +680,11 @@ TransactionHelper t1(QDate(2017, 8, 1), MyMoneySplit::ActionWithdrawal, amountWithdrawn, acCadChecking, acSolo, "CAD"); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAccount); + filter.setRowType(MyMoneyReport::Row::Account); filter.setDateFilter(QDate(2017, 8, 1), QDate(2017, 8, 2)); filter.setName("Transactions by Account"); - auto cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance; - filter.setQueryColumns(static_cast(cols)); // + auto cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Balance; + filter.setQueryColumns(static_cast(cols)); // XMLandback(filter); QueryTable qtbl(filter); @@ -728,10 +728,10 @@ MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAccount); + filter.setRowType(MyMoneyReport::Row::Account); filter.setName("Transactions by Account"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance; - filter.setQueryColumns(static_cast(cols)); // + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Balance; + filter.setQueryColumns(static_cast(cols)); // XMLandback(filter); QueryTable qtbl_3(filter); @@ -790,10 +790,10 @@ MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAccount); + filter.setRowType(MyMoneyReport::Row::Account); filter.setName("Transactions by Account"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance; - filter.setQueryColumns(static_cast(cols)); + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Balance; + filter.setQueryColumns(static_cast(cols)); // don't convert values to the default currency filter.setConvertCurrency(false); XMLandback(filter); @@ -884,10 +884,10 @@ unsigned cols; MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eCategory); + filter.setRowType(MyMoneyReport::Row::Category); filter.setName("Tax Transactions"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; - filter.setQueryColumns(static_cast(cols)); + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account; + filter.setQueryColumns(static_cast(cols)); filter.setTax(true); XMLandback(filter); diff --git a/kmymoney/views/kforecastview_p.h b/kmymoney/views/kforecastview_p.h --- a/kmymoney/views/kforecastview_p.h +++ b/kmymoney/views/kforecastview_p.h @@ -660,8 +660,8 @@ MyMoneyReport::EDetailLevel detailLevel[4] = { MyMoneyReport::eDetailAll, MyMoneyReport::eDetailTop, MyMoneyReport::eDetailGroup, MyMoneyReport::eDetailTotal }; MyMoneyReport reportCfg = MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, eMyMoney::TransactionFilter::Date::UserDefined, // overridden by the setDateFilter() call below detailLevel[ui->m_comboDetail->currentIndex()], i18n("Net Worth Forecast"), diff --git a/kmymoney/views/khomeview_p.h b/kmymoney/views/khomeview_p.h --- a/kmymoney/views/khomeview_p.h +++ b/kmymoney/views/khomeview_p.h @@ -497,8 +497,8 @@ m_html += QString("
%1
\n
 
\n").arg(i18n("Net Worth Forecast")); MyMoneyReport reportCfg = MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::UserDefined, // overridden by the setDateFilter() call below MyMoneyReport::eDetailTotal, i18n("Net Worth Forecast"), @@ -1423,8 +1423,8 @@ //config report just like "Monthly Budgeted vs Actual MyMoneyReport reportCfg = MyMoneyReport( - MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentMonth, MyMoneyReport::eDetailAll, i18n("Monthly Budgeted vs. Actual"), diff --git a/kmymoney/views/kreportsview.cpp b/kmymoney/views/kreportsview.cpp --- a/kmymoney/views/kreportsview.cpp +++ b/kmymoney/views/kreportsview.cpp @@ -661,8 +661,8 @@ // currently selected account. if (!d->m_currentAccount.id().isEmpty()) { MyMoneyReport report( - MyMoneyReport::eAccount, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory, + MyMoneyReport::Row::Account, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category, eMyMoney::TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("%1 YTD Account Transactions", d->m_currentAccount.name()), diff --git a/kmymoney/views/kreportsview_p.h b/kmymoney/views/kreportsview_p.h --- a/kmymoney/views/kreportsview_p.h +++ b/kmymoney/views/kreportsview_p.h @@ -355,13 +355,13 @@ delete m_table; m_table = 0; - if (m_report.reportType() == MyMoneyReport::ePivotTable) { + if (m_report.reportType() == MyMoneyReport::Report::PivotTable) { m_table = new PivotTable(m_report); m_chartEnabled = true; - } else if (m_report.reportType() == MyMoneyReport::eQueryTable) { + } else if (m_report.reportType() == MyMoneyReport::Report::QueryTable) { m_table = new QueryTable(m_report); m_chartEnabled = false; - } else if (m_report.reportType() == MyMoneyReport::eInfoTable) { + } else if (m_report.reportType() == MyMoneyReport::Report::InfoTable) { m_table = new ObjectInfoTable(m_report); m_chartEnabled = false; } @@ -807,33 +807,33 @@ ReportGroup list("Income and Expenses", i18n("Income and Expenses")); list.push_back(MyMoneyReport( - MyMoneyReport::eExpenseIncome, - MyMoneyReport::eMonths, + MyMoneyReport::Row::ExpenseIncome, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentMonth, MyMoneyReport::eDetailAll, i18n("Income and Expenses This Month"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eExpenseIncome, - MyMoneyReport::eMonths, + MyMoneyReport::Row::ExpenseIncome, + MyMoneyReport::Column::Months, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Income and Expenses This Year"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eExpenseIncome, - MyMoneyReport::eYears, + MyMoneyReport::Row::ExpenseIncome, + MyMoneyReport::Column::Years, TransactionFilter::Date::All, MyMoneyReport::eDetailAll, i18n("Income and Expenses By Year"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eExpenseIncome, - MyMoneyReport::eMonths, + MyMoneyReport::Row::ExpenseIncome, + MyMoneyReport::Column::Months, TransactionFilter::Date::Last12Months, MyMoneyReport::eDetailTop, i18n("Income and Expenses Graph"), @@ -844,8 +844,8 @@ list.back().setChartDataLabels(false); list.push_back(MyMoneyReport( - MyMoneyReport::eExpenseIncome, - MyMoneyReport::eMonths, + MyMoneyReport::Row::ExpenseIncome, + MyMoneyReport::Column::Months, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailGroup, i18n("Income and Expenses Pie Chart"), @@ -861,32 +861,32 @@ ReportGroup list("Net Worth", i18n("Net Worth")); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailTop, i18n("Net Worth By Month"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Today, MyMoneyReport::eDetailTop, i18n("Net Worth Today"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eYears, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Years, TransactionFilter::Date::All, MyMoneyReport::eDetailTop, i18n("Net Worth By Year"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Next7Days, MyMoneyReport::eDetailTop, i18n("7-day Cash Flow Forecast"), @@ -896,8 +896,8 @@ list.back().setColumnsAreDays(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Last12Months, MyMoneyReport::eDetailTotal, i18n("Net Worth Graph"), @@ -909,17 +909,17 @@ list.back().setChartType(MyMoneyReport::eChartLine); list.push_back(MyMoneyReport( - MyMoneyReport::eInstitution, - MyMoneyReport::eQCnone, + MyMoneyReport::Row::Institution, + MyMoneyReport::QueryColumns::None, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailTop, i18n("Account Balances by Institution"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eAccountType, - MyMoneyReport::eQCnone, + MyMoneyReport::Row::AccountType, + MyMoneyReport::QueryColumns::None, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailTop, i18n("Account Balances by Type"), @@ -932,66 +932,66 @@ ReportGroup list("Transactions", i18n("Transactions")); list.push_back(MyMoneyReport( - MyMoneyReport::eAccount, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCtag | MyMoneyReport::eQCbalance, + MyMoneyReport::Row::Account, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Tag | MyMoneyReport::QueryColumns::Balance, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Transactions by Account"), i18n("Default Report") )); //list.back().setConvertCurrency(false); list.push_back(MyMoneyReport( - MyMoneyReport::eCategory, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount | MyMoneyReport::eQCtag, + MyMoneyReport::Row::Category, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account | MyMoneyReport::QueryColumns::Tag, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Transactions by Category"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::ePayee, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCcategory | MyMoneyReport::eQCtag, + MyMoneyReport::Row::Payee, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Tag, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Transactions by Payee"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eTag, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCcategory, + MyMoneyReport::Row::Tag, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Category, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Transactions by Tag"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eMonth, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCtag, + MyMoneyReport::Row::Month, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Tag, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Transactions by Month"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eWeek, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCtag, + MyMoneyReport::Row::Week, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Tag, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Transactions by Week"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eAccount, - MyMoneyReport::eQCloan, + MyMoneyReport::Row::Account, + MyMoneyReport::QueryColumns::Loan, TransactionFilter::Date::All, MyMoneyReport::eDetailAll, i18n("Loan Transactions"), i18n("Default Report") )); list.back().setLoansOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAccountReconcile, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance, + MyMoneyReport::Row::AccountReconcile, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Balance, TransactionFilter::Date::Last3Months, MyMoneyReport::eDetailAll, i18n("Transactions by Reconciliation Status"), @@ -1002,8 +1002,8 @@ { ReportGroup list("CashFlow", i18n("Cash Flow")); list.push_back(MyMoneyReport( - MyMoneyReport::eCashFlow, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount, + MyMoneyReport::Row::CashFlow, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Cash Flow Transactions This Month"), @@ -1015,78 +1015,78 @@ ReportGroup list("Investments", i18n("Investments")); list.push_back(MyMoneyReport( - MyMoneyReport::eTopAccount, - MyMoneyReport::eQCaction | MyMoneyReport::eQCshares | MyMoneyReport::eQCprice, + MyMoneyReport::Row::TopAccount, + MyMoneyReport::QueryColumns::Action | MyMoneyReport::QueryColumns::Shares | MyMoneyReport::QueryColumns::Price, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Investment Transactions"), i18n("Default Report") )); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAccountByTopAccount, - MyMoneyReport::eQCshares | MyMoneyReport::eQCprice, + MyMoneyReport::Row::AccountByTopAccount, + MyMoneyReport::QueryColumns::Shares | MyMoneyReport::QueryColumns::Price, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Investment Holdings by Account"), i18n("Default Report") )); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eEquityType, - MyMoneyReport::eQCshares | MyMoneyReport::eQCprice, + MyMoneyReport::Row::EquityType, + MyMoneyReport::QueryColumns::Shares | MyMoneyReport::QueryColumns::Price, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Investment Holdings by Type"), i18n("Default Report") )); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAccountByTopAccount, - MyMoneyReport::eQCperformance, + MyMoneyReport::Row::AccountByTopAccount, + MyMoneyReport::QueryColumns::Performance, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Investment Performance by Account"), i18n("Default Report") )); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eEquityType, - MyMoneyReport::eQCperformance, + MyMoneyReport::Row::EquityType, + MyMoneyReport::QueryColumns::Performance, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Investment Performance by Type"), i18n("Default Report") )); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAccountByTopAccount, - MyMoneyReport::eQCcapitalgain, + MyMoneyReport::Row::AccountByTopAccount, + MyMoneyReport::QueryColumns::Capitalgain, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Investment Capital Gains by Account"), i18n("Default Report") )); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eEquityType, - MyMoneyReport::eQCcapitalgain, + MyMoneyReport::Row::EquityType, + MyMoneyReport::QueryColumns::Capitalgain, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Investment Capital Gains by Type"), i18n("Default Report") )); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Today, MyMoneyReport::eDetailAll, i18n("Investment Holdings Pie"), @@ -1099,8 +1099,8 @@ list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Last12Months, MyMoneyReport::eDetailAll, i18n("Investment Worth Graph"), @@ -1114,8 +1114,8 @@ list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Last12Months, MyMoneyReport::eDetailAll, i18n("Investment Price Graph"), @@ -1136,8 +1136,8 @@ list.back().setShowingRowTotals(false); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Last12Months, MyMoneyReport::eDetailAll, i18n("Investment Moving Average Price Graph"), @@ -1158,8 +1158,8 @@ list.back().setShowingRowTotals(false); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Last30Days, MyMoneyReport::eDetailAll, i18n("Investment Moving Average"), @@ -1175,8 +1175,8 @@ list.back().setMovingAverageDays(10); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Last30Days, MyMoneyReport::eDetailAll, i18n("Investment Moving Average vs Actual"), @@ -1197,35 +1197,35 @@ ReportGroup list("Taxes", i18n("Taxes")); list.push_back(MyMoneyReport( - MyMoneyReport::eCategory, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount, + MyMoneyReport::Row::Category, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Tax Transactions by Category"), i18n("Default Report") )); list.back().setTax(true); list.push_back(MyMoneyReport( - MyMoneyReport::ePayee, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCcategory | MyMoneyReport::eQCaccount, + MyMoneyReport::Row::Payee, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Account, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Tax Transactions by Payee"), i18n("Default Report") )); list.back().setTax(true); list.push_back(MyMoneyReport( - MyMoneyReport::eCategory, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount, + MyMoneyReport::Row::Category, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account, TransactionFilter::Date::LastFiscalYear, MyMoneyReport::eDetailAll, i18n("Tax Transactions by Category Last Fiscal Year"), i18n("Default Report") )); list.back().setTax(true); list.push_back(MyMoneyReport( - MyMoneyReport::ePayee, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCcategory | MyMoneyReport::eQCaccount, + MyMoneyReport::Row::Payee, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Account, TransactionFilter::Date::LastFiscalYear, MyMoneyReport::eDetailAll, i18n("Tax Transactions by Payee Last Fiscal Year"), @@ -1238,8 +1238,8 @@ ReportGroup list("Budgeting", i18n("Budgeting")); list.push_back(MyMoneyReport( - MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, TransactionFilter::Date::YearToDate, MyMoneyReport::eDetailAll, i18n("Budgeted vs. Actual This Year"), @@ -1249,8 +1249,8 @@ list.back().setBudget("Any", true); list.push_back(MyMoneyReport( - MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, TransactionFilter::Date::YearToMonth, MyMoneyReport::eDetailAll, i18n("Budgeted vs. Actual This Year (YTM)"), @@ -1264,18 +1264,18 @@ } list.push_back(MyMoneyReport( - MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentMonth, MyMoneyReport::eDetailAll, i18n("Monthly Budgeted vs. Actual"), i18n("Default Report") )); list.back().setBudget("Any", true); list.push_back(MyMoneyReport( - MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentYear, MyMoneyReport::eDetailAll, i18n("Yearly Budgeted vs. Actual"), @@ -1285,28 +1285,28 @@ list.back().setShowingRowTotals(true); list.push_back(MyMoneyReport( - MyMoneyReport::eBudget, - MyMoneyReport::eMonths, + MyMoneyReport::Row::Budget, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentMonth, MyMoneyReport::eDetailAll, i18n("Monthly Budget"), i18n("Default Report") )); list.back().setBudget("Any", false); list.push_back(MyMoneyReport( - MyMoneyReport::eBudget, - MyMoneyReport::eMonths, + MyMoneyReport::Row::Budget, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentYear, MyMoneyReport::eDetailAll, i18n("Yearly Budget"), i18n("Default Report") )); list.back().setBudget("Any", false); list.back().setShowingRowTotals(true); list.push_back(MyMoneyReport( - MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentYear, MyMoneyReport::eDetailGroup, i18n("Yearly Budgeted vs Actual Graph"), @@ -1324,18 +1324,18 @@ ReportGroup list("Forecast", i18n("Forecast")); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Next12Months, MyMoneyReport::eDetailTop, i18n("Forecast By Month"), i18n("Default Report") )); list.back().setIncludingForecast(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::NextQuarter, MyMoneyReport::eDetailTop, i18n("Forecast Next Quarter"), @@ -1345,18 +1345,18 @@ list.back().setIncludingForecast(true); list.push_back(MyMoneyReport( - MyMoneyReport::eExpenseIncome, - MyMoneyReport::eMonths, + MyMoneyReport::Row::ExpenseIncome, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentYear, MyMoneyReport::eDetailTop, i18n("Income and Expenses Forecast This Year"), i18n("Default Report") )); list.back().setIncludingForecast(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Next3Months, MyMoneyReport::eDetailTotal, i18n("Net Worth Forecast Graph"), @@ -1374,35 +1374,35 @@ ReportGroup list("Information", i18n("General Information")); list.push_back(MyMoneyReport( - MyMoneyReport::eSchedule, - MyMoneyReport::eMonths, + MyMoneyReport::Row::Schedule, + MyMoneyReport::Column::Months, TransactionFilter::Date::Next12Months, MyMoneyReport::eDetailAll, i18n("Schedule Information"), i18n("Default Report") )); list.back().setDetailLevel(MyMoneyReport::eDetailAll); list.push_back(MyMoneyReport( - MyMoneyReport::eSchedule, - MyMoneyReport::eMonths, + MyMoneyReport::Row::Schedule, + MyMoneyReport::Column::Months, TransactionFilter::Date::Next12Months, MyMoneyReport::eDetailAll, i18n("Schedule Summary Information"), i18n("Default Report") )); list.back().setDetailLevel(MyMoneyReport::eDetailTop); list.push_back(MyMoneyReport( - MyMoneyReport::eAccountInfo, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AccountInfo, + MyMoneyReport::Column::Months, TransactionFilter::Date::Today, MyMoneyReport::eDetailAll, i18n("Account Information"), i18n("Default Report") )); list.back().setConvertCurrency(false); list.push_back(MyMoneyReport( - MyMoneyReport::eAccountLoanInfo, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AccountLoanInfo, + MyMoneyReport::Column::Months, TransactionFilter::Date::Today, MyMoneyReport::eDetailAll, i18n("Loan Information"),