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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user