Fix a bug: current account value is badly computed if operations are not in date order
This commit is contained in:
parent
38770639be
commit
f1de45d08a
|
@ -623,11 +623,9 @@ void AccountPanel::UpdateStats()
|
|||
if (op.amount >= 0)
|
||||
{
|
||||
if (!op.transfert && !account.blocked)
|
||||
totalCredit += op.amount;
|
||||
|
||||
if (day >= op.day)
|
||||
{
|
||||
if (!op.transfert && !account.blocked)
|
||||
totalCredit += op.amount;
|
||||
if (day >= op.day)
|
||||
curCredit += op.amount;
|
||||
}
|
||||
}
|
||||
|
@ -637,11 +635,9 @@ void AccountPanel::UpdateStats()
|
|||
_categoriesValues[_categoriesIndexes[user->GetCategoryName(op.category)]] += -op.amount ;
|
||||
|
||||
if (!op.transfert || force_debit)
|
||||
totalDebit += -op.amount;
|
||||
|
||||
if (day >= op.day)
|
||||
{
|
||||
if (!op.transfert || force_debit)
|
||||
totalDebit += -op.amount;
|
||||
if (day >= op.day)
|
||||
curDebit += -op.amount;
|
||||
}
|
||||
|
||||
|
@ -649,9 +645,8 @@ void AccountPanel::UpdateStats()
|
|||
op.amount = -op.amount;
|
||||
}
|
||||
finalAccountAmount[op.account] += op.amount;
|
||||
curAccountAmounts[op.day][op.account] += op.amount;
|
||||
for(i=op.day+1; i<nbDays; i++)
|
||||
curAccountAmounts[i][op.account] = curAccountAmounts[op.day][op.account];
|
||||
for(i=op.day; i<nbDays; i++)
|
||||
curAccountAmounts[i][op.account] += op.amount;
|
||||
}
|
||||
|
||||
if (mode != CHECK_MODE)
|
||||
|
|
Loading…
Reference in New Issue
Block a user