Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/reports/querytabletest.cpp
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Line(s) | 91 | try { | |||
---|---|---|---|---|---|
103 | TransactionHelper t2y2(QDate(2005, 5, 1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent); | 103 | TransactionHelper t2y2(QDate(2005, 5, 1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent); | ||
104 | TransactionHelper t3y2(QDate(2005, 9, 1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent); | 104 | TransactionHelper t3y2(QDate(2005, 9, 1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent); | ||
105 | TransactionHelper t4y2(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); | 105 | TransactionHelper t4y2(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); | ||
106 | 106 | | |||
107 | unsigned cols; | 107 | unsigned cols; | ||
108 | 108 | | |||
109 | MyMoneyReport filter; | 109 | MyMoneyReport filter; | ||
110 | filter.setRowType(MyMoneyReport::eCategory); | 110 | filter.setRowType(MyMoneyReport::eCategory); | ||
111 | cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; | 111 | cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account; | ||
112 | filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); // | 112 | filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); // | ||
113 | filter.setName("Transactions by Category"); | 113 | filter.setName("Transactions by Category"); | ||
114 | XMLandback(filter); | 114 | XMLandback(filter); | ||
115 | QueryTable qtbl_1(filter); | 115 | QueryTable qtbl_1(filter); | ||
116 | 116 | | |||
117 | writeTabletoHTML(qtbl_1, "Transactions by Category.html"); | 117 | writeTabletoHTML(qtbl_1, "Transactions by Category.html"); | ||
118 | 118 | | |||
119 | QList<ListTable::TableRow> rows = qtbl_1.rows(); | 119 | QList<ListTable::TableRow> rows = qtbl_1.rows(); | ||
120 | 120 | | |||
121 | QVERIFY(rows.count() == 12); | 121 | QVERIFY(rows.count() == 12); | ||
122 | QVERIFY(rows[0]["categorytype"] == "Expense"); | 122 | QVERIFY(rows[0]["categorytype"] == "Expense"); | ||
123 | QVERIFY(rows[0]["category"] == "Parent"); | 123 | QVERIFY(rows[0]["category"] == "Parent"); | ||
124 | QVERIFY(rows[0]["postdate"] == "2004-02-01"); | 124 | QVERIFY(rows[0]["postdate"] == "2004-02-01"); | ||
125 | QVERIFY(rows[11]["categorytype"] == "Expense"); | 125 | QVERIFY(rows[11]["categorytype"] == "Expense"); | ||
126 | QVERIFY(rows[11]["category"] == "Solo"); | 126 | QVERIFY(rows[11]["category"] == "Solo"); | ||
127 | QVERIFY(rows[11]["postdate"] == "2005-01-01"); | 127 | QVERIFY(rows[11]["postdate"] == "2005-01-01"); | ||
128 | 128 | | |||
129 | QString html = qtbl_1.renderBody(); | 129 | QString html = qtbl_1.renderBody(); | ||
130 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Parent") == -(moParent1 + moParent2) * 3); | 130 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Parent") == -(moParent1 + moParent2) * 3); | ||
131 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Parent: Child") == -(moChild) * 3); | 131 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Parent: Child") == -(moChild) * 3); | ||
132 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Solo") == -(moSolo) * 3); | 132 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Solo") == -(moSolo) * 3); | ||
133 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Expense") == -(moParent1 + moParent2 + moSolo + moChild) * 3); | 133 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Expense") == -(moParent1 + moParent2 + moSolo + moChild) * 3); | ||
134 | QVERIFY(searchHTML(html, i18nc("Grand total balance", "Grand Total")) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); | 134 | QVERIFY(searchHTML(html, i18nc("Grand total balance", "Grand Total")) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); | ||
135 | filter.setRowType(MyMoneyReport::eTopCategory); | 135 | filter.setRowType(MyMoneyReport::eTopCategory); | ||
136 | cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; | 136 | cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account; | ||
137 | filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); // | 137 | filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); // | ||
138 | filter.setName("Transactions by Top Category"); | 138 | filter.setName("Transactions by Top Category"); | ||
139 | XMLandback(filter); | 139 | XMLandback(filter); | ||
140 | QueryTable qtbl_2(filter); | 140 | QueryTable qtbl_2(filter); | ||
141 | 141 | | |||
142 | writeTabletoHTML(qtbl_2, "Transactions by Top Category.html"); | 142 | writeTabletoHTML(qtbl_2, "Transactions by Top Category.html"); | ||
143 | 143 | | |||
144 | rows = qtbl_2.rows(); | 144 | rows = qtbl_2.rows(); | ||
145 | 145 | | |||
Show All 11 Lines | |||||
157 | html = qtbl_2.renderBody(); | 157 | html = qtbl_2.renderBody(); | ||
158 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Parent") == -(moParent1 + moParent2 + moChild) * 3); | 158 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Parent") == -(moParent1 + moParent2 + moChild) * 3); | ||
159 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Solo") == -(moSolo) * 3); | 159 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Solo") == -(moSolo) * 3); | ||
160 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Expense") == -(moParent1 + moParent2 + moSolo + moChild) * 3); | 160 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Expense") == -(moParent1 + moParent2 + moSolo + moChild) * 3); | ||
161 | QVERIFY(searchHTML(html, i18nc("Grand total balance", "Grand Total")) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); | 161 | QVERIFY(searchHTML(html, i18nc("Grand total balance", "Grand Total")) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); | ||
162 | 162 | | |||
163 | filter.setRowType(MyMoneyReport::eAccount); | 163 | filter.setRowType(MyMoneyReport::eAccount); | ||
164 | filter.setName("Transactions by Account"); | 164 | filter.setName("Transactions by Account"); | ||
165 | cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; | 165 | cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category; | ||
166 | filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); // | 166 | filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); // | ||
167 | XMLandback(filter); | 167 | XMLandback(filter); | ||
168 | QueryTable qtbl_3(filter); | 168 | QueryTable qtbl_3(filter); | ||
169 | 169 | | |||
170 | writeTabletoHTML(qtbl_3, "Transactions by Account.html"); | 170 | writeTabletoHTML(qtbl_3, "Transactions by Account.html"); | ||
171 | 171 | | |||
172 | rows = qtbl_3.rows(); | 172 | rows = qtbl_3.rows(); | ||
173 | 173 | | |||
174 | #if 1 | 174 | #if 1 | ||
Show All 16 Lines | 190 | #endif | |||
191 | 191 | | |||
192 | html = qtbl_3.renderBody(); | 192 | html = qtbl_3.renderBody(); | ||
193 | QVERIFY(searchHTML(html, i18nc("Total balance for checking account", "Total") + " Checking Account") == -(moSolo) * 3 + moCheckingOpen); | 193 | QVERIFY(searchHTML(html, i18nc("Total balance for checking account", "Total") + " Checking Account") == -(moSolo) * 3 + moCheckingOpen); | ||
194 | QVERIFY(searchHTML(html, i18nc("Total balance for credit card", "Total") + " Credit Card") == -(moParent1 + moParent2 + moChild) * 3 + moCreditOpen); | 194 | QVERIFY(searchHTML(html, i18nc("Total balance for credit card", "Total") + " Credit Card") == -(moParent1 + moParent2 + moChild) * 3 + moCreditOpen); | ||
195 | QVERIFY(searchHTML(html, i18nc("Grand total balance", "Grand Total")) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); | 195 | QVERIFY(searchHTML(html, i18nc("Grand total balance", "Grand Total")) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); | ||
196 | 196 | | |||
197 | filter.setRowType(MyMoneyReport::ePayee); | 197 | filter.setRowType(MyMoneyReport::ePayee); | ||
198 | filter.setName("Transactions by Payee"); | 198 | filter.setName("Transactions by Payee"); | ||
199 | cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCmemo | MyMoneyReport::eQCcategory; | 199 | cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Memo | MyMoneyReport::QueryColumns::Category; | ||
200 | filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); // | 200 | filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); // | ||
201 | XMLandback(filter); | 201 | XMLandback(filter); | ||
202 | QueryTable qtbl_4(filter); | 202 | QueryTable qtbl_4(filter); | ||
203 | 203 | | |||
204 | writeTabletoHTML(qtbl_4, "Transactions by Payee.html"); | 204 | writeTabletoHTML(qtbl_4, "Transactions by Payee.html"); | ||
205 | 205 | | |||
206 | rows = qtbl_4.rows(); | 206 | rows = qtbl_4.rows(); | ||
207 | 207 | | |||
208 | QVERIFY(rows.count() == 12); | 208 | QVERIFY(rows.count() == 12); | ||
209 | QVERIFY(rows[0]["payee"] == "Test Payee"); | 209 | QVERIFY(rows[0]["payee"] == "Test Payee"); | ||
210 | QVERIFY(rows[0]["category"] == "Solo"); | 210 | QVERIFY(rows[0]["category"] == "Solo"); | ||
211 | QVERIFY(rows[0]["postdate"] == "2004-01-01"); | 211 | QVERIFY(rows[0]["postdate"] == "2004-01-01"); | ||
212 | QVERIFY(rows[8]["payee"] == "Test Payee"); | 212 | QVERIFY(rows[8]["payee"] == "Test Payee"); | ||
213 | QVERIFY(rows[8]["category"] == "Parent: Child"); | 213 | QVERIFY(rows[8]["category"] == "Parent: Child"); | ||
214 | QVERIFY(rows[8]["postdate"] == "2004-11-07"); | 214 | QVERIFY(rows[8]["postdate"] == "2004-11-07"); | ||
215 | QVERIFY(rows[11]["payee"] == "Test Payee"); | 215 | QVERIFY(rows[11]["payee"] == "Test Payee"); | ||
216 | QVERIFY(rows[11]["category"] == "Parent"); | 216 | QVERIFY(rows[11]["category"] == "Parent"); | ||
217 | QVERIFY(rows[11]["postdate"] == "2005-09-01"); | 217 | QVERIFY(rows[11]["postdate"] == "2005-09-01"); | ||
218 | 218 | | |||
219 | html = qtbl_4.renderBody(); | 219 | html = qtbl_4.renderBody(); | ||
220 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Test Payee") == -(moParent1 + moParent2 + moSolo + moChild) * 3); | 220 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Test Payee") == -(moParent1 + moParent2 + moSolo + moChild) * 3); | ||
221 | QVERIFY(searchHTML(html, i18nc("Grand total balance", "Grand Total")) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); | 221 | QVERIFY(searchHTML(html, i18nc("Grand total balance", "Grand Total")) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); | ||
222 | 222 | | |||
223 | filter.setRowType(MyMoneyReport::eMonth); | 223 | filter.setRowType(MyMoneyReport::eMonth); | ||
224 | filter.setName("Transactions by Month"); | 224 | filter.setName("Transactions by Month"); | ||
225 | cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; | 225 | cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category; | ||
226 | filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); // | 226 | filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); // | ||
227 | XMLandback(filter); | 227 | XMLandback(filter); | ||
228 | QueryTable qtbl_5(filter); | 228 | QueryTable qtbl_5(filter); | ||
229 | 229 | | |||
230 | writeTabletoHTML(qtbl_5, "Transactions by Month.html"); | 230 | writeTabletoHTML(qtbl_5, "Transactions by Month.html"); | ||
231 | 231 | | |||
232 | rows = qtbl_5.rows(); | 232 | rows = qtbl_5.rows(); | ||
233 | 233 | | |||
234 | QVERIFY(rows.count() == 12); | 234 | QVERIFY(rows.count() == 12); | ||
Show All 10 Lines | |||||
245 | html = qtbl_5.renderBody(); | 245 | html = qtbl_5.renderBody(); | ||
246 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Month of 2004-01-01") == -moSolo); | 246 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Month of 2004-01-01") == -moSolo); | ||
247 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Month of 2004-11-01") == -(moChild) * 3); | 247 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Month of 2004-11-01") == -(moChild) * 3); | ||
248 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Month of 2004-05-01") == -moParent1 + moCheckingOpen); | 248 | QVERIFY(searchHTML(html, i18nc("Total balance", "Total") + " Month of 2004-05-01") == -moParent1 + moCheckingOpen); | ||
249 | QVERIFY(searchHTML(html, i18nc("Grand total balance", "Grand Total")) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); | 249 | QVERIFY(searchHTML(html, i18nc("Grand total balance", "Grand Total")) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); | ||
250 | 250 | | |||
251 | filter.setRowType(MyMoneyReport::eWeek); | 251 | filter.setRowType(MyMoneyReport::eWeek); | ||
252 | filter.setName("Transactions by Week"); | 252 | filter.setName("Transactions by Week"); | ||
253 | cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; | 253 | cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category; | ||
254 | filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); // | 254 | filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); // | ||
255 | XMLandback(filter); | 255 | XMLandback(filter); | ||
256 | QueryTable qtbl_6(filter); | 256 | QueryTable qtbl_6(filter); | ||
257 | 257 | | |||
258 | writeTabletoHTML(qtbl_6, "Transactions by Week.html"); | 258 | writeTabletoHTML(qtbl_6, "Transactions by Week.html"); | ||
259 | 259 | | |||
260 | rows = qtbl_6.rows(); | 260 | rows = qtbl_6.rows(); | ||
261 | 261 | | |||
262 | QVERIFY(rows.count() == 12); | 262 | QVERIFY(rows.count() == 12); | ||
▲ Show 20 Lines • Show All 185 Lines • ▼ Show 20 Line(s) | 424 | try { | |||
448 | makeEquityPrice(eqStock1, QDate(2004, 10, 1), MyMoneyMoney(100.00)); | 448 | makeEquityPrice(eqStock1, QDate(2004, 10, 1), MyMoneyMoney(100.00)); | ||
449 | 449 | | |||
450 | // | 450 | // | ||
451 | // Investment Transactions Report | 451 | // Investment Transactions Report | ||
452 | // | 452 | // | ||
453 | 453 | | |||
454 | MyMoneyReport invtran_r( | 454 | MyMoneyReport invtran_r( | ||
455 | MyMoneyReport::eTopAccount, | 455 | MyMoneyReport::eTopAccount, | ||
456 | MyMoneyReport::eQCaction | MyMoneyReport::eQCshares | MyMoneyReport::eQCprice, | 456 | MyMoneyReport::QueryColumns::Action | MyMoneyReport::QueryColumns::Shares | MyMoneyReport::QueryColumns::Price, | ||
457 | MyMoneyTransactionFilter::userDefined, | 457 | MyMoneyTransactionFilter::userDefined, | ||
458 | MyMoneyReport::eDetailAll, | 458 | MyMoneyReport::eDetailAll, | ||
459 | i18n("Investment Transactions"), | 459 | i18n("Investment Transactions"), | ||
460 | i18n("Test Report") | 460 | i18n("Test Report") | ||
461 | ); | 461 | ); | ||
462 | invtran_r.setDateFilter(QDate(2004, 1, 1), QDate(2004, 12, 31)); | 462 | invtran_r.setDateFilter(QDate(2004, 1, 1), QDate(2004, 12, 31)); | ||
463 | invtran_r.setInvestmentsOnly(true); | 463 | invtran_r.setInvestmentsOnly(true); | ||
464 | XMLandback(invtran_r); | 464 | XMLandback(invtran_r); | ||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | |||||
540 | #endif | 540 | #endif | ||
541 | 541 | | |||
542 | // | 542 | // | ||
543 | // Investment Performance Report | 543 | // Investment Performance Report | ||
544 | // | 544 | // | ||
545 | 545 | | |||
546 | MyMoneyReport invhold_r( | 546 | MyMoneyReport invhold_r( | ||
547 | MyMoneyReport::eAccountByTopAccount, | 547 | MyMoneyReport::eAccountByTopAccount, | ||
548 | MyMoneyReport::eQCperformance, | 548 | MyMoneyReport::QueryColumns::Performance, | ||
549 | MyMoneyTransactionFilter::userDefined, | 549 | MyMoneyTransactionFilter::userDefined, | ||
550 | MyMoneyReport::eDetailAll, | 550 | MyMoneyReport::eDetailAll, | ||
551 | i18n("Investment Performance by Account"), | 551 | i18n("Investment Performance by Account"), | ||
552 | i18n("Test Report") | 552 | i18n("Test Report") | ||
553 | ); | 553 | ); | ||
554 | invhold_r.setDateFilter(QDate(2004, 1, 1), QDate(2004, 10, 1)); | 554 | invhold_r.setDateFilter(QDate(2004, 1, 1), QDate(2004, 10, 1)); | ||
555 | invhold_r.setInvestmentsOnly(true); | 555 | invhold_r.setInvestmentsOnly(true); | ||
556 | XMLandback(invhold_r); | 556 | XMLandback(invhold_r); | ||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | 596 | try { | |||
610 | TransactionHelper t4y2(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); | 610 | TransactionHelper t4y2(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); | ||
611 | 611 | | |||
612 | unsigned cols; | 612 | unsigned cols; | ||
613 | 613 | | |||
614 | MyMoneyReport filter; | 614 | MyMoneyReport filter; | ||
615 | 615 | | |||
616 | filter.setRowType(MyMoneyReport::eAccount); | 616 | filter.setRowType(MyMoneyReport::eAccount); | ||
617 | filter.setName("Transactions by Account"); | 617 | filter.setName("Transactions by Account"); | ||
618 | cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance; | 618 | cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Balance; | ||
619 | filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); // | 619 | filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); // | ||
620 | XMLandback(filter); | 620 | XMLandback(filter); | ||
621 | QueryTable qtbl_3(filter); | 621 | QueryTable qtbl_3(filter); | ||
622 | 622 | | |||
623 | writeTabletoHTML(qtbl_3, "Transactions by Account.html"); | 623 | writeTabletoHTML(qtbl_3, "Transactions by Account.html"); | ||
624 | 624 | | |||
625 | QString html = qtbl_3.renderBody(); | 625 | QString html = qtbl_3.renderBody(); | ||
626 | 626 | | |||
627 | QList<ListTable::TableRow> rows = qtbl_3.rows(); | 627 | QList<ListTable::TableRow> rows = qtbl_3.rows(); | ||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | 646 | try { | |||
672 | TransactionHelper t7(intermediateDate, MyMoneySplit::ActionWithdrawal, MyMoneyMoney(moJpyTransaction), acJpyChecking, acSolo, "JPY"); | 672 | TransactionHelper t7(intermediateDate, MyMoneySplit::ActionWithdrawal, MyMoneyMoney(moJpyTransaction), acJpyChecking, acSolo, "JPY"); | ||
673 | 673 | | |||
674 | unsigned cols; | 674 | unsigned cols; | ||
675 | 675 | | |||
676 | MyMoneyReport filter; | 676 | MyMoneyReport filter; | ||
677 | 677 | | |||
678 | filter.setRowType(MyMoneyReport::eAccount); | 678 | filter.setRowType(MyMoneyReport::eAccount); | ||
679 | filter.setName("Transactions by Account"); | 679 | filter.setName("Transactions by Account"); | ||
680 | cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance; | 680 | cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Balance; | ||
681 | filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); | 681 | filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); | ||
682 | // don't convert values to the default currency | 682 | // don't convert values to the default currency | ||
683 | filter.setConvertCurrency(false); | 683 | filter.setConvertCurrency(false); | ||
684 | XMLandback(filter); | 684 | XMLandback(filter); | ||
685 | QueryTable qtbl_3(filter); | 685 | QueryTable qtbl_3(filter); | ||
686 | 686 | | |||
687 | writeTabletoHTML(qtbl_3, "Transactions by Account (multiple currencies).html"); | 687 | writeTabletoHTML(qtbl_3, "Transactions by Account (multiple currencies).html"); | ||
688 | 688 | | |||
689 | QString html = qtbl_3.renderBody(); | 689 | QString html = qtbl_3.renderBody(); | ||
▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Line(s) | 765 | try { | |||
766 | TransactionHelper t1q1(QDate(2004, 1, 1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo); | 766 | TransactionHelper t1q1(QDate(2004, 1, 1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo); | ||
767 | TransactionHelper t2q1(QDate(2004, 2, 1), MyMoneySplit::ActionWithdrawal, moParent1, acChecking, acTax); | 767 | TransactionHelper t2q1(QDate(2004, 2, 1), MyMoneySplit::ActionWithdrawal, moParent1, acChecking, acTax); | ||
768 | 768 | | |||
769 | unsigned cols; | 769 | unsigned cols; | ||
770 | MyMoneyReport filter; | 770 | MyMoneyReport filter; | ||
771 | 771 | | |||
772 | filter.setRowType(MyMoneyReport::eCategory); | 772 | filter.setRowType(MyMoneyReport::eCategory); | ||
773 | filter.setName("Tax Transactions"); | 773 | filter.setName("Tax Transactions"); | ||
774 | cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; | 774 | cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account; | ||
775 | filter.setQueryColumns(static_cast<MyMoneyReport::EQueryColumns>(cols)); | 775 | filter.setQueryColumns(static_cast<MyMoneyReport::QueryColumns::Type>(cols)); | ||
776 | filter.setTax(true); | 776 | filter.setTax(true); | ||
777 | 777 | | |||
778 | XMLandback(filter); | 778 | XMLandback(filter); | ||
779 | QueryTable qtbl_3(filter); | 779 | QueryTable qtbl_3(filter); | ||
780 | 780 | | |||
781 | writeTabletoHTML(qtbl_3, "Tax Transactions.html"); | 781 | writeTabletoHTML(qtbl_3, "Tax Transactions.html"); | ||
782 | 782 | | |||
783 | QList<ListTable::TableRow> rows = qtbl_3.rows(); | 783 | QList<ListTable::TableRow> rows = qtbl_3.rows(); | ||
784 | 784 | | |||
785 | QString html = qtbl_3.renderBody(); | 785 | QString html = qtbl_3.renderBody(); | ||
786 | QVERIFY(rows.count() == 1); | 786 | QVERIFY(rows.count() == 1); | ||
787 | } catch (const MyMoneyException &e) { | 787 | } catch (const MyMoneyException &e) { | ||
788 | QFAIL(qPrintable(e.what())); | 788 | QFAIL(qPrintable(e.what())); | ||
789 | } | 789 | } | ||
790 | } | 790 | } |