Fix two bugs (No entry in Search Panel and Date in Search (Database))
Add auto detection for account and category using description Auto add date with curMonth & curYear for new operation
This commit is contained in:
@@ -935,7 +935,7 @@ std::vector<Operation>* Database::Search(User* user, wxString* description, wxDa
|
||||
if (firstCond) req += wxT(" AND ") ; else firstCond = true;
|
||||
req += wxT("(");
|
||||
req += wxT(" year >= '") + wxString::Format(wxT("%d"), dateFrom->GetYear()) + wxT("'");
|
||||
req += wxT(" AND month >= '") + wxString::Format(wxT("%d"), dateFrom->GetMonth()) + wxT("'");
|
||||
//req += wxT(" AND month >= '") + wxString::Format(wxT("%d"), dateFrom->GetMonth()) + wxT("'");
|
||||
// req += wxT(" AND day >= '") + wxString::Format(wxT("%d"), dateFrom->GetDay()) + wxT("'");
|
||||
req += wxT(")");
|
||||
}
|
||||
@@ -945,7 +945,7 @@ std::vector<Operation>* Database::Search(User* user, wxString* description, wxDa
|
||||
if (firstCond) req += wxT(" AND ") ; else firstCond = true;
|
||||
req += wxT("(");
|
||||
req += wxT(" year <= '") + wxString::Format(wxT("%d"), dateTo->GetYear()) + wxT("'");
|
||||
req += wxT(" AND month <= '") + wxString::Format(wxT("%d"), dateTo->GetMonth()) + wxT("'");
|
||||
//req += wxT(" AND month <= '") + wxString::Format(wxT("%d"), dateTo->GetMonth()) + wxT("'");
|
||||
// req += wxT(" AND day <= '") + wxString::Format(wxT("%d"), dateTo->GetDay()) + wxT("'");
|
||||
req += wxT(")");
|
||||
}
|
||||
@@ -1024,14 +1024,14 @@ std::vector<Operation>* Database::Search(User* user, wxString* description, wxDa
|
||||
op.checked = set.GetBool(wxT("checked"));
|
||||
|
||||
if (dateFrom &&
|
||||
(int)op.month == dateFrom->GetMonth() &&
|
||||
(int)op.year == dateFrom->GetYear() &&
|
||||
(int)op.month < dateFrom->GetMonth() &&
|
||||
(int)op.day < dateFrom->GetDay()-1)
|
||||
continue;
|
||||
|
||||
if (dateTo &&
|
||||
(int)op.month == dateTo->GetMonth() &&
|
||||
(int)op.year == dateTo->GetYear() &&
|
||||
(int)op.month > dateTo->GetMonth() &&
|
||||
(int)op.day > dateTo->GetDay()-1)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user