Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/mymoneyreport.cpp
Show All 35 Lines | |||||
36 | 36 | | |||
37 | 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(','); | 37 | 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(','); | ||
38 | 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 }; | 38 | 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 }; | ||
39 | const QStringList MyMoneyReport::Column::kTypeText = QString("none,months,bimonths,quarters,4,5,6,weeks,8,9,10,11,years").split(','); | 39 | const QStringList MyMoneyReport::Column::kTypeText = QString("none,months,bimonths,quarters,4,5,6,weeks,8,9,10,11,years").split(','); | ||
40 | // if you add names here, don't forget to update the bitmap for QueryColumns::Type | 40 | // if you add names here, don't forget to update the bitmap for QueryColumns::Type | ||
41 | // and shift the bit for QueryColumns::end one position to the left | 41 | // and shift the bit for QueryColumns::end one position to the left | ||
42 | const QStringList MyMoneyReport::QueryColumns::kText = QString("none,number,payee,category,tag,memo,account,reconcileflag,action,shares,price,performance,loan,balance").split(','); | 42 | const QStringList MyMoneyReport::QueryColumns::kText = QString("none,number,payee,category,tag,memo,account,reconcileflag,action,shares,price,performance,loan,balance").split(','); | ||
43 | const QStringList MyMoneyReport::DetailLevel::kText = QString("none,all,top,group,total,invalid").split(','); | 43 | const QStringList MyMoneyReport::DetailLevel::kText = QString("none,all,top,group,total,invalid").split(','); | ||
44 | const QStringList MyMoneyReport::kChartTypeText = QString("none,line,bar,pie,ring,stackedbar,invalid").split(','); | 44 | const QStringList MyMoneyReport::Chart::kText = QString("none,line,bar,pie,ring,stackedbar,invalid").split(','); | ||
45 | 45 | | |||
46 | // This should live in mymoney/mymoneytransactionfilter.h | 46 | // This should live in mymoney/mymoneytransactionfilter.h | ||
47 | const QStringList kTypeText = QString("all,payments,deposits,transfers,none").split(','); | 47 | const QStringList kTypeText = QString("all,payments,deposits,transfers,none").split(','); | ||
48 | const QStringList kStateText = QString("all,notreconciled,cleared,reconciled,frozen,none").split(','); | 48 | const QStringList kStateText = QString("all,notreconciled,cleared,reconciled,frozen,none").split(','); | ||
49 | const QStringList kDateLockText = QString("alldates,untiltoday,currentmonth,currentyear,monthtodate,yeartodate,yeartomonth,lastmonth,lastyear,last7days,last30days,last3months,last6months,last12months,next7days,next30days,next3months,next6months,next12months,userdefined,last3tonext3months,last11Months,currentQuarter,lastQuarter,nextQuarter,currentFiscalYear,lastFiscalYear,today,next18months").split(','); | 49 | const QStringList kDateLockText = QString("alldates,untiltoday,currentmonth,currentyear,monthtodate,yeartodate,yeartomonth,lastmonth,lastyear,last7days,last30days,last3months,last6months,last12months,next7days,next30days,next3months,next6months,next12months,userdefined,last3tonext3months,last11Months,currentQuarter,lastQuarter,nextQuarter,currentFiscalYear,lastFiscalYear,today,next18months").split(','); | ||
50 | const QStringList kAccountTypeText = QString("unknown,checkings,savings,cash,creditcard,loan,certificatedep,investment,moneymarket,asset,liability,currency,income,expense,assetloan,stock,equity,invalid").split(','); | 50 | const QStringList kAccountTypeText = QString("unknown,checkings,savings,cash,creditcard,loan,certificatedep,investment,moneymarket,asset,liability,currency,income,expense,assetloan,stock,equity,invalid").split(','); | ||
51 | 51 | | |||
52 | QString MyMoneyReport::Row::toString(Type type) | 52 | QString MyMoneyReport::Row::toString(Type type) | ||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 92 | MyMoneyReport::MyMoneyReport() : | |||
99 | m_loans(false), | 99 | m_loans(false), | ||
100 | m_reportType(Report::kTypeArray[Row::ExpenseIncome]), | 100 | m_reportType(Report::kTypeArray[Row::ExpenseIncome]), | ||
101 | m_rowType(Row::ExpenseIncome), | 101 | m_rowType(Row::ExpenseIncome), | ||
102 | m_columnType(Column::Months), | 102 | m_columnType(Column::Months), | ||
103 | m_columnsAreDays(false), | 103 | m_columnsAreDays(false), | ||
104 | m_queryColumns(QueryColumns::None), | 104 | m_queryColumns(QueryColumns::None), | ||
105 | m_dateLock(userDefined), | 105 | m_dateLock(userDefined), | ||
106 | m_accountGroupFilter(false), | 106 | m_accountGroupFilter(false), | ||
107 | m_chartType(eChartLine), | 107 | m_chartType(Chart::Line), | ||
108 | m_chartDataLabels(true), | 108 | m_chartDataLabels(true), | ||
109 | m_chartGridLines(true), | 109 | m_chartGridLines(true), | ||
110 | m_chartByDefault(false), | 110 | m_chartByDefault(false), | ||
111 | m_includeSchedules(false), | 111 | m_includeSchedules(false), | ||
112 | m_includeTransfers(false), | 112 | m_includeTransfers(false), | ||
113 | m_includeBudgetActuals(false), | 113 | m_includeBudgetActuals(false), | ||
114 | m_includeUnusedAccounts(false), | 114 | m_includeUnusedAccounts(false), | ||
115 | m_showRowTotals(false), | 115 | m_showRowTotals(false), | ||
Show All 29 Lines | 137 | MyMoneyReport::MyMoneyReport(Row::Type _rt, unsigned _ct, dateOptionE _dl, DetailLevel::Type _ss, const QString& _name, const QString& _comment) : | |||
145 | m_loans(false), | 145 | m_loans(false), | ||
146 | m_reportType(Report::kTypeArray[_rt]), | 146 | m_reportType(Report::kTypeArray[_rt]), | ||
147 | m_rowType(_rt), | 147 | m_rowType(_rt), | ||
148 | m_columnType(Column::Months), | 148 | m_columnType(Column::Months), | ||
149 | m_columnsAreDays(false), | 149 | m_columnsAreDays(false), | ||
150 | m_queryColumns(QueryColumns::None), | 150 | m_queryColumns(QueryColumns::None), | ||
151 | m_dateLock(_dl), | 151 | m_dateLock(_dl), | ||
152 | m_accountGroupFilter(false), | 152 | m_accountGroupFilter(false), | ||
153 | m_chartType(eChartLine), | 153 | m_chartType(Chart::Line), | ||
154 | m_chartDataLabels(true), | 154 | m_chartDataLabels(true), | ||
155 | m_chartGridLines(true), | 155 | m_chartGridLines(true), | ||
156 | m_chartByDefault(false), | 156 | m_chartByDefault(false), | ||
157 | m_includeSchedules(false), | 157 | m_includeSchedules(false), | ||
158 | m_includeTransfers(false), | 158 | m_includeTransfers(false), | ||
159 | m_includeBudgetActuals(false), | 159 | m_includeBudgetActuals(false), | ||
160 | m_includeUnusedAccounts(false), | 160 | m_includeUnusedAccounts(false), | ||
161 | m_showRowTotals(false), | 161 | m_showRowTotals(false), | ||
▲ Show 20 Lines • Show All 256 Lines • ▼ Show 20 Line(s) | 388 | { | |||
418 | e.setAttribute("includesforecast", m_includeForecast); | 418 | e.setAttribute("includesforecast", m_includeForecast); | ||
419 | e.setAttribute("includesprice", m_includePrice); | 419 | e.setAttribute("includesprice", m_includePrice); | ||
420 | e.setAttribute("includesaverageprice", m_includeAveragePrice); | 420 | e.setAttribute("includesaverageprice", m_includeAveragePrice); | ||
421 | e.setAttribute("mixedtime", m_mixedTime); | 421 | e.setAttribute("mixedtime", m_mixedTime); | ||
422 | e.setAttribute("includesmovingaverage", m_includeMovingAverage); | 422 | e.setAttribute("includesmovingaverage", m_includeMovingAverage); | ||
423 | if (m_includeMovingAverage) | 423 | if (m_includeMovingAverage) | ||
424 | e.setAttribute("movingaveragedays", m_movingAverageDays); | 424 | e.setAttribute("movingaveragedays", m_movingAverageDays); | ||
425 | 425 | | |||
426 | if (m_chartType < 0 || m_chartType >= kChartTypeText.size()) { | 426 | if (m_chartType < 0 || m_chartType >= Chart::kText.size()) { | ||
427 | qDebug("m_chartType out of bounds with %d on report of type %d. Default to none.", m_chartType, m_reportType); | 427 | qDebug("m_chartType out of bounds with %d on report of type %d. Default to none.", m_chartType, m_reportType); | ||
428 | e.setAttribute("charttype", kChartTypeText[0]); | 428 | e.setAttribute("charttype", Chart::kText[0]); | ||
429 | } else { | 429 | } else { | ||
430 | e.setAttribute("charttype", kChartTypeText[m_chartType]); | 430 | e.setAttribute("charttype", Chart::kText[m_chartType]); | ||
431 | } | 431 | } | ||
432 | e.setAttribute("chartdatalabels", m_chartDataLabels); | 432 | e.setAttribute("chartdatalabels", m_chartDataLabels); | ||
433 | e.setAttribute("chartgridlines", m_chartGridLines); | 433 | e.setAttribute("chartgridlines", m_chartGridLines); | ||
434 | e.setAttribute("chartbydefault", m_chartByDefault); | 434 | e.setAttribute("chartbydefault", m_chartByDefault); | ||
435 | e.setAttribute("chartlinewidth", m_chartLineWidth); | 435 | e.setAttribute("chartlinewidth", m_chartLineWidth); | ||
436 | e.setAttribute("skipZero", m_skipZero); | 436 | e.setAttribute("skipZero", m_skipZero); | ||
437 | 437 | | |||
438 | if (m_reportType == Report::PivotTable) { | 438 | if (m_reportType == Report::PivotTable) { | ||
▲ Show 20 Lines • Show All 273 Lines • ▼ Show 20 Line(s) | 660 | ) { | |||
712 | m_includeAveragePrice = e.attribute("includesaverageprice", "0").toUInt(); | 712 | m_includeAveragePrice = e.attribute("includesaverageprice", "0").toUInt(); | ||
713 | m_mixedTime = e.attribute("mixedtime", "0").toUInt(); | 713 | m_mixedTime = e.attribute("mixedtime", "0").toUInt(); | ||
714 | m_includeMovingAverage = e.attribute("includesmovingaverage", "0").toUInt(); | 714 | m_includeMovingAverage = e.attribute("includesmovingaverage", "0").toUInt(); | ||
715 | m_skipZero = e.attribute("skipZero", "0").toUInt(); | 715 | m_skipZero = e.attribute("skipZero", "0").toUInt(); | ||
716 | if (m_includeMovingAverage) | 716 | if (m_includeMovingAverage) | ||
717 | m_movingAverageDays = e.attribute("movingaveragedays", "1").toUInt(); | 717 | m_movingAverageDays = e.attribute("movingaveragedays", "1").toUInt(); | ||
718 | 718 | | |||
719 | //only load chart data if it is a pivot table | 719 | //only load chart data if it is a pivot table | ||
720 | m_chartType = static_cast<EChartType>(0); | 720 | m_chartType = static_cast<Chart::Type>(0); | ||
721 | if (m_reportType == Report::PivotTable) { | 721 | if (m_reportType == Report::PivotTable) { | ||
722 | i = kChartTypeText.indexOf(e.attribute("charttype")); | 722 | i = Chart::kText.indexOf(e.attribute("charttype")); | ||
723 | 723 | | |||
724 | if (i >= 0) | 724 | if (i >= 0) | ||
725 | m_chartType = static_cast<EChartType>(i); | 725 | m_chartType = static_cast<Chart::Type>(i); | ||
726 | 726 | | |||
727 | // if it is invalid, set to first type | 727 | // if it is invalid, set to first type | ||
728 | if (m_chartType >= eChartEnd) | 728 | if (m_chartType >= Chart::End) | ||
729 | m_chartType = eChartLine; | 729 | m_chartType = Chart::Line; | ||
730 | 730 | | |||
731 | m_chartDataLabels = e.attribute("chartdatalabels", "1").toUInt(); | 731 | m_chartDataLabels = e.attribute("chartdatalabels", "1").toUInt(); | ||
732 | m_chartGridLines = e.attribute("chartgridlines", "1").toUInt(); | 732 | m_chartGridLines = e.attribute("chartgridlines", "1").toUInt(); | ||
733 | m_chartByDefault = e.attribute("chartbydefault", "0").toUInt(); | 733 | m_chartByDefault = e.attribute("chartbydefault", "0").toUInt(); | ||
734 | m_chartLineWidth = e.attribute("chartlinewidth", QString(m_lineWidth)).toUInt(); | 734 | m_chartLineWidth = e.attribute("chartlinewidth", QString(m_lineWidth)).toUInt(); | ||
735 | } else { | 735 | } else { | ||
736 | m_chartDataLabels = true; | 736 | m_chartDataLabels = true; | ||
737 | m_chartGridLines = true; | 737 | m_chartGridLines = true; | ||
▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines |