Month generation OK

This commit is contained in:
2010-06-23 20:30:42 +02:00
parent 7d1f9ee120
commit 271b3ef1e7
4 changed files with 21 additions and 16 deletions

View File

@@ -632,15 +632,15 @@ void Database::GenerateMonth(User* user, int monthFrom, int yearFrom, int monthT
for (it = user->_accounts.begin(); it != user->_accounts.end(); it++)
{
amount = 0.0;
req = _("SELECT SUM(amount) FROM operation WHERE") ;
req = _("SELECT amount FROM operation WHERE") ;
req += _(" account='") + it->id + _("'");
req += _(" AND year='") + wxString::Format(_("%d"), yearFrom) + _("'");
req += _(" AND month='") + wxString::Format(_("%d"), monthFrom) + _("'");
EXECUTE_SQL_QUERY(req, set, );
if (set.NextRow())
amount = set.GetDouble(_("amount"));
while (set.NextRow())
amount += set.GetDouble(_("amount"));
req = _("SELECT amount FROM account_amount WHERE") ;
req += _(" account='") + it->id + _("'");