Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/reports/querytable.cpp
Show First 20 Lines • Show All 358 Lines • ▼ Show 20 Line(s) | 357 | case MyMoneyReport::eInstitution: | |||
---|---|---|---|---|---|
359 | break; | 359 | break; | ||
360 | 360 | | |||
361 | default: | 361 | default: | ||
362 | m_columns = "postdate"; | 362 | m_columns = "postdate"; | ||
363 | } | 363 | } | ||
364 | 364 | | |||
365 | unsigned qc = m_config.queryColumns(); | 365 | unsigned qc = m_config.queryColumns(); | ||
366 | 366 | | |||
367 | if (qc & MyMoneyReport::eQCnumber) | 367 | if (qc & MyMoneyReport::QueryColumns::Number) | ||
368 | m_columns += ",number"; | 368 | m_columns += ",number"; | ||
369 | if (qc & MyMoneyReport::eQCpayee) | 369 | if (qc & MyMoneyReport::QueryColumns::Payee) | ||
370 | m_columns += ",payee"; | 370 | m_columns += ",payee"; | ||
371 | if (qc & MyMoneyReport::eQCtag) | 371 | if (qc & MyMoneyReport::QueryColumns::Tag) | ||
372 | m_columns += ",tag"; | 372 | m_columns += ",tag"; | ||
373 | if (qc & MyMoneyReport::eQCcategory) | 373 | if (qc & MyMoneyReport::QueryColumns::Category) | ||
374 | m_columns += ",category"; | 374 | m_columns += ",category"; | ||
375 | if (qc & MyMoneyReport::eQCaccount) | 375 | if (qc & MyMoneyReport::QueryColumns::Account) | ||
376 | m_columns += ",account"; | 376 | m_columns += ",account"; | ||
377 | if (qc & MyMoneyReport::eQCreconciled) | 377 | if (qc & MyMoneyReport::QueryColumns::Reconciled) | ||
378 | m_columns += ",reconcileflag"; | 378 | m_columns += ",reconcileflag"; | ||
379 | if (qc & MyMoneyReport::eQCmemo) | 379 | if (qc & MyMoneyReport::QueryColumns::Memo) | ||
380 | m_columns += ",memo"; | 380 | m_columns += ",memo"; | ||
381 | if (qc & MyMoneyReport::eQCaction) | 381 | if (qc & MyMoneyReport::QueryColumns::Action) | ||
382 | m_columns += ",action"; | 382 | m_columns += ",action"; | ||
383 | if (qc & MyMoneyReport::eQCshares) | 383 | if (qc & MyMoneyReport::QueryColumns::Shares) | ||
384 | m_columns += ",shares"; | 384 | m_columns += ",shares"; | ||
385 | if (qc & MyMoneyReport::eQCprice) | 385 | if (qc & MyMoneyReport::QueryColumns::Price) | ||
386 | m_columns += ",price"; | 386 | m_columns += ",price"; | ||
387 | if (qc & MyMoneyReport::eQCperformance) | 387 | if (qc & MyMoneyReport::QueryColumns::Performance) | ||
388 | m_columns += ",startingbal,buys,sells,reinvestincome,cashincome,return,returninvestment"; | 388 | m_columns += ",startingbal,buys,sells,reinvestincome,cashincome,return,returninvestment"; | ||
389 | if (qc & MyMoneyReport::eQCloan) { | 389 | if (qc & MyMoneyReport::QueryColumns::Loan) { | ||
390 | m_columns += ",payment,interest,fees"; | 390 | m_columns += ",payment,interest,fees"; | ||
391 | m_postcolumns = "balance"; | 391 | m_postcolumns = "balance"; | ||
392 | } | 392 | } | ||
393 | if (qc & MyMoneyReport::eQCbalance) | 393 | if (qc & MyMoneyReport::QueryColumns::Balance) | ||
394 | m_postcolumns = "balance"; | 394 | m_postcolumns = "balance"; | ||
395 | 395 | | |||
396 | TableRow::setSortCriteria(sort); | 396 | TableRow::setSortCriteria(sort); | ||
397 | 397 | | |||
398 | qSort(m_rows); | 398 | qSort(m_rows); | ||
399 | } | 399 | } | ||
400 | 400 | | |||
401 | void QueryTable::constructTransactionTable() | 401 | void QueryTable::constructTransactionTable() | ||
▲ Show 20 Lines • Show All 114 Lines • ▼ Show 20 Line(s) | 447 | for (QList<MyMoneyTransaction>::const_iterator it_transaction = transactions.constBegin(); it_transaction != transactions.constEnd(); ++it_transaction) { | |||
516 | } | 516 | } | ||
517 | 517 | | |||
518 | // for "loan" reports, the loan transaction gets special treatment. | 518 | // for "loan" reports, the loan transaction gets special treatment. | ||
519 | // the splits of a loan transaction are placed on one line in the | 519 | // the splits of a loan transaction are placed on one line in the | ||
520 | // reference (loan) account (qA). however, we process the matching | 520 | // reference (loan) account (qA). however, we process the matching | ||
521 | // split entries (qS) normally. | 521 | // split entries (qS) normally. | ||
522 | 522 | | |||
523 | bool loan_special_case = false; | 523 | bool loan_special_case = false; | ||
524 | if (m_config.queryColumns() & MyMoneyReport::eQCloan) { | 524 | if (m_config.queryColumns() & MyMoneyReport::QueryColumns::Loan) { | ||
525 | ReportAccount splitAcc = (*it_split).accountId(); | 525 | ReportAccount splitAcc = (*it_split).accountId(); | ||
526 | loan_special_case = splitAcc.isLoan(); | 526 | loan_special_case = splitAcc.isLoan(); | ||
527 | } | 527 | } | ||
528 | 528 | | |||
529 | bool include_me = true; | 529 | bool include_me = true; | ||
530 | bool transaction_text = false; //indicates whether a text should be considered as a match for the transaction or for a split only | 530 | bool transaction_text = false; //indicates whether a text should be considered as a match for the transaction or for a split only | ||
531 | QString a_fullname = ""; | 531 | QString a_fullname = ""; | ||
532 | QString a_memo = ""; | 532 | QString a_memo = ""; | ||
▲ Show 20 Lines • Show All 764 Lines • ▼ Show 20 Line(s) | 1296 | if (it_split == splits.end()) { | |||
1297 | it_split = splits.begin(); | 1297 | it_split = splits.begin(); | ||
1298 | } | 1298 | } | ||
1299 | 1299 | | |||
1300 | // for "loan" reports, the loan transaction gets special treatment. | 1300 | // for "loan" reports, the loan transaction gets special treatment. | ||
1301 | // the splits of a loan transaction are placed on one line in the | 1301 | // the splits of a loan transaction are placed on one line in the | ||
1302 | // reference (loan) account (qA). however, we process the matching | 1302 | // reference (loan) account (qA). however, we process the matching | ||
1303 | // split entries (qS) normally. | 1303 | // split entries (qS) normally. | ||
1304 | bool loan_special_case = false; | 1304 | bool loan_special_case = false; | ||
1305 | if (m_config.queryColumns() & MyMoneyReport::eQCloan) { | 1305 | if (m_config.queryColumns() & MyMoneyReport::QueryColumns::Loan) { | ||
1306 | ReportAccount splitAcc = (*it_split).accountId(); | 1306 | ReportAccount splitAcc = (*it_split).accountId(); | ||
1307 | loan_special_case = splitAcc.isLoan(); | 1307 | loan_special_case = splitAcc.isLoan(); | ||
1308 | } | 1308 | } | ||
1309 | 1309 | | |||
1310 | // There is a slight chance that at this point myBegin is still pointing to splits.end() if the | 1310 | // There is a slight chance that at this point myBegin is still pointing to splits.end() if the | ||
1311 | // transaction only has income and expense splits (which should not happen). In that case, point | 1311 | // transaction only has income and expense splits (which should not happen). In that case, point | ||
1312 | // it to the first split | 1312 | // it to the first split | ||
1313 | if (myBegin == splits.end()) { | 1313 | if (myBegin == splits.end()) { | ||
▲ Show 20 Lines • Show All 258 Lines • Show Last 20 Lines |