Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/storage/mymoneydatabasemgr.cpp
Context not available. | |||||
926 | 926 | | |||
---|---|---|---|---|---|
927 | void MyMoneyDatabaseMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent) | 927 | void MyMoneyDatabaseMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent) | ||
928 | { | 928 | { | ||
929 | if (account.accountType() == MyMoneyAccount::Stock && parent.accountType() != MyMoneyAccount::Investment) | 929 | if (account.accountType() == eMyMoney::Account::Stock && parent.accountType() != eMyMoney::Account::Investment) | ||
930 | throw MYMONEYEXCEPTION("Cannot move a stock acocunt into a non-investment account"); | 930 | throw MYMONEYEXCEPTION("Cannot move a stock acocunt into a non-investment account"); | ||
931 | 931 | | |||
932 | QStringList accountIdList; | 932 | QStringList accountIdList; | ||
Context not available. | |||||
1219 | QMap<QString, MyMoneyAccount> accountList = m_sql->fetchAccounts(/*QString(id)*/); | 1219 | QMap<QString, MyMoneyAccount> accountList = m_sql->fetchAccounts(/*QString(id)*/); | ||
1220 | //QMap<QString, MyMoneyAccount>::const_iterator accpos = accountList.find(id); | 1220 | //QMap<QString, MyMoneyAccount>::const_iterator accpos = accountList.find(id); | ||
1221 | if (date_ != QDate()) qDebug("request balance for %s at %s", qPrintable(id), qPrintable(date_.toString(Qt::ISODate))); | 1221 | if (date_ != QDate()) qDebug("request balance for %s at %s", qPrintable(id), qPrintable(date_.toString(Qt::ISODate))); | ||
1222 | // if(!date_.isValid() && MyMoneyFile::instance()->account(id).accountType() != MyMoneyAccount::Stock) { | 1222 | // if(!date_.isValid() && MyMoneyFile::instance()->account(id).accountType() != eMyMoney::Account::Stock) { | ||
1223 | // if(accountList.find(id) != accountList.end()) | 1223 | // if(accountList.find(id) != accountList.end()) | ||
1224 | // return accountList[id].balance(); | 1224 | // return accountList[id].balance(); | ||
1225 | // return MyMoneyMoney(0); | 1225 | // return MyMoneyMoney(0); | ||
Context not available. | |||||
1301 | MyMoneyAccount acc = m_sql->fetchAccounts(QStringList(account))[account]; | 1301 | MyMoneyAccount acc = m_sql->fetchAccounts(QStringList(account))[account]; | ||
1302 | MyMoneyTransactionFilter filter; | 1302 | MyMoneyTransactionFilter filter; | ||
1303 | 1303 | | |||
1304 | if (acc.accountGroup() == MyMoneyAccount::Income | 1304 | if (acc.accountGroup() == eMyMoney::Account::Income | ||
1305 | || acc.accountGroup() == MyMoneyAccount::Expense) | 1305 | || acc.accountGroup() == eMyMoney::Account::Expense) | ||
1306 | filter.addCategory(account); | 1306 | filter.addCategory(account); | ||
1307 | else | 1307 | else | ||
1308 | filter.addAccount(account); | 1308 | filter.addAccount(account); | ||
Context not available. | |||||
1524 | } | 1524 | } | ||
1525 | 1525 | | |||
1526 | const QList<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleList(const QString& accountId, | 1526 | const QList<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleList(const QString& accountId, | ||
1527 | const MyMoneySchedule::typeE type, | 1527 | const eMyMoney::Schedule::Type type, | ||
1528 | const MyMoneySchedule::occurrenceE occurrence, | 1528 | const eMyMoney::Schedule::Occurrence occurrence, | ||
1529 | const MyMoneySchedule::paymentTypeE paymentType, | 1529 | const eMyMoney::Schedule::PaymentType paymentType, | ||
1530 | const QDate& startDate, | 1530 | const QDate& startDate, | ||
1531 | const QDate& endDate, | 1531 | const QDate& endDate, | ||
1532 | const bool overdue) const | 1532 | const bool overdue) const | ||
Context not available. | |||||
1544 | for (pos = scheduleList.constBegin(); pos != scheduleList.constEnd(); ++pos) { | 1544 | for (pos = scheduleList.constBegin(); pos != scheduleList.constEnd(); ++pos) { | ||
1545 | // qDebug(" '%s'", (*pos).id().data()); | 1545 | // qDebug(" '%s'", (*pos).id().data()); | ||
1546 | 1546 | | |||
1547 | if (type != MyMoneySchedule::TYPE_ANY) { | 1547 | if (type != eMyMoney::Schedule::Type::Any) { | ||
1548 | if (type != (*pos).type()) { | 1548 | if (type != (*pos).type()) { | ||
1549 | continue; | 1549 | continue; | ||
1550 | } | 1550 | } | ||
1551 | } | 1551 | } | ||
1552 | 1552 | | |||
1553 | if (occurrence != MyMoneySchedule::OCCUR_ANY) { | 1553 | if (occurrence != eMyMoney::Schedule::Occurrence::Any) { | ||
1554 | if (occurrence != (*pos).occurrence()) { | 1554 | if (occurrence != (*pos).occurrence()) { | ||
1555 | continue; | 1555 | continue; | ||
1556 | } | 1556 | } | ||
1557 | } | 1557 | } | ||
1558 | 1558 | | |||
1559 | if (paymentType != MyMoneySchedule::STYPE_ANY) { | 1559 | if (paymentType != eMyMoney::Schedule::PaymentType::Any) { | ||
1560 | if (paymentType != (*pos).paymentType()) { | 1560 | if (paymentType != (*pos).paymentType()) { | ||
1561 | continue; | 1561 | continue; | ||
1562 | } | 1562 | } | ||
Context not available. | |||||
1627 | return list; | 1627 | return list; | ||
1628 | 1628 | | |||
1629 | for (pos = scheduleList.constBegin(); pos != scheduleList.constEnd(); ++pos) { | 1629 | for (pos = scheduleList.constBegin(); pos != scheduleList.constEnd(); ++pos) { | ||
1630 | if (scheduleTypes && !(scheduleTypes & (*pos).type())) | 1630 | if (scheduleTypes && !(scheduleTypes & (int)(*pos).type())) | ||
1631 | continue; | 1631 | continue; | ||
1632 | 1632 | | |||
1633 | if (scheduleOcurrences && !(scheduleOcurrences & (*pos).occurrence())) | 1633 | if (scheduleOcurrences && !(scheduleOcurrences & (int)(*pos).occurrence())) | ||
1634 | continue; | 1634 | continue; | ||
1635 | 1635 | | |||
1636 | if (schedulePaymentTypes && !(schedulePaymentTypes & (*pos).paymentType())) | 1636 | if (schedulePaymentTypes && !(schedulePaymentTypes & (int)(*pos).paymentType())) | ||
1637 | continue; | 1637 | continue; | ||
1638 | 1638 | | |||
1639 | if ((*pos).paymentDates(startDate, startDate).count() == 0) | 1639 | if ((*pos).paymentDates(startDate, startDate).count() == 0) | ||
Context not available. |