Add CSV Export

Set DateFrom to first of month for SearchBanner
Fix a bug : for dates in Search
Fix a bug : file was not truncated during export
This commit is contained in:
2013-01-17 20:22:42 +01:00
parent e9c677f5b2
commit 62a3712ff7
6 changed files with 267 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright 2010-2012 Grégory Soutadé
Copyright 2010-2013 Grégory Soutadé
This file is part of KissCount.
@@ -42,7 +42,7 @@ SearchBanner::SearchBanner(KissCount* kiss, QFrame *parent, void* caller, OnButt
// _calendarFrom->setNavigationBarVisible(false);
_calendarFrom->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader);
_calendarFrom->setMaximumSize(_calendarFrom->sizeHint());
_calendarFrom->setSelectedDate(QDate::currentDate());
_calendarFrom->setSelectedDate(firstOfMonth);
connect(_calendarFrom, SIGNAL(currentPageChanged(int, int)), this, SLOT(OnCalendarFromPageChanged(int, int)));
@@ -157,19 +157,19 @@ std::vector<Operation> * SearchBanner::Search()
if (_checkDateFrom->checkState() == Qt::Checked)
{
dateFrom = new QDate();
*dateFrom = _calendarFrom->selectedDate().addMonths(-1);
*dateFrom = _calendarFrom->selectedDate();
}
if (_checkDateTo->checkState() == Qt::Checked)
{
dateTo = new QDate();
*dateTo = _calendarTo->selectedDate().addMonths(-1);
*dateTo = _calendarTo->selectedDate();
}
if (dateFrom && dateTo && *dateFrom > *dateTo)
{
QMessageBox::critical(0, _("Error"), _("Invalid date range"));
goto end;
goto end;
}
if (_amountFrom->text().length())

View File

@@ -1,5 +1,5 @@
/*
Copyright 2010-2012 Grégory Soutadé
Copyright 2010-2013 Grégory Soutadé
This file is part of KissCount.