Add "transfert" feature (don't show tansferts into statistics)
Update package.sh
This commit is contained in:
@@ -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("");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user