Added button for report dialog to shop.

This commit is contained in:
2018-06-19 21:23:34 +02:00
parent d5844ab73d
commit ee5130f719
8 changed files with 48 additions and 6 deletions
+22
View File
@@ -8,6 +8,9 @@
#include "shopservice.h"
#include "eetbatchdialog.h"
#include <reporting/reportdialog.h>
#include <reporting/variablefiller.h>
#include "shop-odb.hxx"
PaydVouchersDialog::PaydVouchersDialog(QWidget *parent) :
@@ -140,3 +143,22 @@ void PaydVouchersDialog::on_btnSendEet_clicked()
dialog->addLog((msg.isEmpty() && !sent) ? "\n" : ": " + msg);
}
}
void PaydVouchersDialog::on_btnReports_clicked()
{
QSharedPointer<Voucher> voucher;
if (ui->tableVouchers->currentIndex().isValid())
{
voucher= m_voucherModel->itemFromIndex(ui->tableVouchers->currentIndex());
}
ReportDialog *dialog = new ReportDialog(!voucher.isNull(), this);
dialog->setAttribute(Qt::WA_DeleteOnClose);
VariableFiller varFiller;
varFiller.fillList(Context::instance().plugin("SHOP")->reports(), voucher.isNull() ? 0 : voucher->id());
dialog->setReports(Context::instance().plugin("SHOP")->reports());
dialog->show();
}