Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/storage/mymoneyseqaccessmgr.cpp
Show First 20 Lines • Show All 645 Lines • ▼ Show 20 Line(s) | 642 | if (pos != m_accountList.end()) { | |||
---|---|---|---|---|---|
646 | if (((*pos).parentAccountId() == account.parentAccountId() | 646 | if (((*pos).parentAccountId() == account.parentAccountId() | ||
647 | && ((*pos).accountType() == account.accountType() | 647 | && ((*pos).accountType() == account.accountType() | ||
648 | || ((*pos).isLiquidAsset() && account.isLiquidAsset()))) | 648 | || ((*pos).isLiquidAsset() && account.isLiquidAsset()))) | ||
649 | || skipCheck == true) { | 649 | || skipCheck == true) { | ||
650 | // make sure that all the referenced objects exist | 650 | // make sure that all the referenced objects exist | ||
651 | if (!account.institutionId().isEmpty()) | 651 | if (!account.institutionId().isEmpty()) | ||
652 | institution(account.institutionId()); | 652 | institution(account.institutionId()); | ||
653 | 653 | | |||
654 | QList<QString>::ConstIterator it_a; | 654 | foreach (const auto sAccount, account.accountList()) | ||
655 | for (it_a = account.accountList().constBegin(); it_a != account.accountList().constEnd(); ++it_a) { | 655 | this->account(sAccount); | ||
656 | this->account(*it_a); | 656 | | ||
657 | } | | |||
658 | // update information in account list | 657 | // update information in account list | ||
659 | m_accountList.modify(account.id(), account); | 658 | m_accountList.modify(account.id(), account); | ||
660 | 659 | | |||
661 | } else | 660 | } else | ||
662 | throw MYMONEYEXCEPTION("Invalid information for update"); | 661 | throw MYMONEYEXCEPTION("Invalid information for update"); | ||
663 | 662 | | |||
664 | } else | 663 | } else | ||
665 | throw MYMONEYEXCEPTION("Unknown account id"); | 664 | throw MYMONEYEXCEPTION("Unknown account id"); | ||
▲ Show 20 Lines • Show All 413 Lines • ▼ Show 20 Line(s) | 1067 | for (QList<MyMoneyTransaction>::const_iterator it_t = list.constBegin(); it_t != list.constEnd(); ++it_t) { | |||
1079 | } | 1078 | } | ||
1080 | } | 1079 | } | ||
1081 | 1080 | | |||
1082 | return balance; | 1081 | return balance; | ||
1083 | } | 1082 | } | ||
1084 | 1083 | | |||
1085 | const MyMoneyMoney MyMoneySeqAccessMgr::totalBalance(const QString& id, const QDate& date) const | 1084 | const MyMoneyMoney MyMoneySeqAccessMgr::totalBalance(const QString& id, const QDate& date) const | ||
1086 | { | 1085 | { | ||
1087 | QStringList accounts; | | |||
1088 | QStringList::ConstIterator it_a; | | |||
1089 | | ||||
1090 | MyMoneyMoney result(balance(id, date)); | 1086 | MyMoneyMoney result(balance(id, date)); | ||
1091 | 1087 | | |||
1092 | accounts = account(id).accountList(); | 1088 | foreach (const auto sAccount, account(id).accountList()) | ||
1093 | 1089 | result += totalBalance(sAccount, date); | |||
1094 | for (it_a = accounts.constBegin(); it_a != accounts.constEnd(); ++it_a) { | | |||
1095 | result += totalBalance(*it_a, date); | | |||
1096 | } | | |||
1097 | 1090 | | |||
1098 | return result; | 1091 | return result; | ||
1099 | } | 1092 | } | ||
1100 | 1093 | | |||
1101 | MyMoneyAccount MyMoneySeqAccessMgr::liability() const { | 1094 | MyMoneyAccount MyMoneySeqAccessMgr::liability() const { | ||
1102 | return account(STD_ACC_LIABILITY); | 1095 | return account(STD_ACC_LIABILITY); | ||
1103 | } | 1096 | } | ||
1104 | 1097 | | |||
▲ Show 20 Lines • Show All 1007 Lines • Show Last 20 Lines |