Fix a bug : date wasn't set for last NULL operation

This commit is contained in:
Grégory Soutadé 2012-01-29 11:41:51 +01:00
parent fe2e6c4bf4
commit 292591c098
1 changed files with 2 additions and 8 deletions

View File

@ -300,7 +300,7 @@ void GridAccount::InsertOperationWithWeek(User* user, Operation& op, int line, b
if (op.id && !fix) if (op.id && !fix)
ComputeWeeks(); ComputeWeeks();
} }
#include <QtDebug>
void GridAccount::InsertOperation(User* user, Operation& op, int line, bool fix, int month, int year) void GridAccount::InsertOperation(User* user, Operation& op, int line, bool fix, int month, int year)
{ {
std::vector<Operation>::iterator it; std::vector<Operation>::iterator it;
@ -404,19 +404,13 @@ void GridAccount::InsertOperation(User* user, Operation& op, int line, bool fix,
} }
else else
{ {
if (curDate.month() == month &&
curDate.year() == year)
{
if (!fix)
setItem(line, OP_DATE, new QTableWidgetItem(v.sprintf("%02d/%02d/%d", curDate.day(), month+1, year)));
}
if (fix) if (fix)
{ {
SET_ROW_COLOR(line, view::OWN_YELLOW, Qt::black); SET_ROW_COLOR(line, view::OWN_YELLOW, Qt::black);
} }
else else
{ {
setItem(line, OP_DATE, new QTableWidgetItem(v.sprintf("%02d/%02d/%d", curDate.day(), month+1, year)));
SET_ROW_COLOR(line, view::OWN_GREEN, Qt::black); SET_ROW_COLOR(line, view::OWN_GREEN, Qt::black);
} }