Fix a bug in search (absolute amounts) and remove automatic dating for new fix operation
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user