Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/reports/objectinfotable.cpp
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Line(s) | 65 | { | |||
---|---|---|---|---|---|
67 | // directly in ctors somehow does not work for me (ipwizard)) | 67 | // directly in ctors somehow does not work for me (ipwizard)) | ||
68 | // TODO: remove the init() method and move the code back to the ctor | 68 | // TODO: remove the init() method and move the code back to the ctor | ||
69 | init(); | 69 | init(); | ||
70 | } | 70 | } | ||
71 | 71 | | |||
72 | void ObjectInfoTable::init() | 72 | void ObjectInfoTable::init() | ||
73 | { | 73 | { | ||
74 | switch (m_config.rowType()) { | 74 | switch (m_config.rowType()) { | ||
75 | case MyMoneyReport::eSchedule: | 75 | case MyMoneyReport::Row::Schedule: | ||
76 | constructScheduleTable(); | 76 | constructScheduleTable(); | ||
77 | m_columns = "nextduedate,name"; | 77 | m_columns = "nextduedate,name"; | ||
78 | break; | 78 | break; | ||
79 | case MyMoneyReport::eAccountInfo: | 79 | case MyMoneyReport::Row::AccountInfo: | ||
80 | constructAccountTable(); | 80 | constructAccountTable(); | ||
81 | m_columns = "institution,type,name"; | 81 | m_columns = "institution,type,name"; | ||
82 | break; | 82 | break; | ||
83 | case MyMoneyReport::eAccountLoanInfo: | 83 | case MyMoneyReport::Row::AccountLoanInfo: | ||
84 | constructAccountLoanTable(); | 84 | constructAccountLoanTable(); | ||
85 | m_columns = "institution,type,name"; | 85 | m_columns = "institution,type,name"; | ||
86 | break; | 86 | break; | ||
87 | default: | 87 | default: | ||
88 | break; | 88 | break; | ||
89 | } | 89 | } | ||
90 | 90 | | |||
91 | // Sort the data to match the report definition | 91 | // Sort the data to match the report definition | ||
92 | m_subtotal = "value"; | 92 | m_subtotal = "value"; | ||
93 | 93 | | |||
94 | switch (m_config.rowType()) { | 94 | switch (m_config.rowType()) { | ||
95 | case MyMoneyReport::eSchedule: | 95 | case MyMoneyReport::Row::Schedule: | ||
96 | m_group = "type"; | 96 | m_group = "type"; | ||
97 | m_subtotal = "value"; | 97 | m_subtotal = "value"; | ||
98 | break; | 98 | break; | ||
99 | case MyMoneyReport::eAccountInfo: | 99 | case MyMoneyReport::Row::AccountInfo: | ||
100 | case MyMoneyReport::eAccountLoanInfo: | 100 | case MyMoneyReport::Row::AccountLoanInfo: | ||
101 | m_group = "topcategory,institution"; | 101 | m_group = "topcategory,institution"; | ||
102 | m_subtotal = "currentbalance"; | 102 | m_subtotal = "currentbalance"; | ||
103 | break; | 103 | break; | ||
104 | default: | 104 | default: | ||
105 | throw MYMONEYEXCEPTION("ObjectInfoTable::ObjectInfoTable(): unhandled row type"); | 105 | throw MYMONEYEXCEPTION("ObjectInfoTable::ObjectInfoTable(): unhandled row type"); | ||
106 | } | 106 | } | ||
107 | 107 | | |||
108 | QString sort = m_group + ',' + m_columns + ",id,rank"; | 108 | QString sort = m_group + ',' + m_columns + ",id,rank"; | ||
109 | 109 | | |||
110 | switch (m_config.rowType()) { | 110 | switch (m_config.rowType()) { | ||
111 | case MyMoneyReport::eSchedule: | 111 | case MyMoneyReport::Row::Schedule: | ||
112 | if (m_config.detailLevel() == MyMoneyReport::eDetailAll) { | 112 | if (m_config.detailLevel() == MyMoneyReport::eDetailAll) { | ||
113 | m_columns = "name,payee,paymenttype,occurence,nextduedate,category"; // krazy:exclude=spelling | 113 | m_columns = "name,payee,paymenttype,occurence,nextduedate,category"; // krazy:exclude=spelling | ||
114 | } else { | 114 | } else { | ||
115 | m_columns = "name,payee,paymenttype,occurence,nextduedate"; // krazy:exclude=spelling | 115 | m_columns = "name,payee,paymenttype,occurence,nextduedate"; // krazy:exclude=spelling | ||
116 | } | 116 | } | ||
117 | break; | 117 | break; | ||
118 | case MyMoneyReport::eAccountInfo: | 118 | case MyMoneyReport::Row::AccountInfo: | ||
119 | m_columns = "type,name,number,description,openingdate,currencyname,balancewarning,maxbalancelimit,creditwarning,maxcreditlimit,tax,favorite"; | 119 | m_columns = "type,name,number,description,openingdate,currencyname,balancewarning,maxbalancelimit,creditwarning,maxcreditlimit,tax,favorite"; | ||
120 | break; | 120 | break; | ||
121 | case MyMoneyReport::eAccountLoanInfo: | 121 | case MyMoneyReport::Row::AccountLoanInfo: | ||
122 | m_columns = "type,name,number,description,openingdate,currencyname,payee,loanamount,interestrate,nextinterestchange,periodicpayment,finalpayment,favorite"; | 122 | m_columns = "type,name,number,description,openingdate,currencyname,payee,loanamount,interestrate,nextinterestchange,periodicpayment,finalpayment,favorite"; | ||
123 | break; | 123 | break; | ||
124 | default: | 124 | default: | ||
125 | m_columns = ""; | 125 | m_columns = ""; | ||
126 | } | 126 | } | ||
127 | 127 | | |||
128 | TableRow::setSortCriteria(sort); | 128 | TableRow::setSortCriteria(sort); | ||
129 | qSort(m_rows); | 129 | qSort(m_rows); | ||
▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines |