|
|
@ -78,6 +78,16 @@ void ShopForm::loadLast()
|
|
|
|
m_commodityModel->setData(srv.allSellableItems());
|
|
|
|
m_commodityModel->setData(srv.allSellableItems());
|
|
|
|
ui->commodityTable->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
|
|
|
|
ui->commodityTable->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
|
|
|
|
ui->commodityTable->setColumnHidden(3, true);
|
|
|
|
ui->commodityTable->setColumnHidden(3, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (srv.isEetEnabled())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ui->lblEetState->setText(srv.isEetOnline() ? tr("<a href=\"#eet\">Online</a>") : tr("<a href=\"#eet\">Offline</a>"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ui->labelEete->setVisible(false);
|
|
|
|
|
|
|
|
ui->lblEetState->setVisible(false);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ShopForm::fillRaceiptCombo()
|
|
|
|
void ShopForm::fillRaceiptCombo()
|
|
|
@ -320,12 +330,12 @@ void ShopForm::on_payButton_clicked()
|
|
|
|
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
dialog->show();
|
|
|
|
dialog->show();
|
|
|
|
|
|
|
|
|
|
|
|
connect(dialog, &QDialog::accepted, [this](){
|
|
|
|
connect(dialog, &QDialog::accepted, [this, dialog](){
|
|
|
|
ShopService srv;
|
|
|
|
ShopService srv;
|
|
|
|
srv.pay(m_voucher);
|
|
|
|
srv.pay(m_voucher);
|
|
|
|
QString eetMsg;
|
|
|
|
QString eetMsg;
|
|
|
|
|
|
|
|
|
|
|
|
if (srv.isEetEnabled())
|
|
|
|
if (srv.isEetEnabled() && dialog->sendToEet())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool eetRet = srv.processEet(m_voucher, eetMsg);
|
|
|
|
bool eetRet = srv.processEet(m_voucher, eetMsg);
|
|
|
|
|
|
|
|
|
|
|
@ -343,6 +353,7 @@ void ShopForm::on_payButton_clicked()
|
|
|
|
if (srv.isEetOnline() && QMessageBox::question(this, tr("EET error"), errMsg) == QMessageBox::Yes)
|
|
|
|
if (srv.isEetOnline() && QMessageBox::question(this, tr("EET error"), errMsg) == QMessageBox::Yes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
srv.setEetOnline(false);
|
|
|
|
srv.setEetOnline(false);
|
|
|
|
|
|
|
|
ui->lblEetState->setText(srv.isEetOnline() ? tr("<a href=\"#eet\">Online</a>") : tr("<a href=\"#eet\">Offline</a>"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -403,3 +414,11 @@ void ShopForm::on_commoditySearch_textChanged(const QString &text)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ShopForm::on_lblEetState_linkActivated(const QString &link)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ShopService srv;
|
|
|
|
|
|
|
|
srv.setEetOnline(!srv.isEetOnline());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ui->lblEetState->setText(srv.isEetOnline() ? tr("<a href=\"#eet\">Online</a>") : tr("<a href=\"#eet\">Offline</a>"));
|
|
|
|
|
|
|
|
}
|
|
|
|