Implemented communication with EET portal.
This commit is contained in:
@@ -4,6 +4,11 @@ ShopSettings::ShopSettings(QObject *parent) : QObject(parent)
|
||||
{
|
||||
m_codepage = ASCII;
|
||||
m_lettersPerLine = 48;
|
||||
|
||||
m_eetActive = false;
|
||||
m_eetMode = 1;
|
||||
m_eetTest = 0;
|
||||
m_eetPlayground = 0;
|
||||
}
|
||||
|
||||
QString ShopSettings::output() const
|
||||
@@ -45,3 +50,83 @@ void ShopSettings::setByMessage(const QString &byMessage)
|
||||
{
|
||||
m_byMessage = byMessage;
|
||||
}
|
||||
|
||||
bool ShopSettings::eetActive() const
|
||||
{
|
||||
return m_eetActive;
|
||||
}
|
||||
|
||||
void ShopSettings::setEetActive(bool eetActive)
|
||||
{
|
||||
m_eetActive = eetActive;
|
||||
}
|
||||
|
||||
QString ShopSettings::eetShopId() const
|
||||
{
|
||||
return m_eetShopId;
|
||||
}
|
||||
|
||||
void ShopSettings::setEetShopId(const QString &eetShopId)
|
||||
{
|
||||
m_eetShopId = eetShopId;
|
||||
}
|
||||
|
||||
QString ShopSettings::eetRegisterId() const
|
||||
{
|
||||
return m_eetRegisterId;
|
||||
}
|
||||
|
||||
void ShopSettings::setEetRegisterId(const QString &eetRegisterId)
|
||||
{
|
||||
m_eetRegisterId = eetRegisterId;
|
||||
}
|
||||
|
||||
int ShopSettings::eetMode() const
|
||||
{
|
||||
return m_eetMode;
|
||||
}
|
||||
|
||||
void ShopSettings::setEetMode(int eetMode)
|
||||
{
|
||||
m_eetMode = eetMode;
|
||||
}
|
||||
|
||||
QString ShopSettings::eetCertificate() const
|
||||
{
|
||||
return m_eetCertificate;
|
||||
}
|
||||
|
||||
void ShopSettings::setEetCertificate(const QString &eetCertificate)
|
||||
{
|
||||
m_eetCertificate = eetCertificate;
|
||||
}
|
||||
|
||||
QString ShopSettings::eetKeyPassword() const
|
||||
{
|
||||
return m_eetKeyPassword;
|
||||
}
|
||||
|
||||
void ShopSettings::setEetKeyPassword(const QString &eetKeyPassword)
|
||||
{
|
||||
m_eetKeyPassword = eetKeyPassword;
|
||||
}
|
||||
|
||||
bool ShopSettings::eetTest() const
|
||||
{
|
||||
return m_eetTest;
|
||||
}
|
||||
|
||||
void ShopSettings::setEetTest(bool eetTest)
|
||||
{
|
||||
m_eetTest = eetTest;
|
||||
}
|
||||
|
||||
bool ShopSettings::eetPlayground() const
|
||||
{
|
||||
return m_eetPlayground;
|
||||
}
|
||||
|
||||
void ShopSettings::setEetPlayground(bool eetPlayground)
|
||||
{
|
||||
m_eetPlayground = eetPlayground;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,15 @@ class ShopSettings : public QObject
|
||||
Q_PROPERTY(int lettersPerLine READ lettersPerLine WRITE setLettersPerLine)
|
||||
Q_PROPERTY(QString byMessage READ byMessage WRITE setByMessage)
|
||||
|
||||
Q_PROPERTY(bool eetActive READ eetActive WRITE setEetActive)
|
||||
Q_PROPERTY(QString eetShopId READ eetShopId WRITE setEetShopId)
|
||||
Q_PROPERTY(QString eetRegisterId READ eetRegisterId WRITE setEetRegisterId)
|
||||
Q_PROPERTY(int eetMode READ eetMode WRITE setEetMode)
|
||||
Q_PROPERTY(QString eetCertificate READ eetCertificate WRITE setEetCertificate)
|
||||
Q_PROPERTY(QString eetKeyPassword READ eetKeyPassword WRITE setEetKeyPassword)
|
||||
Q_PROPERTY(bool eetTest READ eetTest WRITE setEetTest)
|
||||
Q_PROPERTY(bool eetPlayground READ eetPlayground WRITE setEetPlayground)
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
@@ -31,11 +40,44 @@ public:
|
||||
QString byMessage() const;
|
||||
void setByMessage(const QString &byMessage);
|
||||
|
||||
bool eetActive() const;
|
||||
void setEetActive(bool eetActive);
|
||||
|
||||
QString eetShopId() const;
|
||||
void setEetShopId(const QString &eetShopId);
|
||||
|
||||
QString eetRegisterId() const;
|
||||
void setEetRegisterId(const QString &eetRegisterId);
|
||||
|
||||
int eetMode() const;
|
||||
void setEetMode(int eetMode);
|
||||
|
||||
QString eetCertificate() const;
|
||||
void setEetCertificate(const QString &eetCertificate);
|
||||
|
||||
QString eetKeyPassword() const;
|
||||
void setEetKeyPassword(const QString &eetKeyPassword);
|
||||
|
||||
bool eetTest() const;
|
||||
void setEetTest(bool eetTest);
|
||||
|
||||
bool eetPlayground() const;
|
||||
void setEetPlayground(bool eetPlayground);
|
||||
|
||||
private:
|
||||
QString m_output;
|
||||
CODEPAGE m_codepage;
|
||||
int m_lettersPerLine;
|
||||
QString m_byMessage;
|
||||
|
||||
bool m_eetActive;
|
||||
QString m_eetShopId;
|
||||
QString m_eetRegisterId;
|
||||
int m_eetMode;
|
||||
QString m_eetCertificate;
|
||||
QString m_eetKeyPassword;
|
||||
bool m_eetTest;
|
||||
bool m_eetPlayground;
|
||||
};
|
||||
|
||||
typedef QSharedPointer<ShopSettings> ShopSettingsPtr;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "ui_shopsettingsform.h"
|
||||
|
||||
#include <settingsservice.h>
|
||||
#include <combodata.h>
|
||||
#include <QFileDialog>
|
||||
#include "shopservice.h"
|
||||
|
||||
ShopSettingsForm::ShopSettingsForm(QWidget *parent) :
|
||||
@@ -14,6 +16,17 @@ ShopSettingsForm::ShopSettingsForm(QWidget *parent) :
|
||||
registerBinding(ui->lettersPerLine);
|
||||
registerBinding(ui->byMessage);
|
||||
|
||||
registerBinding(ui->eetActive);
|
||||
registerBinding(ui->eetShopId);
|
||||
registerBinding(ui->eetRegisterId);
|
||||
QList<ComboData> listModes;
|
||||
listModes << ComboData(0, tr("Simplifyed")) << ComboData(1, tr("Standard"));
|
||||
registerBinding(ui->eetMode, listModes);
|
||||
registerBinding(ui->eetCertificate);
|
||||
registerBinding(ui->eetKeyPassword);
|
||||
registerBinding(ui->eetTest);
|
||||
registerBinding(ui->eetPlayground);
|
||||
|
||||
m_itemModel = new AutoTableModel<ShopItem>();
|
||||
}
|
||||
|
||||
@@ -41,3 +54,13 @@ bool ShopSettingsForm::saveRecord()
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ShopSettingsForm::on_btnCertBrowse_clicked()
|
||||
{
|
||||
QString certFile = QFileDialog::getOpenFileName(this, "Certificate file", "", "P12 Files (*.p12)");
|
||||
|
||||
if (!certFile.isEmpty())
|
||||
{
|
||||
ui->eetCertificate->setText(certFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ public:
|
||||
|
||||
public slots:
|
||||
bool saveRecord();
|
||||
private slots:
|
||||
void on_btnCertBrowse_clicked();
|
||||
};
|
||||
|
||||
#endif // SHOPSETTINGSFORM_H
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
@@ -234,6 +234,121 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
<string>EET</string>
|
||||
</attribute>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="eetActive">
|
||||
<property name="title">
|
||||
<string>Activate EET</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Shop ID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="eetShopId"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>Cash register ID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="eetRegisterId"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>EET mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="eetMode"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Certificate file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="eetCertificate"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="btnCertBrowse">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Private key password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="eetKeyPassword">
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QCheckBox" name="eetTest">
|
||||
<property name="text">
|
||||
<string>Test mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="eetPlayground">
|
||||
<property name="text">
|
||||
<string>Communication with playground </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
Reference in New Issue
Block a user