Fix a bug in search (absolute amounts) and remove automatic dating for new fix operation

This commit is contained in:
2010-07-26 21:03:22 +02:00
parent cc70c0f804
commit 7e41063b42
3 changed files with 13 additions and 7 deletions

View File

@@ -953,13 +953,13 @@ std::vector<Operation>* Database::Search(User* user, wxString* description, wxDa
if (amountFrom)
{
if (firstCond) req += wxT(" AND ") ; else firstCond = true;
req += wxT("amount >= '") + *amountFrom + wxT("'");
req += wxT("ABS(amount) >= ") + *amountFrom;
}
if (amountTo)
{
if (firstCond) req += wxT(" AND ") ; else firstCond = true;
req += wxT("amount <= '") + *amountTo + wxT("'");
req += wxT("ABS(amount) <= ") + *amountTo;
}
if (categories.size())
@@ -1025,13 +1025,13 @@ std::vector<Operation>* Database::Search(User* user, wxString* description, wxDa
if (dateFrom &&
(int)op.year == dateFrom->GetYear() &&
(int)op.month < dateFrom->GetMonth() &&
(int)op.month <= dateFrom->GetMonth() &&
(int)op.day < dateFrom->GetDay()-1)
continue;
if (dateTo &&
(int)op.year == dateTo->GetYear() &&
(int)op.month > dateTo->GetMonth() &&
(int)op.month >= dateTo->GetMonth() &&
(int)op.day > dateTo->GetDay()-1)
continue;