Add "transfert" feature (don't show tansferts into statistics)

Update package.sh
This commit is contained in:
2010-08-21 09:25:35 +02:00
parent 8977c820fc
commit 3802460429
10 changed files with 172 additions and 11 deletions

View File

@@ -117,3 +117,34 @@ wxLanguage User::GetLanguage()
return (wxLanguage)val;
}
void User::LinkOrUnlinkOperation(Operation& op)
{
std::vector<Operation>::iterator it;
// Not Linked
if (!op.transfert.Length())
{
for (it = (*_operations[op.year])[op.month].begin(); it != (*_operations[op.year])[op.month].end(); it++)
{
if (it->id != op.id && it->transfert == op.id)
{
it->transfert = wxT("");
return;
}
}
}
// Linked
else
{
for (it = (*_operations[op.year])[op.month].begin(); it != (*_operations[op.year])[op.month].end(); it++)
{
if (it->id != op.id && it->id == op.transfert)
{
it->transfert = op.id;
return;
}
}
op.transfert = wxT("");
}
}