Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/storage/mymoneyseqaccessmgr.cpp
Context not available. | |||||
63 | 63 | | |||
---|---|---|---|---|---|
64 | // setup standard accounts | 64 | // setup standard accounts | ||
65 | MyMoneyAccount acc_l; | 65 | MyMoneyAccount acc_l; | ||
66 | acc_l.setAccountType(MyMoneyAccount::Liability); | 66 | acc_l.setAccountType(eMyMoney::Account::Liability); | ||
67 | acc_l.setName("Liability"); | 67 | acc_l.setName("Liability"); | ||
68 | MyMoneyAccount liability(STD_ACC_LIABILITY, acc_l); | 68 | MyMoneyAccount liability(STD_ACC_LIABILITY, acc_l); | ||
69 | 69 | | |||
70 | MyMoneyAccount acc_a; | 70 | MyMoneyAccount acc_a; | ||
71 | acc_a.setAccountType(MyMoneyAccount::Asset); | 71 | acc_a.setAccountType(eMyMoney::Account::Asset); | ||
72 | acc_a.setName("Asset"); | 72 | acc_a.setName("Asset"); | ||
73 | MyMoneyAccount asset(STD_ACC_ASSET, acc_a); | 73 | MyMoneyAccount asset(STD_ACC_ASSET, acc_a); | ||
74 | 74 | | |||
75 | MyMoneyAccount acc_e; | 75 | MyMoneyAccount acc_e; | ||
76 | acc_e.setAccountType(MyMoneyAccount::Expense); | 76 | acc_e.setAccountType(eMyMoney::Account::Expense); | ||
77 | acc_e.setName("Expense"); | 77 | acc_e.setName("Expense"); | ||
78 | MyMoneyAccount expense(STD_ACC_EXPENSE, acc_e); | 78 | MyMoneyAccount expense(STD_ACC_EXPENSE, acc_e); | ||
79 | 79 | | |||
80 | MyMoneyAccount acc_i; | 80 | MyMoneyAccount acc_i; | ||
81 | acc_i.setAccountType(MyMoneyAccount::Income); | 81 | acc_i.setAccountType(eMyMoney::Account::Income); | ||
82 | acc_i.setName("Income"); | 82 | acc_i.setName("Income"); | ||
83 | MyMoneyAccount income(STD_ACC_INCOME, acc_i); | 83 | MyMoneyAccount income(STD_ACC_INCOME, acc_i); | ||
84 | 84 | | |||
85 | MyMoneyAccount acc_q; | 85 | MyMoneyAccount acc_q; | ||
86 | acc_q.setAccountType(MyMoneyAccount::Equity); | 86 | acc_q.setAccountType(eMyMoney::Account::Equity); | ||
87 | acc_q.setName("Equity"); | 87 | acc_q.setName("Equity"); | ||
88 | MyMoneyAccount equity(STD_ACC_EQUITY, acc_q); | 88 | MyMoneyAccount equity(STD_ACC_EQUITY, acc_q); | ||
89 | 89 | | |||
Context not available. | |||||
766 | oldParent = m_accountList.find(account.parentAccountId()); | 766 | oldParent = m_accountList.find(account.parentAccountId()); | ||
767 | } | 767 | } | ||
768 | 768 | | |||
769 | if (account.accountType() == MyMoneyAccount::Stock && parent.accountType() != MyMoneyAccount::Investment) | 769 | if (account.accountType() == eMyMoney::Account::Stock && parent.accountType() != eMyMoney::Account::Investment) | ||
770 | throw MYMONEYEXCEPTION("Cannot move a stock acocunt into a non-investment account"); | 770 | throw MYMONEYEXCEPTION("Cannot move a stock acocunt into a non-investment account"); | ||
771 | 771 | | |||
772 | newParent = m_accountList.find(parent.id()); | 772 | newParent = m_accountList.find(parent.id()); | ||
Context not available. | |||||
789 | 789 | | |||
790 | #if 0 | 790 | #if 0 | ||
791 | // make sure the type is the same as the new parent. This does not work for stock and investment | 791 | // make sure the type is the same as the new parent. This does not work for stock and investment | ||
792 | if (account.accountType() != MyMoneyAccount::Stock && account.accountType() != MyMoneyAccount::Investment) | 792 | if (account.accountType() != eMyMoney::Account::Stock && account.accountType() != eMyMoney::Account::Investment) | ||
793 | (*childAccount).setAccountType((*newParent).accountType()); | 793 | (*childAccount).setAccountType((*newParent).accountType()); | ||
794 | #endif | 794 | #endif | ||
795 | } | 795 | } | ||
Context not available. | |||||
1029 | MyMoneyAccount acc = m_accountList[account]; | 1029 | MyMoneyAccount acc = m_accountList[account]; | ||
1030 | MyMoneyTransactionFilter filter; | 1030 | MyMoneyTransactionFilter filter; | ||
1031 | 1031 | | |||
1032 | if (acc.accountGroup() == MyMoneyAccount::Income | 1032 | if (acc.accountGroup() == eMyMoney::Account::Income | ||
1033 | || acc.accountGroup() == MyMoneyAccount::Expense) | 1033 | || acc.accountGroup() == eMyMoney::Account::Expense) | ||
1034 | filter.addCategory(account); | 1034 | filter.addCategory(account); | ||
1035 | else | 1035 | else | ||
1036 | filter.addAccount(account); | 1036 | filter.addAccount(account); | ||
Context not available. | |||||
1400 | 1400 | | |||
1401 | const QList<MyMoneySchedule> MyMoneySeqAccessMgr::scheduleList( | 1401 | const QList<MyMoneySchedule> MyMoneySeqAccessMgr::scheduleList( | ||
1402 | const QString& accountId, | 1402 | const QString& accountId, | ||
1403 | const MyMoneySchedule::typeE type, | 1403 | const eMyMoney::Schedule::Type type, | ||
1404 | const MyMoneySchedule::occurrenceE occurrence, | 1404 | const eMyMoney::Schedule::Occurrence occurrence, | ||
1405 | const MyMoneySchedule::paymentTypeE paymentType, | 1405 | const eMyMoney::Schedule::PaymentType paymentType, | ||
1406 | const QDate& startDate, | 1406 | const QDate& startDate, | ||
1407 | const QDate& endDate, | 1407 | const QDate& endDate, | ||
1408 | const bool overdue) const | 1408 | const bool overdue) const | ||
Context not available. | |||||
1415 | for (pos = m_scheduleList.begin(); pos != m_scheduleList.end(); ++pos) { | 1415 | for (pos = m_scheduleList.begin(); pos != m_scheduleList.end(); ++pos) { | ||
1416 | // qDebug(" '%s'", qPrintable((*pos).id())); | 1416 | // qDebug(" '%s'", qPrintable((*pos).id())); | ||
1417 | 1417 | | |||
1418 | if (type != MyMoneySchedule::TYPE_ANY) { | 1418 | if (type != eMyMoney::Schedule::Type::Any) { | ||
1419 | if (type != (*pos).type()) { | 1419 | if (type != (*pos).type()) { | ||
1420 | continue; | 1420 | continue; | ||
1421 | } | 1421 | } | ||
1422 | } | 1422 | } | ||
1423 | 1423 | | |||
1424 | if (occurrence != MyMoneySchedule::OCCUR_ANY) { | 1424 | if (occurrence != eMyMoney::Schedule::Occurrence::Any) { | ||
1425 | if (occurrence != (*pos).occurrence()) { | 1425 | if (occurrence != (*pos).occurrence()) { | ||
1426 | continue; | 1426 | continue; | ||
1427 | } | 1427 | } | ||
1428 | } | 1428 | } | ||
1429 | 1429 | | |||
1430 | if (paymentType != MyMoneySchedule::STYPE_ANY) { | 1430 | if (paymentType != eMyMoney::Schedule::PaymentType::Any) { | ||
1431 | if (paymentType != (*pos).paymentType()) { | 1431 | if (paymentType != (*pos).paymentType()) { | ||
1432 | continue; | 1432 | continue; | ||
1433 | } | 1433 | } | ||
Context not available. | |||||
1514 | return list; | 1514 | return list; | ||
1515 | 1515 | | |||
1516 | for (pos = m_scheduleList.begin(); pos != m_scheduleList.end(); ++pos) { | 1516 | for (pos = m_scheduleList.begin(); pos != m_scheduleList.end(); ++pos) { | ||
1517 | if (scheduleTypes && !(scheduleTypes & (*pos).type())) | 1517 | if (scheduleTypes && !(scheduleTypes & (int)(*pos).type())) | ||
1518 | continue; | 1518 | continue; | ||
1519 | 1519 | | |||
1520 | if (scheduleOcurrences && !(scheduleOcurrences & (*pos).occurrence())) | 1520 | if (scheduleOcurrences && !(scheduleOcurrences & (int)(*pos).occurrence())) | ||
1521 | continue; | 1521 | continue; | ||
1522 | 1522 | | |||
1523 | if (schedulePaymentTypes && !(schedulePaymentTypes & (*pos).paymentType())) | 1523 | if (schedulePaymentTypes && !(schedulePaymentTypes & (int)(*pos).paymentType())) | ||
1524 | continue; | 1524 | continue; | ||
1525 | 1525 | | |||
1526 | if ((*pos).paymentDates(date, date).count() == 0) | 1526 | if ((*pos).paymentDates(date, date).count() == 0) | ||
Context not available. |