From 0b096d88bd042dbb7aac738ce818274da12320ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Sun, 29 Oct 2017 18:21:54 +0100 Subject: [PATCH] Fix a bug in StatsPanel : min and max amount must be multiplied by 100 before search operation --- src/view/SearchBanner.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/view/SearchBanner.cpp b/src/view/SearchBanner.cpp index 7946850..677991d 100644 --- a/src/view/SearchBanner.cpp +++ b/src/view/SearchBanner.cpp @@ -202,7 +202,7 @@ std::vector * SearchBanner::Search() if (_amountFrom->text().length()) { amountFrom = new int; - *amountFrom = _amountFrom->text().toInt(&ok); + *amountFrom = _amountFrom->text().toInt(&ok)*100; if (!ok) { QMessageBox::critical(0, _("Error"), _("Invalid amount from")); @@ -215,7 +215,7 @@ std::vector * SearchBanner::Search() if (_amountTo->text().length()) { amountTo = new int; - *amountTo = _amountTo->text().toInt(&ok); + *amountTo = _amountTo->text().toInt(&ok)*100; if (!ok) { QMessageBox::critical(0, _("Error"), _("Invalid amount to")); @@ -254,7 +254,9 @@ std::vector * SearchBanner::Search() if (_account->item(i)->checkState() == Qt::Checked) accounts.push_back((i) ? user->_accounts[i-1].id : 0); - _operations = _kiss->Search(description, dateFrom, dateTo, amountFrom, amountTo, categories, types, accounts, tags); + _operations = _kiss->Search(description, dateFrom, dateTo, + amountFrom, amountTo, categories, + types, accounts, tags); end: delete dateFrom;