Added button for report dialog to shop.

master
Josef Rokos 6 years ago
parent d5844ab73d
commit ee5130f719

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -40,5 +40,6 @@
<file>icons/report_24x24.png</file>
<file>icons/zoomIn_24x24.png</file>
<file>icons/zoomOut_24x24.png</file>
<file>icons/print_48x48.png</file>
</qresource>
</RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

@ -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();
}

@ -28,6 +28,8 @@ private slots:
void on_btnSendEet_clicked();
void on_btnReports_clicked();
private:
Ui::PaydVouchersDialog *ui;

@ -31,9 +31,29 @@
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="shoprc.qrc">
<normaloff>:/icons/pos_printer_48x48.png</normaloff>:/icons/pos_printer_48x48.png</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnReports">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../core/rc.qrc">
<normaloff>:/icons/print.svg</normaloff>:/icons/print.svg</iconset>
<normaloff>:/icons/print_48x48.png</normaloff>:/icons/print_48x48.png</iconset>
</property>
<property name="iconSize">
<size>

@ -116,9 +116,5 @@ ALTER TABLE Voucher ADD \"updated\" TEXT NULL;
"saveDateTime" : "Datum uložení",
"insertDate" : "Datum vložení"
}
},
"reports" : [
{ "name" : "Zaplacené účtenky", "description" : "Všechny zaplacené účtenky", "listReport" : 1, "file" : "vouchers.lrxml" },
{ "name" : "Nezplacené účtenky", "description" : "Všechny nezaplacené účtenky", "listReport" : 1, "file" : "vouchers_n.lrxml" }
]
}
}

@ -8,5 +8,6 @@
<file>icons/sendEet.svg</file>
<file>icons/pay_24x24.png</file>
<file>icons/shop_64x64.png</file>
<file>icons/pos_printer_48x48.png</file>
</qresource>
</RCC>

Loading…
Cancel
Save