From ee5130f71996a23ae7cea9b5fee8dddab46bd5c3 Mon Sep 17 00:00:00 2001 From: Josef Rokos Date: Tue, 19 Jun 2018 21:23:34 +0200 Subject: [PATCH] Added button for report dialog to shop. --- core/icons/print_48x48.png | Bin 0 -> 1067 bytes core/rc.qrc | 1 + shop/icons/pos_printer_48x48.png | Bin 0 -> 765 bytes shop/paydvouchersdialog.cpp | 22 ++++++++++++++++++++++ shop/paydvouchersdialog.h | 2 ++ shop/paydvouchersdialog.ui | 22 +++++++++++++++++++++- shop/shop.json | 6 +----- shop/shoprc.qrc | 1 + 8 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 core/icons/print_48x48.png create mode 100644 shop/icons/pos_printer_48x48.png diff --git a/core/icons/print_48x48.png b/core/icons/print_48x48.png new file mode 100644 index 0000000000000000000000000000000000000000..494b84c298c016b1072d312c8e5facd8648a4aac GIT binary patch literal 1067 zcmV+`1l0S9P)CcLcT{lfB*o!};Ap7IfkPnND)9$Y9D)Rbq(XusAr8pm5TtPG0YL~^{SsSz5oVNsV_9cc#nuS{8{s?5{Qm{mCL;mNcR4|zST@7 zqXm*2Kqiwh2KxK|@-s#TWoD~lX7UsNp9Ao#Ho#7+s{5o63uZKW zgqc+kW^`TGiD6*fqYUg06S=#FQ{#*w?UoZSGbE zgu7-5+%ZE1GeHPfZ(U1E2OfX$yGPF8*N0woCzK&K52`I806^4QT8%HA$K9(xyHUe@ z0?hz)U;14IlBKEF)dplv+bHIb@0yyR#v$(4ZQmwla`r7_9 zsb&E7&wq9qTvbBV6F4k2Q$mZ~Pwls&U5Net8}7UO<;~7AL|AGDKwGyQQ~Zg@#+o}} ztIUD;ALp;QN(k7Q67m317ocInRwwRr=q;JiC=MSwgq|Zux7ElG-_IhS&%?Iso}M(63xK7Z18|aw z2H`&Y5mHJ?L>sYKEb`XqSRmh}Cr&)irIi&&N~sewfp4!EOmtQQ?gjHt4FRN-Ct0b} z5TX-8h_+!^2mDHeYT-LqjVA$z*!l0MhC7?83qV zhowTHz)u`MKI6rkr&XwASs%YXGIFX|EQWG47wzbF lxm@m>Fs{{BTW#&I{sF2fZ$rrTFn$04002ovPDHLkV1k&s<0k+B literal 0 HcmV?d00001 diff --git a/core/rc.qrc b/core/rc.qrc index 57d1c12..8f8369f 100644 --- a/core/rc.qrc +++ b/core/rc.qrc @@ -40,5 +40,6 @@ icons/report_24x24.png icons/zoomIn_24x24.png icons/zoomOut_24x24.png + icons/print_48x48.png diff --git a/shop/icons/pos_printer_48x48.png b/shop/icons/pos_printer_48x48.png new file mode 100644 index 0000000000000000000000000000000000000000..e0ba3035eabdc71b78ed76aeaf9816e729fe205d GIT binary patch literal 765 zcmV}D;JnA>1>XJ=Z)=*8-f zt2=nU{tLIawnCrNY&KEb+jDKlDVU~tGH+cb677sm!?&yZqb~^o5qNUB95DKUb-#B? zOCiP>C6v}}y=b(n`+y6;9T5-`KG3{7q(oo}zv_WcLXjijg|AKFC(k$~LW^@xqzeSX zBSH$reF4T8C4|=P?5fc={sI5@5(Gq`*zxWVy1)c}kiTGjGT!;Xk4a){mjV~yhL2c< zV(~y&_z6gyWt95@6T=R&obab3Ae2KABOnS7Ma4>?Am#ziJ%No(7~Tc0e0u}7xhXVC z$SR|RWYmw2R@nY};|0zifAQw`Y`%{_>z$ui|6aqx$Ip-Nv}x>UN1od-`*T3h495LciF6sM0zyLV77mt%+VNM;!ouH_LVd6W-wz=q^eXZ^{lQNHyNW;QDpJ?%C>EorfK*3{r9a_Yu9gWU<&2)`TLe-y>1*H v-f{_1 +#include + #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; + + 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(); +} diff --git a/shop/paydvouchersdialog.h b/shop/paydvouchersdialog.h index 9c8f5bf..b033951 100644 --- a/shop/paydvouchersdialog.h +++ b/shop/paydvouchersdialog.h @@ -28,6 +28,8 @@ private slots: void on_btnSendEet_clicked(); + void on_btnReports_clicked(); + private: Ui::PaydVouchersDialog *ui; diff --git a/shop/paydvouchersdialog.ui b/shop/paydvouchersdialog.ui index 44186d9..397137b 100644 --- a/shop/paydvouchersdialog.ui +++ b/shop/paydvouchersdialog.ui @@ -31,9 +31,29 @@ + + + :/icons/pos_printer_48x48.png:/icons/pos_printer_48x48.png + + + + 32 + 32 + + + + true + + + + + + + ... + - :/icons/print.svg:/icons/print.svg + :/icons/print_48x48.png:/icons/print_48x48.png diff --git a/shop/shop.json b/shop/shop.json index baad1ce..29306c7 100644 --- a/shop/shop.json +++ b/shop/shop.json @@ -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" } - ] + } } diff --git a/shop/shoprc.qrc b/shop/shoprc.qrc index e28635d..ddc3752 100644 --- a/shop/shoprc.qrc +++ b/shop/shoprc.qrc @@ -8,5 +8,6 @@ icons/sendEet.svg icons/pay_24x24.png icons/shop_64x64.png + icons/pos_printer_48x48.png