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:
2010-07-17 12:33:39 +02:00
parent de0e7fa1d9
commit cc70c0f804
6 changed files with 72 additions and 9 deletions

View File

@@ -106,6 +106,9 @@ void GridAccount::InsertOperation(User* user, Operation* op, int line, bool fix,
std::vector<Operation>::iterator it;
int r, g, b;
wxColour color;
wxDateTime curDate;
curDate.SetToCurrent();
if (!op && !user->_accounts.size()) return;
@@ -157,6 +160,15 @@ void GridAccount::InsertOperation(User* user, Operation* op, int line, bool fix,
else
{
SetCellEditor(line, DATE, new CalendarEditor(0, curMonth, curYear));
if (curDate.GetMonth() == curMonth &&
curDate.GetYear() == curYear)
{
SetCellValue(line, DATE, wxString::Format(wxT("%02d/%02d/%d"), curDate.GetDay(), curMonth+1, curYear));
SetCellEditor(line, DATE, new CalendarEditor(curDate.GetDay()-1, curMonth, curYear));
}
else
SetCellEditor(line, DATE, new CalendarEditor(0, curMonth, curYear));
if (fix)
SET_ROW_COLOR(line, OWN_YELLOW)
else