Fix a bug in generate month : if the next month has less days than the first, but there are operations on non existings days, use last day of new month.
This commit is contained in:
parent
9575705106
commit
34bbd08de6
|
@ -285,6 +285,13 @@ void KissCount::GenerateMonth(int monthFrom, int yearFrom, int monthTo, int year
|
||||||
op._virtual = false;
|
op._virtual = false;
|
||||||
if (op.meta)
|
if (op.meta)
|
||||||
meta[it->id] = op.id;
|
meta[it->id] = op.id;
|
||||||
|
|
||||||
|
if (!QDate::isValid(op.year, op.month+1, op.day+1))
|
||||||
|
{
|
||||||
|
QDate d(op.year, op.month+1, 1);
|
||||||
|
op.day = d.daysInMonth()-1;
|
||||||
|
}
|
||||||
|
|
||||||
(*_user->_operations[yearTo])[monthTo].push_back(op);
|
(*_user->_operations[yearTo])[monthTo].push_back(op);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue