Take in accountt debit for virtual operations (and forgot them on check mode)

This commit is contained in:
Grégory Soutadé 2011-02-17 19:48:27 +01:00
parent 92252f33c3
commit 4cb57641d8
2 changed files with 9 additions and 9 deletions

View File

@ -18,7 +18,7 @@ v0.2_dev (15/02/2011)
Update Copyright
New database version (2) :
fix_cost for categories
virtual account
virtual field for account and operation
Database checking & upgrading
** Bugs **

View File

@ -486,17 +486,17 @@ void AccountPanel::UpdateStats()
if (op.amount >= 0)
{
if (!op.transfert.Length())
if (!op.transfert.Length() || (op._virtual && checkMode))
totalCredit += op.amount;
if (day >= op.day)
{
if (!op.transfert.Length())
if (!op.transfert.Length() || (op._virtual && checkMode))
curCredit += op.amount;
if (!checkMode || (checkMode && op.checked))
if ((!checkMode || (checkMode && op.checked)) && !op._virtual)
curAccountAmount[op.account] += op.amount;
}
if (!checkMode || (checkMode && op.checked))
if ((!checkMode || (checkMode && op.checked)) && !op._virtual)
finalAccountAmount[op.account] += op.amount;
}
else
@ -504,7 +504,7 @@ void AccountPanel::UpdateStats()
if (!op.transfert.Length())
_categoriesValues[_categoriesIndexes[user->GetCategoryName(op.category)]] += -op.amount ;
if (!op.transfert.Length())
if (!op.transfert.Length() || op._virtual)
totalDebit += -op.amount;
if (blocked_account)
@ -512,12 +512,12 @@ void AccountPanel::UpdateStats()
if (day >= op.day)
{
if (!op.transfert.Length())
if (!op.transfert.Length() || op._virtual)
curDebit += -op.amount;
if (!checkMode || (checkMode && op.checked))
if (!checkMode || (checkMode && op.checked && !op._virtual))
curAccountAmount[op.account] += op.amount;
}
if (!checkMode || (checkMode && op.checked))
if (!checkMode || (checkMode && op.checked && !op._virtual))
finalAccountAmount[op.account] += op.amount;
}
}