|
|
|
@ -126,11 +126,11 @@ void ShopService::updateRelatedItem(VoucherItem* item, int countAdded)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShopService::processEet(VoucherPtr voucher)
|
|
|
|
|
bool ShopService::processEet(VoucherPtr voucher, QString message)
|
|
|
|
|
{
|
|
|
|
|
if (voucher->eetStatus() == Voucher::EET_NOT_ENTERING)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SettingsService srvSettings("SHOP");
|
|
|
|
@ -157,11 +157,12 @@ void ShopService::processEet(VoucherPtr voucher)
|
|
|
|
|
connect(sender, &EetSender::sendFinished, [this, voucher, sender, &loop](){
|
|
|
|
|
Transaction tx;
|
|
|
|
|
|
|
|
|
|
if (sender->resut()->status() == EetResult::RESPONSE_OK)
|
|
|
|
|
{
|
|
|
|
|
voucher->setEetBkp(sender->resut()->bkp());
|
|
|
|
|
voucher->setEetPkp(sender->resut()->pkp());
|
|
|
|
|
voucher->setEetFik(sender->resut()->fik());
|
|
|
|
|
|
|
|
|
|
if (sender->resut()->status() == EetResult::RESPONSE_OK)
|
|
|
|
|
{
|
|
|
|
|
voucher->setEetSendDateTime(QDateTime::currentDateTime());
|
|
|
|
|
voucher->setEetStatus(Voucher::EET_SENT);
|
|
|
|
|
}
|
|
|
|
@ -179,6 +180,30 @@ void ShopService::processEet(VoucherPtr voucher)
|
|
|
|
|
|
|
|
|
|
sender->sendRequest(&request);
|
|
|
|
|
loop.exec();
|
|
|
|
|
|
|
|
|
|
auto addMessage = [&message](EetMessage *msg, const QString &label){
|
|
|
|
|
if (message.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
message = label + "\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message += QString::number(msg->code()) + ": " + msg->message();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach (EetMessage *msg, sender->resut()->errors()) {
|
|
|
|
|
addMessage(msg, "Errors:");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (EetMessage *msg, sender->resut()->warnings()) {
|
|
|
|
|
addMessage(msg, "Warnings:");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return voucher->eetStatus() == Voucher::EET_SENT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShopService::setEetOnline(bool online)
|
|
|
|
|
{
|
|
|
|
|
EetSender::m_online = online;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShopService::moveItems(QList<VoucherItemPtr> items, VoucherPtr source, VoucherPtr target)
|
|
|
|
|