Add statistics

Update README
Update TODO
This commit is contained in:
2010-08-18 21:28:40 +02:00
parent 74c401c8c7
commit 5da154cd48
9 changed files with 251 additions and 124 deletions

View File

@@ -1071,6 +1071,8 @@ void Database::GetStats(User* user, const wxString& monthFrom, const wxString& y
for (accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); accountIt++)
{
req = wxT("SELECT month, year, amount FROM account_amount WHERE account ='") + accountIt->id + wxT("'");
req += wxT(" AND (year > '") + yearFrom + wxT("' OR (year == '") + yearFrom + wxT("' AND month >= '") + monthFrom + wxT("'))");
req += wxT(" AND (year < '") + yearTo + wxT("' OR (year == '") + yearTo + wxT("' AND month <= '") + monthTo + wxT("'))");
EXECUTE_SQL_QUERY(req, set, );
@@ -1095,7 +1097,6 @@ void Database::GetStats(User* user, const wxString& monthFrom, const wxString& y
req += wxT(" OR user='") + user->_id + wxT("')");
req += wxT(" AND (year > '") + yearFrom + wxT("' OR (year == '") + yearFrom + wxT("' AND month >= '") + monthFrom + wxT("'))");
req += wxT(" AND (year < '") + yearTo + wxT("' OR (year == '") + yearTo + wxT("' AND month <= '") + monthTo + wxT("'))");
req += wxT(" AND amount < 0");