|
|
@ -16,11 +16,12 @@ PaydVouchersDialog::PaydVouchersDialog(QWidget *parent) :
|
|
|
|
m_voucherModel = new AutoTableModel<Voucher>(this);
|
|
|
|
m_voucherModel = new AutoTableModel<Voucher>(this);
|
|
|
|
m_itemModel = new AutoTableModel<VoucherItem>(this);
|
|
|
|
m_itemModel = new AutoTableModel<VoucherItem>(this);
|
|
|
|
m_voucherModel->setTranslations(Context::instance().plugin("SHOP")->translations());
|
|
|
|
m_voucherModel->setTranslations(Context::instance().plugin("SHOP")->translations());
|
|
|
|
|
|
|
|
|
|
|
|
m_itemModel->setTranslations(Context::instance().plugin("SHOP")->translations());
|
|
|
|
m_itemModel->setTranslations(Context::instance().plugin("SHOP")->translations());
|
|
|
|
|
|
|
|
|
|
|
|
ui->tableVouchers->setModel(m_voucherModel);
|
|
|
|
ui->tableVouchers->setModel(m_voucherModel);
|
|
|
|
ui->tableItems->setModel(m_itemModel);
|
|
|
|
ui->tableItems->setModel(m_itemModel);
|
|
|
|
|
|
|
|
ui->tableVouchers->setSortingEnabled(true);
|
|
|
|
ui->tableVouchers->setColumnHidden(2, true);
|
|
|
|
ui->tableVouchers->setColumnHidden(2, true);
|
|
|
|
ui->tableVouchers->setColumnHidden(6, true);
|
|
|
|
ui->tableVouchers->setColumnHidden(6, true);
|
|
|
|
ui->tableVouchers->setColumnHidden(7, true);
|
|
|
|
ui->tableVouchers->setColumnHidden(7, true);
|
|
|
@ -43,6 +44,7 @@ PaydVouchersDialog::PaydVouchersDialog(QWidget *parent) :
|
|
|
|
|
|
|
|
|
|
|
|
ShopService srv;
|
|
|
|
ShopService srv;
|
|
|
|
m_voucherModel->setData(srv.paiedVouchers());
|
|
|
|
m_voucherModel->setData(srv.paiedVouchers());
|
|
|
|
|
|
|
|
ui->tableVouchers->sortByColumn(0,Qt::AscendingOrder);
|
|
|
|
|
|
|
|
|
|
|
|
connect(ui->tableVouchers->selectionModel(), &QItemSelectionModel::currentRowChanged, [this, &srv](const QModelIndex ¤t, const QModelIndex &) {
|
|
|
|
connect(ui->tableVouchers->selectionModel(), &QItemSelectionModel::currentRowChanged, [this, &srv](const QModelIndex ¤t, const QModelIndex &) {
|
|
|
|
QSharedPointer<Voucher> voucher = m_voucherModel->itemFromIndex(current);
|
|
|
|
QSharedPointer<Voucher> voucher = m_voucherModel->itemFromIndex(current);
|
|
|
|