Revert back commit b1ce5fc2a2

This commit is contained in:
Grégory Soutadé 2017-11-01 20:36:52 +01:00
parent 70ce91324b
commit ca925d37cb

View File

@ -110,9 +110,6 @@ int KissCount::CalcAccountAmount(int id, int month, int year, bool* had_values)
void KissCount::UpdateOperation(Operation& op, bool checkTransfert)
{
Operation oldOp;
int accountAmount;
if(!op.meta)
// Unlink
@ -127,17 +124,6 @@ void KissCount::UpdateOperation(Operation& op, bool checkTransfert)
// Link
if (checkTransfert)
_user->LinkOrUnlinkOperation(op);
if(!op.meta)
{
_db->GetOperation(op.id, &oldOp);
accountAmount = _db->CalcAccountAmount(oldOp.account, oldOp.month, oldOp.year, 0);
_db->SetAccountAmount(oldOp.account, oldOp.month, oldOp.year, accountAmount);
accountAmount = _db->CalcAccountAmount(op.account, op.month, op.year, 0);
_db->SetAccountAmount(op.account, op.month, op.year, accountAmount);
}
}
int KissCount::AddOperation(Operation& op, bool checkTransfert)
@ -148,12 +134,6 @@ int KissCount::AddOperation(Operation& op, bool checkTransfert)
if (checkTransfert && op.transfert)
_user->LinkOrUnlinkOperation(op);
if (!op.meta)
{
accountAmount = _db->CalcAccountAmount(op.account, op.month, op.year, 0);
_db->SetAccountAmount(op.account, op.month, op.year, accountAmount);
}
return ret;
}
@ -168,12 +148,6 @@ void KissCount::DeleteOperation(Operation& op)
}
_db->DeleteOperation(_user, op);
if (!op.meta)
{
accountAmount = _db->CalcAccountAmount(op.account, op.month, op.year, 0);
_db->SetAccountAmount(op.account, op.month, op.year, accountAmount);
}
}
void KissCount::DeleteOperations(int month, int year)