Add ImportPanel
Throw exception when category/account are not found in User Fix a bug in GrisbiImportEngine with QDate::fromString Try to search an account also with its name Remove categories number limit (only used for pie color)
This commit is contained in:
@@ -135,7 +135,8 @@ StatsPanel::StatsPanel(KissCount* kiss, wxUI *parent) : KissPanel(kiss, parent),
|
||||
_vbox3->addWidget(_account);
|
||||
_vbox3->addWidget(_statsGrid);
|
||||
|
||||
nbCategories = (user->GetCategoriesNumber() <= wxUI::MAX_CATEGORY) ? user->GetCategoriesNumber() : wxUI::MAX_CATEGORY;
|
||||
nbCategories = user->GetCategoriesNumber();
|
||||
// nbCategories = (user->GetCategoriesNumber() <= wxUI::MAX_CATEGORY) ? user->GetCategoriesNumber() : wxUI::MAX_CATEGORY;
|
||||
|
||||
_categoriesValues = new double[user->GetCategoriesNumber()];
|
||||
for(i=0; i<user->GetCategoriesNumber(); i++)
|
||||
@@ -159,7 +160,8 @@ StatsPanel::StatsPanel(KissCount* kiss, wxUI *parent) : KissPanel(kiss, parent),
|
||||
{
|
||||
_categoriesValues[i] = 0.0;
|
||||
_pie->setDataset(i, vec, _categories[i]);
|
||||
_pie->pieDiagram()->setBrush(i, QBrush(wxUI::categoryColors[i]));
|
||||
if (i < wxUI::MAX_CATEGORY)
|
||||
_pie->pieDiagram()->setBrush(i, QBrush(wxUI::categoryColors[i]));
|
||||
legend->setText(i, _categories[i]);
|
||||
}
|
||||
|
||||
@@ -217,7 +219,7 @@ void StatsPanel::UpdateStats(int monthFrom, int yearFrom, int monthTo, int yearT
|
||||
std::map<int, std::map<int, double> >::iterator accountYearIt;
|
||||
double total, non_fix;
|
||||
int account, size, i, a, b, percents, nbDays;
|
||||
QString value;
|
||||
QString value, v;
|
||||
User* user = _kiss->GetUser();
|
||||
QDate date;
|
||||
bool failed;
|
||||
@@ -372,7 +374,7 @@ void StatsPanel::UpdateStats(int monthFrom, int yearFrom, int monthTo, int yearT
|
||||
percents = ((double) (categoriesIt->second*100))/total;
|
||||
else
|
||||
percents = 0;
|
||||
value = value.sprintf("%0.2lf (%02d%%)", categoriesIt->second, percents);
|
||||
value = v.sprintf("%0.2lf (%02d%%)", categoriesIt->second, percents);
|
||||
if (i)
|
||||
{
|
||||
_statsGrid->setItem(_categoriesIndexes[categoriesIt->first]+1, 1, new QTableWidgetItem(value));
|
||||
@@ -394,7 +396,7 @@ void StatsPanel::UpdateStats(int monthFrom, int yearFrom, int monthTo, int yearT
|
||||
percents = ((double) (non_fix*100))/total;
|
||||
else
|
||||
percents = 0;
|
||||
value = value.sprintf("%0.2lf (%02d%%)", non_fix, percents);
|
||||
value = v.sprintf("%0.2lf (%02d%%)", non_fix, percents);
|
||||
_statsGrid->setItem(1, 1, new QTableWidgetItem(value));
|
||||
|
||||
_statsGrid->resizeColumnsToContents();
|
||||
|
||||
Reference in New Issue
Block a user