Possibility to find operations with unknown category/account

This commit is contained in:
Grégory Soutadé 2011-02-09 21:36:29 +01:00
parent aec66e7212
commit ab176b9fc3
3 changed files with 9 additions and 6 deletions

View File

@ -1,4 +1,4 @@
v0.2_dev (29/01/2011)
v0.2_dev (09/02/2011)
** User **
Better use of sizers (so better interface!)
@ -6,6 +6,7 @@ v0.2_dev (29/01/2011)
Better fit of interface when displaying grouped operations
Show stats for current month even if next month has not been generated
Possibility to choose a replacement when deleting accounts and categories
Possibility to find operations with unknown category/account
** Dev **
Use a factory to create panels (prepare for plug-in)

View File

@ -1421,8 +1421,8 @@ std::vector<Operation>* Database::Search(User* user, wxString* description, wxDa
for (; it != accounts.end(); it++)
req += wxT("', '") + *it ;
req += wxT("')");
req += wxT(" OR user ='") + user->_id + wxT("')");
req += wxT("'))");
// req += wxT(" OR user ='") + user->_id + wxT("')");
}
else
{
@ -1443,7 +1443,7 @@ std::vector<Operation>* Database::Search(User* user, wxString* description, wxDa
req += wxT(", month ") + user->_preferences[wxT("operation_order")] ;
req += wxT(", day ") + user->_preferences[wxT("operation_order")] ;
// std::cout << req.mb_str() << "\n";
std::cout << req.mb_str() << "\n";
EXECUTE_SQL_QUERY(req, set, res);

View File

@ -70,6 +70,7 @@ SearchPanel::SearchPanel(KissCount* kiss, wxUI *parent) : KissPanel(kiss, parent
_amountTo = new wxTextCtrl(this, wxID_ANY);
_category = new wxCheckListBox(this, wxID_ANY);
_category->Append(_("Unknown"));
for(categoryIt = user->_categories.begin(); categoryIt != user->_categories.end(); categoryIt++)
_category->Append(categoryIt->name);
@ -77,6 +78,7 @@ SearchPanel::SearchPanel(KissCount* kiss, wxUI *parent) : KissPanel(kiss, parent
_optype = new wxCheckListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 4, stypes);
_account = new wxCheckListBox(this, wxID_ANY);
_account->Append(_("Unknown"));
for(accountIt = user->_accounts.begin(); accountIt != user->_accounts.end(); accountIt++)
_account->Append(accountIt->name);
@ -223,7 +225,7 @@ void SearchPanel::OnButtonSearch(wxCommandEvent& event)
for(i=0; i<user->GetCategoriesNumber(); i++)
if (_category->IsChecked(i))
categories.push_back(user->_categories[i].id);
categories.push_back((i) ? user->_categories[i].id : wxT("0"));
types |= (_optype->IsChecked(0)) ? FIX_OP : 0;
types |= (_optype->IsChecked(1)) ? NON_FIX_OP : 0;
@ -232,7 +234,7 @@ void SearchPanel::OnButtonSearch(wxCommandEvent& event)
for(i=0; i<user->GetAccountsNumber(); i++)
if (_account->IsChecked(i))
accounts.push_back(user->_accounts[i].id);
accounts.push_back((i) ? user->_accounts[i].id : wxT("0"));
if (_operations)
delete _operations;