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:
Grégory Soutadé 2014-02-08 12:21:07 +01:00
parent 9575705106
commit 34bbd08de6
1 changed files with 7 additions and 0 deletions

View File

@ -285,6 +285,13 @@ void KissCount::GenerateMonth(int monthFrom, int yearFrom, int monthTo, int year
op._virtual = false;
if (op.meta)
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);
}