This commit is contained in:
2010-06-23 19:32:42 +02:00
parent ea12a1b16c
commit 7d1f9ee120
9 changed files with 191 additions and 8 deletions

View File

@@ -142,3 +142,27 @@ std::map<int, std::vector<int> > KissCount::GetAllOperations()
{
return _db->GetAllOperations(_user);
}
void KissCount::GenerateMonth(int monthFrom, int yearFrom, int monthTo, int yearTo)
{
std::vector<operation>::iterator it;
operation op;
_db->GenerateMonth(_user, monthFrom, yearFrom, monthTo, yearTo);
if (monthFrom != -1 && yearFrom != -1)
{
LoadYear(yearFrom, false);
for(it = (*_user->_operations[yearFrom])[monthFrom].begin();
it != (*_user->_operations[yearFrom])[monthFrom].end()
&& it->fix_cost;
it++)
{
op = *it;
op.month = monthTo;
op.year = yearTo;
AddOperation(op);
}
}
_wxUI->GenerateMonth(monthTo, yearTo);
}

View File

@@ -37,6 +37,8 @@ class KissCount
void DeleteCategory(struct category category);
std::map<int, std::vector<int> > GetAllOperations();
void GenerateMonth(int monthFrom, int yearFrom, int monthTo, int yearTo);
private:
wxUI* _wxUI;
Database* _db;