Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/mymoneytransactionfilter.cpp
Context not available. | |||||
32 | // Project Includes | 32 | // Project Includes | ||
---|---|---|---|---|---|
33 | 33 | | |||
34 | #include "mymoneyfile.h" | 34 | #include "mymoneyfile.h" | ||
35 | #include "mymoneyaccount.h" | ||||
36 | #include "mymoneypayee.h" | ||||
37 | #include "mymoneytag.h" | ||||
38 | #include "mymoneytransaction.h" | ||||
35 | 39 | | |||
36 | MyMoneyTransactionFilter::MyMoneyTransactionFilter() | 40 | MyMoneyTransactionFilter::MyMoneyTransactionFilter() | ||
37 | { | 41 | { | ||
Context not available. | |||||
337 | const MyMoneyAccount& acc = file->account(s->accountId()); | 341 | const MyMoneyAccount& acc = file->account(s->accountId()); | ||
338 | if (m_considerCategory) { | 342 | if (m_considerCategory) { | ||
339 | switch (acc.accountGroup()) { | 343 | switch (acc.accountGroup()) { | ||
340 | case MyMoneyAccount::Income: | 344 | case eMyMoney::Account::Income: | ||
341 | case MyMoneyAccount::Expense: | 345 | case eMyMoney::Account::Expense: | ||
342 | isTransfer = false; | 346 | isTransfer = false; | ||
343 | // check if the split references one of the categories in the list | 347 | // check if the split references one of the categories in the list | ||
344 | if (m_filterSet.singleFilter.categoryFilter) { | 348 | if (m_filterSet.singleFilter.categoryFilter) { | ||
Context not available. | |||||
420 | // Determine if this account is a category or an account | 424 | // Determine if this account is a category or an account | ||
421 | bool isCategory = false; | 425 | bool isCategory = false; | ||
422 | switch (acc.accountGroup()) { | 426 | switch (acc.accountGroup()) { | ||
423 | case MyMoneyAccount::Income: | 427 | case eMyMoney::Account::Income: | ||
424 | case MyMoneyAccount::Expense: | 428 | case eMyMoney::Account::Expense: | ||
425 | isCategory = true; | 429 | isCategory = true; | ||
426 | default: | 430 | default: | ||
427 | break; | 431 | break; | ||
Context not available. | |||||
512 | 516 | | |||
513 | int MyMoneyTransactionFilter::splitState(const MyMoneySplit& split) const | 517 | int MyMoneyTransactionFilter::splitState(const MyMoneySplit& split) const | ||
514 | { | 518 | { | ||
515 | int rc = notReconciled; | 519 | int rc = (int)eMyMoney::TransactionFilter::State::NotReconciled; | ||
516 | 520 | | |||
517 | switch (split.reconcileFlag()) { | 521 | switch (split.reconcileFlag()) { | ||
518 | default: | 522 | default: | ||
Context not available. | |||||
520 | break;; | 524 | break;; | ||
521 | 525 | | |||
522 | case MyMoneySplit::Cleared: | 526 | case MyMoneySplit::Cleared: | ||
523 | rc = cleared; | 527 | rc = (int)eMyMoney::TransactionFilter::State::Cleared; | ||
524 | break; | 528 | break; | ||
525 | 529 | | |||
526 | case MyMoneySplit::Reconciled: | 530 | case MyMoneySplit::Reconciled: | ||
527 | rc = reconciled; | 531 | rc = (int)eMyMoney::TransactionFilter::State::Reconciled; | ||
528 | break; | 532 | break; | ||
529 | 533 | | |||
530 | case MyMoneySplit::Frozen: | 534 | case MyMoneySplit::Frozen: | ||
531 | rc = frozen; | 535 | rc = (int)eMyMoney::TransactionFilter::State::Frozen; | ||
532 | break; | 536 | break; | ||
533 | } | 537 | } | ||
534 | return rc; | 538 | return rc; | ||
Context not available. | |||||
539 | MyMoneyFile* file = MyMoneyFile::instance(); | 543 | MyMoneyFile* file = MyMoneyFile::instance(); | ||
540 | MyMoneyAccount a, b; | 544 | MyMoneyAccount a, b; | ||
541 | a = file->account(split.accountId()); | 545 | a = file->account(split.accountId()); | ||
542 | if ((a.accountGroup() == MyMoneyAccount::Income | 546 | if ((a.accountGroup() == eMyMoney::Account::Income | ||
543 | || a.accountGroup() == MyMoneyAccount::Expense)) | 547 | || a.accountGroup() == eMyMoney::Account::Expense)) | ||
544 | return allTypes; | 548 | return allTypes; | ||
545 | 549 | | |||
546 | if (t.splitCount() == 2) { | 550 | if (t.splitCount() == 2) { | ||
Context not available. | |||||
552 | 556 | | |||
553 | a = file->account(ida); | 557 | a = file->account(ida); | ||
554 | b = file->account(idb); | 558 | b = file->account(idb); | ||
555 | if ((a.accountGroup() != MyMoneyAccount::Expense | 559 | if ((a.accountGroup() != eMyMoney::Account::Expense | ||
556 | && a.accountGroup() != MyMoneyAccount::Income) | 560 | && a.accountGroup() != eMyMoney::Account::Income) | ||
557 | && (b.accountGroup() != MyMoneyAccount::Expense | 561 | && (b.accountGroup() != eMyMoney::Account::Expense | ||
558 | && b.accountGroup() != MyMoneyAccount::Income)) | 562 | && b.accountGroup() != eMyMoney::Account::Income)) | ||
559 | return transfers; | 563 | return transfers; | ||
560 | } | 564 | } | ||
561 | 565 | | |||
Context not available. |