Commit ad66b57f authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Convert enumeration MyMoneyReport::EQueryColumns into a class to be more type safe

CCBUG:391091

Test Plan: compiled on linux

Reviewers: #kmymoney

Reviewed By: #kmymoney, tbaumgart

Differential Revision: https://phabricator.kde.org/D11053
parent 1e538415
......@@ -197,36 +197,36 @@ void KReportConfigurationFilterDlg::slotSearch()
MyMoneyReport::ERowType rtq[8] = { MyMoneyReport::eCategory, MyMoneyReport::eTopCategory, MyMoneyReport::eTag, MyMoneyReport::ePayee, MyMoneyReport::eAccount, MyMoneyReport::eTopAccount, MyMoneyReport::eMonth, MyMoneyReport::eWeek };
m_currentState.setRowType(rtq[m_tab3->findChild<KComboBox*>("m_comboOrganizeBy")->currentIndex()]);
unsigned qc = MyMoneyReport::eQCnone;
unsigned qc = MyMoneyReport::QueryColumns::None;
if (m_currentState.queryColumns() & MyMoneyReport::eQCloan)
if (m_currentState.queryColumns() & MyMoneyReport::QueryColumns::Loan)
// once a loan report, always a loan report
qc = MyMoneyReport::eQCloan;
qc = MyMoneyReport::QueryColumns::Loan;
if (m_tab3->findChild<QCheckBox*>("m_checkNumber")->isChecked())
qc |= MyMoneyReport::eQCnumber;
qc |= MyMoneyReport::QueryColumns::Number;
if (m_tab3->findChild<QCheckBox*>("m_checkPayee")->isChecked())
qc |= MyMoneyReport::eQCpayee;
qc |= MyMoneyReport::QueryColumns::Payee;
if (m_tab3->findChild<QCheckBox*>("m_checkTag")->isChecked())
qc |= MyMoneyReport::eQCtag;
qc |= MyMoneyReport::QueryColumns::Tag;
if (m_tab3->findChild<QCheckBox*>("m_checkCategory")->isChecked())
qc |= MyMoneyReport::eQCcategory;
qc |= MyMoneyReport::QueryColumns::Category;
if (m_tab3->findChild<QCheckBox*>("m_checkMemo")->isChecked())
qc |= MyMoneyReport::eQCmemo;
qc |= MyMoneyReport::QueryColumns::Memo;
if (m_tab3->findChild<QCheckBox*>("m_checkAccount")->isChecked())
qc |= MyMoneyReport::eQCaccount;
qc |= MyMoneyReport::QueryColumns::Account;
if (m_tab3->findChild<QCheckBox*>("m_checkReconciled")->isChecked())
qc |= MyMoneyReport::eQCreconciled;
qc |= MyMoneyReport::QueryColumns::Reconciled;
if (m_tab3->findChild<QCheckBox*>("m_checkAction")->isChecked())
qc |= MyMoneyReport::eQCaction;
qc |= MyMoneyReport::QueryColumns::Action;
if (m_tab3->findChild<QCheckBox*>("m_checkShares")->isChecked())
qc |= MyMoneyReport::eQCshares;
qc |= MyMoneyReport::QueryColumns::Shares;
if (m_tab3->findChild<QCheckBox*>("m_checkPrice")->isChecked())
qc |= MyMoneyReport::eQCprice;
qc |= MyMoneyReport::QueryColumns::Price;
if (m_tab3->findChild<QCheckBox*>("m_checkBalance")->isChecked())
qc |= MyMoneyReport::eQCbalance;
qc |= MyMoneyReport::QueryColumns::Balance;
m_currentState.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(qc));
m_currentState.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(qc));
m_currentState.setTax(m_tab3->findChild<QCheckBox*>("m_checkTax")->isChecked());
m_currentState.setInvestmentsOnly(m_tab3->findChild<QCheckBox*>("m_checkInvestments")->isChecked());
......@@ -423,17 +423,17 @@ void KReportConfigurationFilterDlg::slotReset()
}
unsigned qc = m_initialState.queryColumns();
m_tab3->findChild<QCheckBox*>("m_checkNumber")->setChecked(qc & MyMoneyReport::eQCnumber);
m_tab3->findChild<QCheckBox*>("m_checkPayee")->setChecked(qc & MyMoneyReport::eQCpayee);
m_tab3->findChild<QCheckBox*>("m_checkTag")->setChecked(qc & MyMoneyReport::eQCtag);
m_tab3->findChild<QCheckBox*>("m_checkCategory")->setChecked(qc & MyMoneyReport::eQCcategory);
m_tab3->findChild<QCheckBox*>("m_checkMemo")->setChecked(qc & MyMoneyReport::eQCmemo);
m_tab3->findChild<QCheckBox*>("m_checkAccount")->setChecked(qc & MyMoneyReport::eQCaccount);
m_tab3->findChild<QCheckBox*>("m_checkReconciled")->setChecked(qc & MyMoneyReport::eQCreconciled);
m_tab3->findChild<QCheckBox*>("m_checkAction")->setChecked(qc & MyMoneyReport::eQCaction);
m_tab3->findChild<QCheckBox*>("m_checkShares")->setChecked(qc & MyMoneyReport::eQCshares);
m_tab3->findChild<QCheckBox*>("m_checkPrice")->setChecked(qc & MyMoneyReport::eQCprice);
m_tab3->findChild<QCheckBox*>("m_checkBalance")->setChecked(qc & MyMoneyReport::eQCbalance);
m_tab3->findChild<QCheckBox*>("m_checkNumber")->setChecked(qc & MyMoneyReport::QueryColumns::Number);
m_tab3->findChild<QCheckBox*>("m_checkPayee")->setChecked(qc & MyMoneyReport::QueryColumns::Payee);
m_tab3->findChild<QCheckBox*>("m_checkTag")->setChecked(qc & MyMoneyReport::QueryColumns::Tag);
m_tab3->findChild<QCheckBox*>("m_checkCategory")->setChecked(qc & MyMoneyReport::QueryColumns::Category);
m_tab3->findChild<QCheckBox*>("m_checkMemo")->setChecked(qc & MyMoneyReport::QueryColumns::Memo);
m_tab3->findChild<QCheckBox*>("m_checkAccount")->setChecked(qc & MyMoneyReport::QueryColumns::Account);
m_tab3->findChild<QCheckBox*>("m_checkReconciled")->setChecked(qc & MyMoneyReport::QueryColumns::Reconciled);
m_tab3->findChild<QCheckBox*>("m_checkAction")->setChecked(qc & MyMoneyReport::QueryColumns::Action);
m_tab3->findChild<QCheckBox*>("m_checkShares")->setChecked(qc & MyMoneyReport::QueryColumns::Shares);
m_tab3->findChild<QCheckBox*>("m_checkPrice")->setChecked(qc & MyMoneyReport::QueryColumns::Price);
m_tab3->findChild<QCheckBox*>("m_checkBalance")->setChecked(qc & MyMoneyReport::QueryColumns::Balance);
m_tab3->findChild<QCheckBox*>("m_checkTax")->setChecked(m_initialState.isTax());
m_tab3->findChild<QCheckBox*>("m_checkInvestments")->setChecked(m_initialState.isInvestmentsOnly());
......
......@@ -4290,7 +4290,7 @@ void KMyMoneyApp::slotAccountTransactionReport()
if (!d->m_selectedAccount.id().isEmpty()) {
MyMoneyReport report(
MyMoneyReport::eAccount,
MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory,
MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("%1 YTD Account Transactions", d->m_selectedAccount.name()),
......
......@@ -35,13 +35,12 @@
#include "reportdebug.h"
const QStringList MyMoneyReport::Column::kTypeText = 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 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 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(',');
// 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").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 QStringList MyMoneyReport::kDetailLevelText = QString("none,all,top,group,total,invalid").split(',');
const QStringList MyMoneyReport::kChartTypeText = QString("none,line,bar,pie,ring,stackedbar,invalid").split(',');
......@@ -64,7 +63,7 @@ MyMoneyReport::MyMoneyReport() :
m_rowType(eExpenseIncome),
m_columnType(Column::Months),
m_columnsAreDays(false),
m_queryColumns(eQCnone),
m_queryColumns(QueryColumns::None),
m_dateLock(userDefined),
m_accountGroupFilter(false),
m_chartType(eChartLine),
......@@ -110,7 +109,7 @@ MyMoneyReport::MyMoneyReport(ERowType _rt, unsigned _ct, dateOptionE _dl, EDetai
m_rowType(_rt),
m_columnType(Column::Months),
m_columnsAreDays(false),
m_queryColumns(eQCnone),
m_queryColumns(QueryColumns::None),
m_dateLock(_dl),
m_accountGroupFilter(false),
m_chartType(eChartLine),
......@@ -138,7 +137,7 @@ MyMoneyReport::MyMoneyReport(ERowType _rt, unsigned _ct, dateOptionE _dl, EDetai
if (m_reportType == ePivotTable)
m_columnType = static_cast<Column::Type>(_ct);
if (m_reportType == eQueryTable)
m_queryColumns = static_cast<EQueryColumns>(_ct);
m_queryColumns = static_cast<QueryColumns::Type>(_ct);
setDateFilter(_dl);
//throw exception if the type is inconsistent
......@@ -408,11 +407,11 @@ void MyMoneyReport::write(QDomElement& e, QDomDocument *doc, bool anonymous) con
QStringList columns;
unsigned qc = m_queryColumns;
unsigned it_qc = eQCbegin;
unsigned it_qc = QueryColumns::Begin;
unsigned index = 1;
while (it_qc != eQCend) {
while (it_qc != QueryColumns::End) {
if (qc & it_qc)
columns += kQueryColumnsText[index];
columns += QueryColumns::kText[index];
it_qc *= 2;
index++;
}
......@@ -735,13 +734,13 @@ bool MyMoneyReport::read(const QDomElement& e)
QStringList columns = e.attribute("querycolumns", "none").split(',');
QStringList::const_iterator it_column = columns.constBegin();
while (it_column != columns.constEnd()) {
i = kQueryColumnsText.indexOf(*it_column);
i = QueryColumns::kText.indexOf(*it_column);
if (i > 0)
qc |= (1 << (i - 1));
++it_column;
}
setQueryColumns(static_cast<EQueryColumns>(qc));
setQueryColumns(static_cast<QueryColumns::Type>(qc));
QDomNode child = e.firstChild();
while (!child.isNull() && child.isElement()) {
......
......@@ -64,15 +64,18 @@ public:
static const QStringList kTypeText;
};
// 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, eQCend = 0x2000 };
// 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, End = 0x2000 };
static const QStringList kText;
};
enum EDetailLevel { eDetailNone = 0, eDetailAll, eDetailTop, eDetailGroup, eDetailTotal, eDetailEnd };
enum EChartType { eChartNone = 0, eChartLine, eChartBar, eChartPie, eChartRing, eChartStackedBar, eChartEnd };
static const QStringList kRowTypeText;
static const QStringList kQueryColumnsText;
static const QStringList kDetailLevelText;
static const QStringList kChartTypeText;
static const EReportType kTypeArray[];
......@@ -120,7 +123,7 @@ public:
const QString& comment() const {
return m_comment;
}
EQueryColumns queryColumns() const {
QueryColumns::Type queryColumns() const {
return m_queryColumns;
}
const QString& group() const {
......@@ -228,7 +231,7 @@ public:
void setFavorite(bool _f) {
m_favorite = _f;
}
void setQueryColumns(EQueryColumns _qc) {
void setQueryColumns(QueryColumns::Type _qc) {
m_queryColumns = _qc;
}
void setTax(bool _f) {
......@@ -576,7 +579,7 @@ private:
* What sort of values should show up on the COLUMNS of this report,
* in the case of a 'QueryTable' report
*/
enum EQueryColumns m_queryColumns;
enum QueryColumns::Type m_queryColumns;
/**
* The plain-language description of what the date range should be locked
......
......@@ -364,33 +364,33 @@ void QueryTable::init()
unsigned qc = m_config.queryColumns();
if (qc & MyMoneyReport::eQCnumber)
if (qc & MyMoneyReport::QueryColumns::Number)
m_columns += ",number";
if (qc & MyMoneyReport::eQCpayee)
if (qc & MyMoneyReport::QueryColumns::Payee)
m_columns += ",payee";
if (qc & MyMoneyReport::eQCtag)
if (qc & MyMoneyReport::QueryColumns::Tag)
m_columns += ",tag";
if (qc & MyMoneyReport::eQCcategory)
if (qc & MyMoneyReport::QueryColumns::Category)
m_columns += ",category";
if (qc & MyMoneyReport::eQCaccount)
if (qc & MyMoneyReport::QueryColumns::Account)
m_columns += ",account";
if (qc & MyMoneyReport::eQCreconciled)
if (qc & MyMoneyReport::QueryColumns::Reconciled)
m_columns += ",reconcileflag";
if (qc & MyMoneyReport::eQCmemo)
if (qc & MyMoneyReport::QueryColumns::Memo)
m_columns += ",memo";
if (qc & MyMoneyReport::eQCaction)
if (qc & MyMoneyReport::QueryColumns::Action)
m_columns += ",action";
if (qc & MyMoneyReport::eQCshares)
if (qc & MyMoneyReport::QueryColumns::Shares)
m_columns += ",shares";
if (qc & MyMoneyReport::eQCprice)
if (qc & MyMoneyReport::QueryColumns::Price)
m_columns += ",price";
if (qc & MyMoneyReport::eQCperformance)
if (qc & MyMoneyReport::QueryColumns::Performance)
m_columns += ",startingbal,buys,sells,reinvestincome,cashincome,return,returninvestment";
if (qc & MyMoneyReport::eQCloan) {
if (qc & MyMoneyReport::QueryColumns::Loan) {
m_columns += ",payment,interest,fees";
m_postcolumns = "balance";
}
if (qc & MyMoneyReport::eQCbalance)
if (qc & MyMoneyReport::QueryColumns::Balance)
m_postcolumns = "balance";
TableRow::setSortCriteria(sort);
......@@ -521,7 +521,7 @@ void QueryTable::constructTransactionTable()
// 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();
}
......@@ -1302,7 +1302,7 @@ void QueryTable::constructSplitsTable()
// 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();
}
......
......@@ -108,8 +108,8 @@ void QueryTableTest::testQueryBasics()
MyMoneyReport filter;
filter.setRowType(MyMoneyReport::eCategory);
cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount;
filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); //
cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account;
filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); //
filter.setName("Transactions by Category");
XMLandback(filter);
QueryTable qtbl_1(filter);
......@@ -133,8 +133,8 @@ void QueryTableTest::testQueryBasics()
QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Expense") == -(moParent1 + moParent2 + moSolo + moChild) * 3);
QVERIFY(searchHTML(html, i18nc("Grand total balance", "Grand Total")) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen);
filter.setRowType(MyMoneyReport::eTopCategory);
cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount;
filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); //
cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account;
filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); //
filter.setName("Transactions by Top Category");
XMLandback(filter);
QueryTable qtbl_2(filter);
......@@ -162,8 +162,8 @@ void QueryTableTest::testQueryBasics()
filter.setRowType(MyMoneyReport::eAccount);
filter.setName("Transactions by Account");
cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory;
filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); //
cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category;
filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); //
XMLandback(filter);
QueryTable qtbl_3(filter);
......@@ -196,8 +196,8 @@ void QueryTableTest::testQueryBasics()
filter.setRowType(MyMoneyReport::ePayee);
filter.setName("Transactions by Payee");
cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCmemo | MyMoneyReport::eQCcategory;
filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); //
cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Memo | MyMoneyReport::QueryColumns::Category;
filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); //
XMLandback(filter);
QueryTable qtbl_4(filter);
......@@ -222,8 +222,8 @@ void QueryTableTest::testQueryBasics()
filter.setRowType(MyMoneyReport::eMonth);
filter.setName("Transactions by Month");
cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory;
filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); //
cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category;
filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); //
XMLandback(filter);
QueryTable qtbl_5(filter);
......@@ -250,8 +250,8 @@ void QueryTableTest::testQueryBasics()
filter.setRowType(MyMoneyReport::eWeek);
filter.setName("Transactions by Week");
cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory;
filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); //
cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category;
filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); //
XMLandback(filter);
QueryTable qtbl_6(filter);
......@@ -453,7 +453,7 @@ void QueryTableTest::testInvestment()
MyMoneyReport invtran_r(
MyMoneyReport::eTopAccount,
MyMoneyReport::eQCaction | MyMoneyReport::eQCshares | MyMoneyReport::eQCprice,
MyMoneyReport::QueryColumns::Action | MyMoneyReport::QueryColumns::Shares | MyMoneyReport::QueryColumns::Price,
MyMoneyTransactionFilter::userDefined,
MyMoneyReport::eDetailAll,
i18n("Investment Transactions"),
......@@ -545,7 +545,7 @@ void QueryTableTest::testInvestment()
MyMoneyReport invhold_r(
MyMoneyReport::eAccountByTopAccount,
MyMoneyReport::eQCperformance,
MyMoneyReport::QueryColumns::Performance,
MyMoneyTransactionFilter::userDefined,
MyMoneyReport::eDetailAll,
i18n("Investment Performance by Account"),
......@@ -615,8 +615,8 @@ void QueryTableTest::testBalanceColumn()
filter.setRowType(MyMoneyReport::eAccount);
filter.setName("Transactions by Account");
cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance;
filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); //
cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Balance;
filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); //
XMLandback(filter);
QueryTable qtbl_3(filter);
......@@ -677,8 +677,8 @@ void QueryTableTest::testBalanceColumnWithMultipleCurrencies()
filter.setRowType(MyMoneyReport::eAccount);
filter.setName("Transactions by Account");
cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance;
filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols));
cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Balance;
filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols));
// don't convert values to the default currency
filter.setConvertCurrency(false);
XMLandback(filter);
......@@ -771,8 +771,8 @@ void QueryTableTest::testTaxReport()
filter.setRowType(MyMoneyReport::eCategory);
filter.setName("Tax Transactions");
cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount;
filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols));
cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account;
filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols));
filter.setTax(true);
XMLandback(filter);
......
......@@ -1275,7 +1275,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eInstitution,
MyMoneyReport::eQCnone,
MyMoneyReport::QueryColumns::None,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailTop,
i18n("Account Balances by Institution"),
......@@ -1284,7 +1284,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eAccountType,
MyMoneyReport::eQCnone,
MyMoneyReport::QueryColumns::None,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailTop,
i18n("Account Balances by Type"),
......@@ -1298,7 +1298,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eAccount,
MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCtag | MyMoneyReport::eQCbalance,
MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Tag | MyMoneyReport::QueryColumns::Balance,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Transactions by Account"),
......@@ -1307,7 +1307,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
//list.back().setConvertCurrency(false);
list.push_back(MyMoneyReport(
MyMoneyReport::eCategory,
MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount | MyMoneyReport::eQCtag,
MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account | MyMoneyReport::QueryColumns::Tag,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Transactions by Category"),
......@@ -1315,7 +1315,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
));
list.push_back(MyMoneyReport(
MyMoneyReport::ePayee,
MyMoneyReport::eQCnumber | MyMoneyReport::eQCcategory | MyMoneyReport::eQCtag,
MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Tag,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Transactions by Payee"),
......@@ -1323,7 +1323,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
));
list.push_back(MyMoneyReport(
MyMoneyReport::eTag,
MyMoneyReport::eQCnumber | MyMoneyReport::eQCcategory,
MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Category,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Transactions by Tag"),
......@@ -1331,7 +1331,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
));
list.push_back(MyMoneyReport(
MyMoneyReport::eMonth,
MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCtag,
MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Tag,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Transactions by Month"),
......@@ -1339,7 +1339,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
));
list.push_back(MyMoneyReport(
MyMoneyReport::eWeek,
MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCtag,
MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Tag,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Transactions by Week"),
......@@ -1347,7 +1347,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
));
list.push_back(MyMoneyReport(
MyMoneyReport::eAccount,
MyMoneyReport::eQCloan,
MyMoneyReport::QueryColumns::Loan,
MyMoneyTransactionFilter::allDates,
MyMoneyReport::eDetailAll,
i18n("Loan Transactions"),
......@@ -1356,7 +1356,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.back().setLoansOnly(true);
list.push_back(MyMoneyReport(
MyMoneyReport::eAccountReconcile,
MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance,
MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Balance,
MyMoneyTransactionFilter::last3Months,
MyMoneyReport::eDetailAll,
i18n("Transactions by Reconciliation Status"),
......@@ -1368,7 +1368,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
ReportGroup list("CashFlow", i18n("Cash Flow"));
list.push_back(MyMoneyReport(
MyMoneyReport::eCashFlow,
MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount,
MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Cash Flow Transactions This Month"),
......@@ -1381,7 +1381,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eTopAccount,
MyMoneyReport::eQCaction | MyMoneyReport::eQCshares | MyMoneyReport::eQCprice,
MyMoneyReport::QueryColumns::Action | MyMoneyReport::QueryColumns::Shares | MyMoneyReport::QueryColumns::Price,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Investment Transactions"),
......@@ -1391,7 +1391,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eAccountByTopAccount,
MyMoneyReport::eQCshares | MyMoneyReport::eQCprice,
MyMoneyReport::QueryColumns::Shares | MyMoneyReport::QueryColumns::Price,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Investment Holdings by Account"),
......@@ -1401,7 +1401,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eEquityType,
MyMoneyReport::eQCshares | MyMoneyReport::eQCprice,
MyMoneyReport::QueryColumns::Shares | MyMoneyReport::QueryColumns::Price,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Investment Holdings by Type"),
......@@ -1411,7 +1411,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eAccountByTopAccount,
MyMoneyReport::eQCperformance,
MyMoneyReport::QueryColumns::Performance,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Investment Performance by Account"),
......@@ -1421,7 +1421,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eEquityType,
MyMoneyReport::eQCperformance,
MyMoneyReport::QueryColumns::Performance,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Investment Performance by Type"),
......@@ -1532,7 +1532,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eCategory,
MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount,
MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Tax Transactions by Category"),
......@@ -1541,7 +1541,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.back().setTax(true);
list.push_back(MyMoneyReport(
MyMoneyReport::ePayee,
MyMoneyReport::eQCnumber | MyMoneyReport::eQCcategory | MyMoneyReport::eQCaccount,
MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Account,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Tax Transactions by Payee"),
......@@ -1550,7 +1550,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.back().setTax(true);
list.push_back(MyMoneyReport(
MyMoneyReport::eCategory,
MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount,
MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account,
MyMoneyTransactionFilter::lastFiscalYear,
MyMoneyReport::eDetailAll,
i18n("Tax Transactions by Category Last Fiscal Year"),
......@@ -1559,7 +1559,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.back().setTax(true);
list.push_back(MyMoneyReport(
MyMoneyReport::ePayee,
MyMoneyReport::eQCnumber | MyMoneyReport::eQCcategory | MyMoneyReport::eQCaccount,
MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Account,
MyMoneyTransactionFilter::lastFiscalYear,
MyMoneyReport::eDetailAll,
i18n("Tax Transactions by Payee Last Fiscal Year"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment