Add virtual accounts (potential bugs)

This commit is contained in:
2011-02-14 20:56:59 +01:00
parent c03562851a
commit bf417a503d
14 changed files with 150 additions and 27 deletions

View File

@@ -168,6 +168,7 @@ wxLanguage User::GetLanguage()
void User::LinkOrUnlinkOperation(Operation& op)
{
std::vector<Operation>::iterator it;
Account account, account2;
// Not Linked
if (!op.transfert.Length())
@@ -177,6 +178,7 @@ void User::LinkOrUnlinkOperation(Operation& op)
if (it->id != op.id && it->transfert == op.id)
{
it->transfert = wxT("");
it->_virtual = false;
return;
}
}
@@ -188,11 +190,16 @@ void User::LinkOrUnlinkOperation(Operation& op)
{
if (it->id != op.id && it->id == op.transfert)
{
account = GetAccount(it->account);
account2 = GetAccount(op.account);
it->transfert = op.id;
it->_virtual = account._virtual || account2._virtual;
op._virtual = account._virtual || account2._virtual;
return;
}
}
op.transfert = wxT("");
op._virtual = false;
}
}