Fix bugs in UpdateNextMonths
This commit is contained in:
parent
deddbc040c
commit
20245fec2e
|
@ -1153,6 +1153,7 @@ void AccountPanel::OnUpdateNextMonths()
|
|||
last_year = _curYear;
|
||||
}
|
||||
|
||||
// Compute deltas
|
||||
for (i=0; i<(int)user->_accounts.size(); i++)
|
||||
{
|
||||
deltas[i] = _kiss->GetAccountAmount(user->_accounts[i].id, _curMonth, _curYear);
|
||||
|
@ -1171,7 +1172,8 @@ void AccountPanel::OnUpdateNextMonths()
|
|||
|
||||
deltas[i] -= amount;
|
||||
|
||||
account_updated++;
|
||||
if (deltas[i])
|
||||
account_updated++;
|
||||
}
|
||||
|
||||
if (!account_updated)
|
||||
|
@ -1180,6 +1182,7 @@ void AccountPanel::OnUpdateNextMonths()
|
|||
last_month = _curMonth;
|
||||
last_year = _curYear;
|
||||
|
||||
// Apply deltas
|
||||
while (1)
|
||||
{
|
||||
account_updated = 0;
|
||||
|
@ -1192,6 +1195,19 @@ void AccountPanel::OnUpdateNextMonths()
|
|||
else
|
||||
last_month++;
|
||||
|
||||
for (i=0; i<(int)user->_accounts.size(); i++)
|
||||
{
|
||||
if (deltas[i] == 0.0) continue;
|
||||
|
||||
_kiss->CalcAccountAmount(user->_accounts[i].id, last_month, last_year, &had_values);
|
||||
if (had_values)
|
||||
account_updated++;
|
||||
}
|
||||
|
||||
if (!account_updated) break;
|
||||
|
||||
account_updated = 0;
|
||||
|
||||
for (i=0; i<(int)user->_accounts.size(); i++)
|
||||
{
|
||||
if (deltas[i] == 0.0) continue;
|
||||
|
|
Loading…
Reference in New Issue
Block a user