# Conflicts:
#	shop/receiptsaveform.cpp
#	shop/shopform.cpp
print
Josef Rokos 8 years ago
commit abed951e1f

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="cs_CZ">
<context>
<name>AddressbookForm</name>
<message>
<location filename="../addressbookform.ui" line="14"/>
<source>Form</source>
<translation></translation>
</message>
<message>
<location filename="../addressbookform.ui" line="20"/>
<source>Title</source>
<translation>Titul</translation>
</message>
<message>
<location filename="../addressbookform.ui" line="30"/>
<source>First Name</source>
<translation>Křestní jméno</translation>
</message>
<message>
<location filename="../addressbookform.ui" line="62"/>
<source>Last Name</source>
<translation>Příjmení</translation>
</message>
<message>
<location filename="../addressbookform.ui" line="69"/>
<source>Day of Birth</source>
<translation>Datum narození</translation>
</message>
<message>
<location filename="../addressbookform.ui" line="76"/>
<source>ID Card Number</source>
<translation>Číslo dokladu totožnosti</translation>
</message>
<message>
<location filename="../addressbookform.ui" line="83"/>
<source>City</source>
<translation>Město</translation>
</message>
<message>
<location filename="../addressbookform.ui" line="90"/>
<source>ZTP</source>
<translation>ZTP</translation>
</message>
<message>
<location filename="../addressbookform.ui" line="97"/>
<source>Street</source>
<translation>Ulice</translation>
</message>
<message>
<location filename="../addressbookform.ui" line="107"/>
<source>House Number</source>
<translation>Číslo popisné</translation>
</message>
<message>
<location filename="../addressbookform.ui" line="114"/>
<source>ZIP</source>
<translation>PSČ</translation>
</message>
</context>
</TS>

@ -20,7 +20,7 @@
<message>
<location filename="../mainwindow.ui" line="14"/>
<source>MainWindow</source>
<translation>Nastaveni</translation>
<translation type="unfinished">Prodejna</translation>
</message>
<message>
<location filename="../mainwindow.ui" line="64"/>

@ -3,6 +3,7 @@
#include "commodityform.h"
#include "commoditygrid.h"
#include "commoditysettingsform.h"
#include "commodityservice.h"
Commodity::Commodity()
{
@ -13,7 +14,7 @@ void Commodity::initServiceUi()
CommodityGrid *grid = new CommodityGrid();
CommodityForm *form = new CommodityForm();
m_service = new Service<CommodityData>;
m_service = new CommodityService();
m_ui = grid;
((CommodityGrid *) m_ui)->setForm(form);
m_settingsUi = new CommoditySettingsForm();

@ -20,7 +20,8 @@ SOURCES += commodity.cpp \
commoditytablemodel.cpp \
commodityform.cpp \
commoditygrid.cpp \
commoditysettingsform.cpp
commoditysettingsform.cpp \
commodityservice.cpp
HEADERS += commodity.h\
commodity_global.h \
@ -30,7 +31,8 @@ HEADERS += commodity.h\
commoditytablemodel.h \
commodityform.h \
commoditygrid.h \
commoditysettingsform.h
commoditysettingsform.h \
commodityservice.h
unix {
target.path = /usr/lib
@ -53,6 +55,7 @@ DESTDIR = ../plugins
ODB_FILES = commodity/data/commodity-data.h
H_DIR = $$PWD/data/*.h
ODB_OTHER_INCLUDES = -I $$PWD/../shop
include(../odb.pri)
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber
@ -73,3 +76,10 @@ FORMS += \
RESOURCES += \
commodityrc.qrc
TRANSLATIONS = translations/commodity_cs_CZ.ts
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../plugins/ -lshop
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../plugins/ -lshop
else:unix: LIBS += -L$$OUT_PWD/../plugins/ -lshop
INCLUDEPATH += $$PWD/../shop
DEPENDPATH += $$PWD/../shop

@ -0,0 +1,31 @@
#include "commodityservice.h"
#include "commodity-odb.hxx"
CommodityService::CommodityService()
{
}
QList<QSharedPointer<ShopItem> > CommodityService::shopItems()
{
QList<QSharedPointer<ShopItem> > ret;
foreach (QSharedPointer<CommodityData> data, all()) {
ret.append(qSharedPointerDynamicCast<ShopItem, CommodityData>(data));
}
return ret;
}
void CommodityService::addedToVoucher(int itemId, int countAdded)
{
QSharedPointer<CommodityData> commodity = loadById(itemId);
if (!commodity.isNull())
{
commodity->setCount(commodity->count() - countAdded);
}
update(commodity);
}

@ -0,0 +1,19 @@
#ifndef COMMODITYSERVICE_H
#define COMMODITYSERVICE_H
#include <service.h>
#include <isellableservice.h>
#include "data/commodity-data.h"
class CommodityService : public Service<CommodityData>, public ISellableService
{
public:
CommodityService();
// ISellableService interface
public:
QList<QSharedPointer<ShopItem> > shopItems() override;
void addedToVoucher(int itemId, int countAdded) override;
};
#endif // COMMODITYSERVICE_H

@ -2,13 +2,13 @@
#include <define.h>
CommodityData::CommodityData(QObject *parent)
:QObject(parent)
:ShopItem(parent)
{
m_count = 0;
m_price = 0;
m_vat = Enums::NONE;
}
int CommodityData::id() const
int CommodityData::id()
{
return m_id;
}
@ -17,7 +17,7 @@ void CommodityData::setId(int id)
{
m_id = id;
}
QString CommodityData::name() const
QString CommodityData::name()
{
return m_name;
}
@ -83,6 +83,21 @@ void CommodityData::setCount(int count)
m_count = count;
}
QDecDouble CommodityData::unitPrice()
{
return price();
}
Enums::VatType CommodityData::vatType()
{
return vat();
}
QString CommodityData::pluginId()
{
return "COMMODITY";
}

@ -5,17 +5,18 @@
#include <QString>
#include <odb/core.hxx>
#include "commoditytypedata.h"
#include <shopitem.h>
#include <QDecDouble.hh>
#include <QSharedDataPointer>
#include <enums.h>
#pragma db object
class CommodityData : public QObject
class CommodityData : public ShopItem
{
Q_OBJECT
Q_PROPERTY(QString code READ code WRITE setCode)
Q_PROPERTY(QString name READ name WRITE setName)
Q_PROPERTY(QString shortName READ shortName WRITE setShortName)
Q_PROPERTY(QString code READ code WRITE setCode)
Q_PROPERTY(QSharedPointer<QObject> type READ type WRITE setType)
Q_PROPERTY(QDecDouble price READ price WRITE setPrice)
Q_PROPERTY(Enums::VatType vat READ vat WRITE setVat)
@ -24,10 +25,10 @@ class CommodityData : public QObject
public:
CommodityData(QObject *parent = 0);
int id() const;
int id() override;
void setId(int id);
QString name() const;
QString name() override;
void setName(const QString &name);
QString shortName() const;
@ -59,6 +60,12 @@ private:
int m_price;
Enums::VatType m_vat;
int m_count;
// IShopItem interface
public:
QDecDouble unitPrice() override;
Enums::VatType vatType() override;
QString pluginId() override;
};
#endif // COMMODITYDATA_H

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="cs_CZ">
<context>
<name>CommodityForm</name>
<message>
<location filename="../commodityform.ui" line="14"/>
<source>Form</source>
<translation>Zboží</translation>
</message>
<message>
<location filename="../commodityform.ui" line="20"/>
<source>Name</source>
<translation>Název</translation>
</message>
<message>
<location filename="../commodityform.ui" line="30"/>
<source>Short Name</source>
<translation>Zobrazit na účtence</translation>
</message>
<message>
<location filename="../commodityform.ui" line="40"/>
<source>Code</source>
<translation>Kód</translation>
</message>
<message>
<location filename="../commodityform.ui" line="50"/>
<source>Type</source>
<translation>Druh</translation>
</message>
<message>
<location filename="../commodityform.ui" line="57"/>
<source>Price</source>
<translation>Cena</translation>
</message>
<message>
<location filename="../commodityform.ui" line="64"/>
<source>Vat</source>
<translation>DPH</translation>
</message>
<message>
<location filename="../commodityform.ui" line="71"/>
<source>Count</source>
<translation>Počet</translation>
</message>
<message>
<location filename="../commodityform.cpp" line="18"/>
<source>None</source>
<translation>Žádná</translation>
</message>
<message>
<location filename="../commodityform.cpp" line="19"/>
<source>High</source>
<translation>Vysoká</translation>
</message>
<message>
<location filename="../commodityform.cpp" line="20"/>
<source>First Lower</source>
<translation>První snížená</translation>
</message>
<message>
<location filename="../commodityform.cpp" line="21"/>
<source>Second Lower</source>
<translation>Druhá snížená</translation>
</message>
</context>
<context>
<name>CommoditySettingsForm</name>
<message>
<location filename="../commoditysettingsform.ui" line="14"/>
<source>Form</source>
<translation></translation>
</message>
<message>
<location filename="../commoditysettingsform.ui" line="26"/>
<source>+</source>
<translation>+</translation>
</message>
<message>
<location filename="../commoditysettingsform.ui" line="37"/>
<source>-</source>
<translation>-</translation>
</message>
</context>
</TS>

@ -24,6 +24,7 @@ public:
:ITableModel(parent)
{
filtered = false;
m_checkboxSelect = false;
}
virtual ~AutoTableModel() {}
@ -50,6 +51,21 @@ public:
QVariant data(const QModelIndex &index, int role) const
{
if (index.column() == 0 && m_checkboxSelect)
{
if (role == Qt::CheckStateRole)
{
if (m_selectedRows.contains(index.row()))
{
return Qt::Checked;
}
else
{
return Qt::Unchecked;
}
}
}
QSharedPointer<T> entity = m_list.at(index.row());
QObject *rawEntity = (QObject*)entity.data();
@ -189,6 +205,21 @@ public:
m_translations = translations;
}
QList<int> selectedRows() const
{
return m_selectedRows;
}
QList<QSharedPointer<T> > selectedItems()
{
QList<QSharedPointer<T> > ret;
foreach (int row, m_selectedRows) {
ret.append(m_list[row]);
}
return ret;
}
protected:
void handleFilter(const QString &filter) override
{
@ -220,10 +251,10 @@ protected:
private:
QList<QSharedPointer<T> > m_list;
QList<QSharedPointer<T> > m_fullList;
QList<int> m_selectedRows;
QMap<QString, QString> m_translations;
bool filtered;
// QAbstractItemModel interface
public:
virtual bool setData(const QModelIndex &index, const QVariant &value, int role) override
@ -236,10 +267,21 @@ public:
rawEntity->setProperty(rawEntity->metaObject()->property(index.column() + 1).name(), value);
}
if (role == Qt::CheckStateRole)
{
if (m_selectedRows.contains(index.row()))
{
m_selectedRows.removeOne(index.row());
}
else
{
m_selectedRows.append(index.row());
}
}
emit editCompleted();
return true;
}
};
#endif // ODBTABLEMODEL_H

@ -65,6 +65,10 @@ void Context::loadPlugins()
m_plugins.append(plugin);
}
}
else
{
qDebug() << pluginLoader.errorString();
}
}
QString dbPath = m_settings->value("db/path", "").toString();

@ -3,7 +3,17 @@
ITableModel::ITableModel(QObject *parent)
:QAbstractTableModel(parent)
{
m_checkboxSelect = false;
}
bool ITableModel::checkboxSelect() const
{
return m_checkboxSelect;
}
void ITableModel::setCheckboxSelect(bool checkboxSelect)
{
m_checkboxSelect = checkboxSelect;
}
void ITableModel::filter(const QString &filter)
@ -18,12 +28,17 @@ void ITableModel::restore()
Qt::ItemFlags ITableModel::flags(const QModelIndex &index) const
{
if (index.column() == 0 && m_checkboxSelect)
{
return Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled;
}
if (m_editableCols.contains(index.column()))
{
return Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled;
}
return QAbstractTableModel::flags(index);
return QAbstractTableModel::flags(index) | Qt::ItemIsDragEnabled;
}
void ITableModel::setEditableCols(const QList<int> cols)

@ -16,6 +16,7 @@ public:
protected:
virtual void handleFilter(const QString &filter) = 0;
virtual void handleRestore() = 0;
bool m_checkboxSelect;
public slots:
void filter(const QString &filter);
@ -29,6 +30,9 @@ public:
virtual Qt::ItemFlags flags(const QModelIndex &index) const override;
void setEditableCols(const QList<int> cols);
bool checkboxSelect() const;
void setCheckboxSelect(bool checkboxSelect);
private:
QList<int> m_editableCols;
};

@ -126,86 +126,132 @@
<translation></translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="20"/>
<location filename="../settings/globalsettingsform.ui" line="33"/>
<source>Base settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="121"/>
<source>Company info</source>
<translation>Informace o společnosti</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="29"/>
<location filename="../settings/globalsettingsform.ui" line="130"/>
<source>IC</source>
<translation>IČO</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="39"/>
<location filename="../settings/globalsettingsform.ui" line="140"/>
<source>VAT number</source>
<translation>DIČ</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="49"/>
<location filename="../settings/globalsettingsform.ui" line="150"/>
<source>VAT payer</source>
<translation>Plátce DPH</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="62"/>
<location filename="../settings/globalsettingsform.ui" line="163"/>
<source>VAT rates</source>
<translation>Sazby DPH</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="68"/>
<location filename="../settings/globalsettingsform.ui" line="169"/>
<source>High</source>
<translation>Vysoká</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="82"/>
<location filename="../settings/globalsettingsform.ui" line="183"/>
<source>First lower</source>
<translation>První snížená</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="96"/>
<location filename="../settings/globalsettingsform.ui" line="197"/>
<source>Second lower</source>
<translation>Druhá snížená</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="116"/>
<location filename="../settings/globalsettingsform.ui" line="218"/>
<location filename="../settings/globalsettingsform.ui" line="279"/>
<source>Number series</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="247"/>
<source>Edit name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="258"/>
<source>Season</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="265"/>
<source>Create new</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="39"/>
<source>Contact</source>
<translation>Kontaktní údaje</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="122"/>
<location filename="../settings/globalsettingsform.ui" line="45"/>
<source>Firm Name</source>
<translation>Název společnosti</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="132"/>
<location filename="../settings/globalsettingsform.ui" line="55"/>
<source>Street</source>
<translation>Ulice</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="142"/>
<location filename="../settings/globalsettingsform.ui" line="65"/>
<source>House Number</source>
<translation>Číslo popisné</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="152"/>
<location filename="../settings/globalsettingsform.ui" line="75"/>
<source>City</source>
<translation>Město</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="162"/>
<location filename="../settings/globalsettingsform.ui" line="85"/>
<source>ZIP code</source>
<translation>PSČ</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="175"/>
<location filename="../settings/globalsettingsform.ui" line="181"/>
<location filename="../settings/globalsettingsform.ui" line="98"/>
<location filename="../settings/globalsettingsform.ui" line="104"/>
<source>Logo</source>
<translation>Logo</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.ui" line="188"/>
<location filename="../settings/globalsettingsform.ui" line="111"/>
<source>Select file</source>
<translation>Vyber soubor</translation>
</message>
<message>
<location filename="../settings/globalsettingsform.cpp" line="77"/>
<source>Switch season</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settings/globalsettingsform.cpp" line="77"/>
<source>Realy switch active season?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settings/globalsettingsform.cpp" line="138"/>
<source>New season</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settings/globalsettingsform.cpp" line="138"/>
<source>Realy create new season and switch to it?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>GridForm</name>
@ -314,6 +360,19 @@
<translation>Název filtru</translation>
</message>
</context>
<context>
<name>SeasonNameDialog</name>
<message>
<location filename="../settings/seasonnamedialog.ui" line="14"/>
<source>Season</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settings/seasonnamedialog.ui" line="23"/>
<source>Season name</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsForm</name>
<message>

@ -46,7 +46,7 @@ ODB_FLAGS += -I $$PWD/core
ODB_FLAGS += -I $$PWD/qdecimal/src
ODB_FLAGS += -I $$PWD/qdecimal/decnumber
ODB_FLAGS += $$ODB_OTHER_INCLUDES
ODB_FLAGS += -D __PIC__
ODB_FLAGS += -x -std=c++11 -x -fPIC
win32 {
ODB_FLAGS += -I d:/prac/odb/libodb-2.4.0

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="cs_CZ">
<context>
<name>AccServiceForm</name>
<message>
<location filename="../accserviceform.ui" line="14"/>
<source>Form</source>
<translation>Služba</translation>
</message>
<message>
<location filename="../accserviceform.ui" line="20"/>
<source>Service Name</source>
<translation>Název</translation>
</message>
<message>
<location filename="../accserviceform.ui" line="30"/>
<source>Price</source>
<translation>Cena</translation>
</message>
<message>
<location filename="../accserviceform.ui" line="37"/>
<source>Service Type</source>
<translation>Druh</translation>
</message>
<message>
<location filename="../accserviceform.ui" line="47"/>
<source>Sale Possible</source>
<translation>Umožnit slevu</translation>
</message>
<message>
<location filename="../accserviceform.ui" line="54"/>
<source>Active</source>
<translation>Aktivní</translation>
</message>
<message>
<location filename="../accserviceform.ui" line="64"/>
<source>ServiceCode</source>
<translation>Kód</translation>
</message>
<message>
<location filename="../accserviceform.ui" line="74"/>
<source>Vat Type</source>
<translation>Sazba DPH</translation>
</message>
<message>
<location filename="../accserviceform.cpp" line="18"/>
<source>Car</source>
<translation>Vozidlo</translation>
</message>
<message>
<location filename="../accserviceform.cpp" line="18"/>
<source>Tent</source>
<translation>Stan</translation>
</message>
<message>
<location filename="../accserviceform.cpp" line="18"/>
<source>OTHER</source>
<translation>Ostatní</translation>
</message>
<message>
<location filename="../accserviceform.cpp" line="21"/>
<source>None</source>
<translation>Žádná</translation>
</message>
<message>
<location filename="../accserviceform.cpp" line="22"/>
<source>High</source>
<translation>Vysoká</translation>
</message>
<message>
<location filename="../accserviceform.cpp" line="23"/>
<source>First Lower</source>
<translation>První snížená</translation>
</message>
<message>
<location filename="../accserviceform.cpp" line="24"/>
<source>Second Lower</source>
<translation>Druhá snížená</translation>
</message>
</context>
</TS>

@ -0,0 +1,69 @@
#include "favorititem.h"
#include <define.h>
FavoritItem::FavoritItem()
{
m_id = 0;
m_vatType = Enums::NONE;
m_unitPrice = 0;
}
int FavoritItem::id()
{
return m_id;
}
void FavoritItem::setId(int id)
{
m_id = id;
}
QString FavoritItem::name()
{
return m_name;
}
void FavoritItem::setName(const QString &name)
{
m_name = name;
}
QDecDouble FavoritItem::unitPrice()
{
return TO_DEC(m_unitPrice);
}
void FavoritItem::setUnitPrice(QDecDouble unitPrice)
{
m_unitPrice = FROM_DEC(unitPrice);
}
Enums::VatType FavoritItem::vatType()
{
return m_vatType;
}
void FavoritItem::setVatType(const Enums::VatType &vatType)
{
m_vatType = vatType;
}
QString FavoritItem::pluginId()
{
return m_pluginId;
}
void FavoritItem::setPluginId(const QString &pluginId)
{
m_pluginId = pluginId;
}
QString FavoritItem::favButtonName() const
{
return m_favButtonName;
}
void FavoritItem::setFavButtonName(const QString &favButtonName)
{
m_favButtonName = favButtonName;
}

@ -0,0 +1,62 @@
#ifndef FAVORITITEM_H
#define FAVORITITEM_H
#include <QObject>
#include <QSharedPointer>
#include <QString>
#include <QDecDouble.hh>
#include <enums.h>
#include <ishopitem.h>
#include <odb/core.hxx>
class IShopItem;
#pragma db object
class FavoritItem : public QObject, public IShopItem
{
Q_OBJECT
Q_PROPERTY(int id READ id WRITE setId)
Q_PROPERTY(QString name READ name WRITE setName)
Q_PROPERTY(QDecDouble unitPrice READ unitPrice WRITE setUnitPrice)
Q_PROPERTY(Enums::VatType vatType READ vatType WRITE setVatType)
Q_PROPERTY(QString pluginId READ pluginId WRITE setPluginId)
Q_PROPERTY(QString favButtonName READ favButtonName WRITE setFavButtonName)
public:
FavoritItem();
// IShopItem interface
public:
int id() override;
void setId(int id);
QString name() override;
void setName(const QString &name);
QDecDouble unitPrice() override;
void setUnitPrice(QDecDouble unitPrice);
Enums::VatType vatType() override;
void setVatType(const Enums::VatType &vatType);
QString pluginId() override;
void setPluginId(const QString &pluginId);
QString favButtonName() const;
void setFavButtonName(const QString &favButtonName);
private:
friend class odb::access;
#pragma db id auto
int m_id;
QString m_name;
int m_unitPrice;
Enums::VatType m_vatType;
QString m_pluginId;
QString m_favButtonName;
};
typedef QSharedPointer<FavoritItem> FavoritItemPtr;
#endif // FAVORITITEM_H

@ -3,5 +3,6 @@
#include "voucher.h"
#include "voucheritem.h"
#include "favorititem.h"
#endif // SHOPDATA_H

@ -16,6 +16,7 @@ Voucher::Voucher(QObject *parent) : QObject(parent)
m_totalPriceVatFirstLower = 0;
m_totalPriceVatSecondLower = 0;
m_totalPrice = 0;
m_eetStatus = EET_FOR_SEND;
}
QString Voucher::name() const
@ -230,6 +231,56 @@ void Voucher::setPayDateTime(const QDateTime &payDateTime)
m_payDateTime = payDateTime;
}
Voucher::EetStatus Voucher::eetStatus() const
{
return m_eetStatus;
}
void Voucher::setEetStatus(const Voucher::EetStatus &eetStatus)
{
m_eetStatus = eetStatus;
}
QDateTime Voucher::eetSendDateTime() const
{
return m_eetSendDateTime;
}
void Voucher::setEetSendDateTime(const QDateTime &eetSendDateTime)
{
m_eetSendDateTime = eetSendDateTime;
}
QString Voucher::eetPkp() const
{
return m_eetPkp;
}
void Voucher::setEetPkp(const QString &eetPkp)
{
m_eetPkp = eetPkp;
}
QString Voucher::eetBkp() const
{
return m_eetBkp;
}
void Voucher::setEetBkp(const QString &eetBkp)
{
m_eetBkp = eetBkp;
}
QString Voucher::eetFik() const
{
return m_eetFik;
}
void Voucher::setEetFik(const QString &eetFik)
{
m_eetFik = eetFik;
}
int Voucher::id() const
{
return m_id;

@ -28,7 +28,13 @@ class Voucher : public QObject
Q_PROPERTY(QDecDouble priceVatFirstLower READ priceVatFirstLower WRITE setPriceVatFirstLower)
Q_PROPERTY(QDecDouble priceVatSecondLower READ priceVatSecondLower WRITE setPriceVatSecondLower)
Q_PROPERTY(QDecDouble totalPrice READ totalPrice WRITE setTotalPrice)
Q_PROPERTY(EetStatus eetStatus READ eetStatus WRITE setEetStatus)
Q_PROPERTY(QDateTime eetSendDateTime READ eetSendDateTime WRITE setEetSendDateTime)
Q_PROPERTY(QString eetBkp READ eetBkp WRITE setEetBkp)
Q_PROPERTY(QString eetPkp READ eetPkp WRITE setEetPkp)
Q_PROPERTY(QString eetFik READ eetFik WRITE setEetFik)
Q_ENUMS(VoucherStatus)
Q_ENUMS(EetStatus)
Q_PROPERTY(VoucherStatus status READ status WRITE setStatus)
public:
@ -42,6 +48,14 @@ public:
PAID
};
enum EetStatus
{
EET_FOR_SEND,
EET_NOT_ENTERING,
EET_SENT,
EET_ERROR
};
int id() const;
void setId(int id);
@ -110,6 +124,21 @@ public:
QDateTime payDateTime() const;
void setPayDateTime(const QDateTime &payDateTime);
EetStatus eetStatus() const;
void setEetStatus(const EetStatus &eetStatus);
QDateTime eetSendDateTime() const;
void setEetSendDateTime(const QDateTime &eetSendDateTime);
QString eetPkp() const;
void setEetPkp(const QString &eetPkp);
QString eetBkp() const;
void setEetBkp(const QString &eetBkp);
QString eetFik() const;
void setEetFik(const QString &eetFik);
private:
friend class odb::access;
#pragma db id auto
@ -131,6 +160,11 @@ private:
int m_totalPriceVatFirstLower;
int m_totalPriceVatSecondLower;
int m_totalPrice;
EetStatus m_eetStatus;
QDateTime m_eetSendDateTime;
QString m_eetPkp;
QString m_eetBkp;
QString m_eetFik;
#pragma db value_not_null inverse(m_voucher)
QOdbList<QSharedPointer<VoucherItem> > m_items;
VoucherStatus m_status;

@ -39,8 +39,9 @@ int VoucherItem::count() const
void VoucherItem::setCount(int count)
{
int oldCount = m_count;
m_count = count;
emit countChanged();
emit countChanged(oldCount);
}
QDecDouble VoucherItem::unitPrice() const

@ -63,7 +63,7 @@ public:
void setVoucher(const QWeakPointer<Voucher> &voucher);
signals:
void countChanged();
void countChanged(int oldCount);
private:
friend class odb::access;

@ -0,0 +1,19 @@
#include "eetbatchdialog.h"
#include "ui_eetbatchdialog.h"
EetBatchDialog::EetBatchDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::EetBatchDialog)
{
ui->setupUi(this);
}
EetBatchDialog::~EetBatchDialog()
{
delete ui;
}
void EetBatchDialog::addLog(const QString &log)
{
ui->logView->setPlainText(ui->logView->toPlainText() + log);
}

@ -0,0 +1,23 @@
#ifndef EETBATCHDIALOG_H
#define EETBATCHDIALOG_H
#include <QDialog>
namespace Ui {
class EetBatchDialog;
}
class EetBatchDialog : public QDialog
{
Q_OBJECT
public:
explicit EetBatchDialog(QWidget *parent = 0);
~EetBatchDialog();
void addLog(const QString &log);
private:
Ui::EetBatchDialog *ui;
};
#endif // EETBATCHDIALOG_H

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EetBatchDialog</class>
<widget class="QDialog" name="EetBatchDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>324</width>
<height>272</height>
</rect>
</property>
<property name="windowTitle">
<string>EET batch send</string>
</property>
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPlainTextEdit" name="logView">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>EetBatchDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>EetBatchDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

@ -0,0 +1,8 @@
<?xml version="1.0" ?><svg clip-rule="evenodd" fill-rule="evenodd" image-rendering="optimizeQuality" shape-rendering="geometricPrecision" text-rendering="geometricPrecision" viewBox="0 0 500 500" xmlns="http://www.w3.org/2000/svg"><defs><style type="text/css"><![CDATA[
.str1 {stroke:#434242;stroke-width:7.5;stroke-linejoin:round}
.str0 {stroke:#434242;stroke-width:10;stroke-linejoin:round}
.fil0 {fill:#434242}
.fil1 {fill:#DDDEDE}
.fil2 {fill:#FFFFFF}
.fil3 {fill:url(#id0)}
]]></style><linearGradient gradientUnits="userSpaceOnUse" id="id0" x1="459.999" x2="39.999" y1="378.236" y2="378.236"><stop offset="0" stop-color="#008BFF"/><stop offset="1" stop-color="#0af"/></linearGradient></defs><g id="Layer_x0020_1"><polygon class="fil0 str0" points="40,316 460,316 400,220 100,220"/><rect class="fil1 str1" height="260" rx="20" ry="20" transform="matrix(0 .846 .846 0 140.002 62.309)" width="420"/><polygon class="fil2 str1" points="140,397 140,79 275,240"/><path class="fil2 str1" d="M322 418h21c9 0 17-8 17-17v-322c0-9-8-17-17-17h-21l-93 161c-9 13-9 21 0 34l93 161z"/><path class="fil3 str0" d="M40 316h130v39c0 8 7 15 15 15h130c8 0 15-7 15-15v-39h130v99c0 14-11 25-25 25h-370c-14 0-25-11-25-25v-99z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1,5 @@
#include "isellableservice.h"
ISellableService::ISellableService()
{
}

@ -2,14 +2,17 @@
#define ISELLABLESERVICE_H
#include "shop_global.h"
#include "ishopitem.h"
#include "shopitem.h"
#include <QList>
#include <QSharedPointer>
class SHOPSHARED_EXPORT ISellableService
{
public:
QList<QSharedPointer<IShopItem> > shopItems() = 0;
ISellableService();
virtual QList<QSharedPointer<ShopItem> > shopItems() = 0;
virtual void addedToVoucher(int itemId, int countAdded) = 0;
};
#endif // ISELLABLESERVICE_H

@ -5,6 +5,7 @@
#include "receiptgenerator.h"
#include "shopservice.h"
#include "eetbatchdialog.h"
PaydVouchersDialog::PaydVouchersDialog(QWidget *parent) :
QDialog(parent),
@ -14,10 +15,30 @@ PaydVouchersDialog::PaydVouchersDialog(QWidget *parent) :
m_voucherModel = new AutoTableModel<Voucher>(this);
m_itemModel = new AutoTableModel<VoucherItem>(this);
m_voucherModel->setTranslations(Context::instance().plugin("SHOP")->translations());
m_itemModel->setTranslations(Context::instance().plugin("SHOP")->translations());
ui->tableVouchers->setModel(m_voucherModel);
ui->tableItems->setModel(m_itemModel);
ui->tableVouchers->setColumnHidden(5, true);
ui->tableVouchers->setColumnHidden(6, true);
ui->tableVouchers->setColumnHidden(7, true);
ui->tableVouchers->setColumnHidden(8, true);
ui->tableVouchers->setColumnHidden(9, true);
ui->tableVouchers->setColumnHidden(10, true);
ui->tableVouchers->setColumnHidden(12, true);
ui->tableVouchers->setColumnHidden(13, true);
ui->tableVouchers->setColumnHidden(14, true);
ui->tableVouchers->setColumnHidden(15, true);
ui->tableVouchers->setColumnHidden(16, true);
ui->tableVouchers->setColumnHidden(17, true);
ui->tableVouchers->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch);
ui->tableVouchers->horizontalHeader()->setSectionResizeMode(3, QHeaderView::Stretch);
ui->tableVouchers->horizontalHeader()->setSectionResizeMode(4, QHeaderView::Stretch);
ui->tableItems->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
ShopService srv;
m_voucherModel->setData(srv.paiedVouchers());
@ -27,6 +48,23 @@ PaydVouchersDialog::PaydVouchersDialog(QWidget *parent) :
m_itemModel->setData(voucher->items());
ui->total->setText(QString::number(voucher->totalPrice().toDouble(), 'f', 2));
switch (voucher->eetStatus()) {
case Voucher::EET_NOT_ENTERING:
ui->lblEetStatus->setText(tr("not entering"));
break;
case Voucher::EET_FOR_SEND:
ui->lblEetStatus->setText(tr("for send"));
break;
case Voucher::EET_ERROR:
ui->lblEetStatus->setText(tr("error"));
break;
case Voucher::EET_SENT:
ui->lblEetStatus->setText(tr("sent"));
break;
default:
break;
}
ui->btnPrint->setEnabled(true);
ui->btnSave->setEnabled(true);
});
@ -59,3 +97,36 @@ void PaydVouchersDialog::on_btnSave_clicked()
generator.save();
}
}
void PaydVouchersDialog::on_btnEetNotSen_clicked(bool checked)
{
ShopService srv;
if (checked)
{
m_voucherModel->setData(srv.vouchersForEet());
}
else
{
m_voucherModel->setData(srv.paiedVouchers());
}
m_itemModel->setData(QList<VoucherItemPtr>());
}
void PaydVouchersDialog::on_btnSendEet_clicked()
{
ShopService srv;
QList<VoucherPtr> vouchers = srv.vouchersForEet();
EetBatchDialog *dialog = new EetBatchDialog(this);
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
foreach (VoucherPtr vch, vouchers) {
QString msg;
bool sent = srv.processEet(vch, msg);
dialog->addLog(vch->numSer() + ": ");
dialog->addLog(sent ? "OK\n" : tr("Error"));
dialog->addLog((msg.isEmpty() && !sent) ? "\n" : ": " + msg);
}
}

@ -24,6 +24,10 @@ private slots:
void on_btnSave_clicked();
void on_btnEetNotSen_clicked(bool checked);
void on_btnSendEet_clicked();
private:
Ui::PaydVouchersDialog *ui;

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>798</width>
<height>514</height>
<width>900</width>
<height>650</height>
</rect>
</property>
<property name="windowTitle">
@ -72,6 +72,49 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnEetNotSen">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../core/rc.qrc">
<normaloff>:/icons/filter.svg</normaloff>:/icons/filter.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnSendEet">
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="shoprc.qrc">
<normaloff>:/icons/sendEet.svg</normaloff>:/icons/sendEet.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>32</width>
<height>32</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
@ -90,6 +133,12 @@
</item>
<item>
<widget class="QTableView" name="tableVouchers">
<property name="minimumSize">
<size>
<width>0</width>
<height>300</height>
</size>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
@ -110,6 +159,39 @@
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_3" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>EET:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblEetStatus">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_2">
@ -167,6 +249,7 @@
</layout>
</widget>
<resources>
<include location="shoprc.qrc"/>
<include location="../core/rc.qrc"/>
</resources>
<connections/>

@ -138,7 +138,13 @@ QByteArray ReceiptGenerator::generate()
out.append("\x1b\x21");
out.append((char)0);
out.append("\x0a");
out.append("BKP:");
out.append("\x0a");
out.append(prepareString(m_voucher->eetBkp()));
out.append("\x0a");
out.append("FIK:");
out.append("\x0a");
out.append(prepareString(m_voucher->eetFik()));
out.append("\x0a");
out.append("\x0a");
out.append("\x0a");

@ -30,6 +30,7 @@ ReceiptLoadForm::ReceiptLoadForm(QWidget *parent) :
ui->tabVouchers->setColumnWidth(4, 200);
m_itemModel = new AutoTableModel<VoucherItem>(this);
m_itemModel->setCheckboxSelect(true);
ui->tabItems->setModel(m_itemModel);
ui->tabItems->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
@ -46,6 +47,16 @@ ReceiptLoadForm::~ReceiptLoadForm()
delete ui;
}
QList<VoucherItemPtr> ReceiptLoadForm::selectedItems()
{
return m_itemModel->selectedItems();
}
VoucherPtr ReceiptLoadForm::selectedVoucher()
{
return m_voucherModel->itemFromIndex(ui->tabVouchers->currentIndex());
}
void ReceiptLoadForm::on_lineEdit_textChanged(const QString &text)
{
QSortFilterProxyModel proxy;

@ -16,6 +16,8 @@ class ReceiptLoadForm : public QDialog
public:
explicit ReceiptLoadForm(QWidget *parent = 0);
~ReceiptLoadForm();
QList<VoucherItemPtr> selectedItems();
VoucherPtr selectedVoucher();
private slots:
void on_lineEdit_textChanged(const QString &text);

@ -26,18 +26,16 @@ ReceiptSaveForm::ReceiptSaveForm(QSharedPointer<Voucher> voucher, QWidget *paren
m_voucherModel->setData(srv.all(QString("status = %1").arg(QString::number(Voucher::NOT_PAID))));
m_voucherModel->setTranslations(Context::instance().plugin("SHOP")->translations());
ui->tabVouchers->setModel(m_voucherModel);
ui->tabVouchers->hideColumn(0);
ui->tabVouchers->hideColumn(1);
ui->tabVouchers->hideColumn(3);
ui->tabVouchers->hideColumn(4);
ui->tabVouchers->hideColumn(5);
ui->tabVouchers->hideColumn(6);
ui->tabVouchers->hideColumn(7);
ui->tabVouchers->hideColumn(8);
ui->tabVouchers->hideColumn(9);
ui->tabVouchers->hideColumn(10);
ui->tabVouchers->hideColumn(12);
ui->tabVouchers->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch);
ui->tabVouchers->setColumnWidth(3, 200);
ui->tabVouchers->setColumnWidth(4, 200);
ui->tabVouchers->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
ui->tabVouchers->setColumnWidth(0, 190);
ui->tabVouchers->setColumnWidth(2, 200);
connect(ui->tabVouchers->selectionModel(), &QItemSelectionModel::currentRowChanged, [this](QModelIndex, QModelIndex){
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
@ -47,15 +45,9 @@ ReceiptSaveForm::ReceiptSaveForm(QSharedPointer<Voucher> voucher, QWidget *paren
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!text.isEmpty());
});
m_binder.setData(voucher.data());
AddressBookService srvAdb;
QList<ComboData> comboData;
foreach (QSharedPointer<AddressbookData> adb, srvAdb.all()) {
comboData << ComboData(adb);
}
m_voucher = voucher;
m_binder.setData(m_voucher.data());
m_binder.registerBinding(ui->contact, comboData);
m_binder.registerBinding(ui->contact, ComboData::createComboData(srvAdb.all()));
m_binder.registerBinding(ui->name);
m_binder.registerBinding(ui->description);
m_binder.bindToUi();
@ -74,11 +66,26 @@ ReceiptSaveForm::~ReceiptSaveForm()
delete ui;
}
VoucherPtr ReceiptSaveForm::selectedVoucher()
{
if (ui->tabVouchers->currentIndex().isValid())
{
return m_voucherModel->itemFromIndex(ui->tabVouchers->currentIndex());
}
return VoucherPtr();
}
bool ReceiptSaveForm::saveAsNew()
{
return m_saveAsNew;
}
void ReceiptSaveForm::on_lineEdit_textChanged(const QString &text)
{
QSortFilterProxyModel proxy;
proxy.setSourceModel(m_voucherModel);
proxy.setFilterKeyColumn(2);
proxy.setFilterKeyColumn(0);
proxy.setFilterFixedString(text);
QModelIndex matchingIndex = proxy.mapToSource(proxy.index(0,0));
@ -111,24 +118,6 @@ void ReceiptSaveForm::on_radioAdd_toggled(bool checked)
void ReceiptSaveForm::accept()
{
ShopService srv;
m_binder.bindToData();
if (m_saveAsNew)
{
m_voucher->setStatus(Voucher::NOT_PAID);
srv.updateVoucher(m_voucher);
}
else
{
QSharedPointer<Voucher> voucher = m_voucherModel->itemFromIndex(ui->tabVouchers->currentIndex());
foreach (QSharedPointer<VoucherItem> item, m_voucher->items()) {
voucher->addItem(item);
}
srv.calculate(voucher);
srv.updateVoucher(voucher);
srv.erase(m_voucher);
}
QDialog::accept();
}

@ -18,6 +18,9 @@ public:
explicit ReceiptSaveForm(QSharedPointer<Voucher> voucher, QWidget *parent = 0);
~ReceiptSaveForm();
VoucherPtr selectedVoucher();
bool saveAsNew();
private slots:
void on_lineEdit_textChanged(const QString &text);
@ -28,7 +31,7 @@ private:
ObjectBinder m_binder;
AutoTableModel<Voucher> *m_voucherModel;
bool m_saveAsNew;
QSharedPointer<Voucher> m_voucher;
VoucherPtr m_voucher;
// QDialog interface
public slots:

@ -0,0 +1,6 @@
#include "favoriteservice.h"
FavoriteService::FavoriteService()
{
}

@ -0,0 +1,13 @@
#ifndef FAVORITESERVICE_H
#define FAVORITESERVICE_H
#include <core.h>
#include "data/favorititem.h"
class FavoriteService : public Service<FavoritItem>
{
public:
FavoriteService();
};
#endif // FAVORITESERVICE_H

@ -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,9 @@
#include "ui_shopsettingsform.h"
#include <settingsservice.h>
#include <combodata.h>
#include <QFileDialog>
#include "shopservice.h"
ShopSettingsForm::ShopSettingsForm(QWidget *parent) :
FormBinder<ShopSettings>(parent),
@ -12,6 +15,19 @@ ShopSettingsForm::ShopSettingsForm(QWidget *parent) :
registerBinding(ui->output);
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>();
}
ShopSettingsForm::~ShopSettingsForm()
@ -24,6 +40,10 @@ void ShopSettingsForm::loadEntity()
SettingsService srv("SHOP");
ShopSettingsPtr settings = srv.loadSettings<ShopSettings>();
setEntity(settings);
ShopService srvShop;
m_itemModel->setData(srvShop.allSellableItems());
ui->tableItems->setModel(m_itemModel);
}
bool ShopSettingsForm::saveRecord()
@ -34,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);
}
}

@ -4,6 +4,8 @@
#include <QWidget>
#include <formbinder.h>
#include "shopsettings.h"
#include <core.h>
#include "shopitem.h"
namespace Ui {
class ShopSettingsForm;
@ -19,6 +21,7 @@ public:
private:
Ui::ShopSettingsForm *ui;
AutoTableModel<ShopItem> *m_itemModel;
// IForm interface
public:
@ -26,6 +29,8 @@ public:
public slots:
bool saveRecord();
private slots:
void on_btnCertBrowse_clicked();
};
#endif // SHOPSETTINGSFORM_H

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>608</width>
<height>450</height>
<width>645</width>
<height>463</height>
</rect>
</property>
<property name="windowTitle">
@ -15,11 +15,193 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Printer</string>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>2</number>
</property>
<layout class="QFormLayout" name="formLayout">
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Favorite buttons</string>
</attribute>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTableView" name="tableItems">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragDrop</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="3">
<widget class="QToolButton" name="toolButton_9">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QToolButton" name="toolButton_10">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="toolButton_3">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QToolButton" name="toolButton_6">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QToolButton" name="toolButton_4">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QToolButton" name="toolButton">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QToolButton" name="toolButton_8">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="toolButton_2">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QToolButton" name="toolButton_5">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QToolButton" name="toolButton_7">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="2" column="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Printer</string>
</attribute>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
@ -30,28 +212,144 @@
<item row="0" column="1">
<widget class="QLineEdit" name="output"/>
</item>
<item row="1" column="0">
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Letters per line</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="2" column="1">
<widget class="QSpinBox" name="lettersPerLine"/>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Footer text</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="3" column="1">
<widget class="QLineEdit" name="byMessage"/>
</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>
</widget>

@ -47,6 +47,11 @@ CREATE TABLE \"Voucher\" (
\"totalPriceVatSecondLower\" INTEGER NOT NULL,
\"totalPrice\" INTEGER NOT NULL,
\"status\" INTEGER NOT NULL,
\"eetStatus\" INTEGER NOT NULL,
\"eetSendDateTime\" TEXT NULL,
\"eetPkp\" TEXT,
\"eetBkp\" TEXT,
\"eetFik\" TEXT,
CONSTRAINT \"contact_fk\"
FOREIGN KEY (\"contact\")
REFERENCES \"AddressbookData\" (\"id\")
@ -57,6 +62,7 @@ CREATE TABLE \"Voucher\" (
"translations" : {
"CZ" : {
"name" : "Název",
"code" : "Kod",
"count" : "Počet",
"unitPrice" : "Jednotková cena",
"vatRate" : "Procento DPH",
@ -68,6 +74,7 @@ CREATE TABLE \"Voucher\" (
"vatRateHigh" : "Vysoká sazba",
"vatRateFirstLower" : "První snížená sazba",
"vatRateSecondLower" : "Druhá snížená sazba",
"vatAmount" : "Dan",
"priceNoVat" : "Cena zboží s nulovou DPH",
"priceVatHigh" : "Cena zboží s vysokou sazbou DPH",
"priceVatFirstLower" : "Cena zboží s první sníženou sazbou DPH",
@ -77,7 +84,9 @@ CREATE TABLE \"Voucher\" (
"totalPriceVatFirstLower" : "Celková cena zboží s první sníženou sazbou DPH",
"totalPriceVatSecondLower" : "Celková cena zboží s druhou sníženou sazbou DPH",
"totalPrice" : "Celková cena",
"status" : "Stav"
"status" : "Stav",
"numSer" : "Číslo",
"payDateTime" : "Datum"
}
}
}

@ -26,7 +26,12 @@ SOURCES += shop.cpp \
settings/shopsettings.cpp \
settings/shopsettingsform.cpp \
paydialog.cpp \
paydvouchersdialog.cpp
paydvouchersdialog.cpp \
shopitem.cpp \
isellableservice.cpp \
data/favorititem.cpp \
settings/favoriteservice.cpp \
eetbatchdialog.cpp
HEADERS += shop.h\
shop_global.h \
@ -46,7 +51,11 @@ HEADERS += shop.h\
settings/shopsettings.h \
settings/shopsettingsform.h \
paydialog.h \
paydvouchersdialog.h
paydvouchersdialog.h \
shopitem.h \
data/favorititem.h \
settings/favoriteservice.h \
eetbatchdialog.h
unix {
target.path = /usr/lib
@ -72,6 +81,7 @@ else:unix: LIBS += -L$$OUT_PWD/../plugins/ -laddressbook
INCLUDEPATH += $$PWD/../addressbook/data
INCLUDEPATH += $$PWD/../addressbook
INCLUDEPATH += $$PWD/
DEPENDPATH += $$PWD/../addressbook
DESTDIR = ../plugins
@ -80,7 +90,7 @@ OTHER_FILES += shop.json
ODB_FILES = shop/data/shop-data.h
H_DIR = $$PWD/data/*.h
ODB_OTHER_INCLUDES = -I $$PWD/../addressbook/data
ODB_OTHER_INCLUDES = -I $$PWD/../addressbook/data -I $$PWD/
include(../odb.pri)
win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../qdecimal/lib/ -lqdecimal -ldecnumber
@ -102,6 +112,12 @@ FORMS += \
receiptloadform.ui \
settings/shopsettingsform.ui \
paydialog.ui \
paydvouchersdialog.ui
paydvouchersdialog.ui \
eetbatchdialog.ui
TRANSLATIONS = translations/shop_cs_CZ.ts
unix|win32: LIBS += -L$$PWD/../../build-EetCpp-Desktop-Debug/libEet -lEetCpp
INCLUDEPATH += $$PWD/../../EetCpp/libEet
DEPENDPATH += $$PWD/../../EetCpp/libEet

@ -8,8 +8,12 @@
#include "receiptgenerator.h"
#include "paydialog.h"
#include "paydvouchersdialog.h"
#include "isellableservice.h"
#include <QList>
#include <QSharedPointer>
#include <QSortFilterProxyModel>
#include <QMessageBox>
#include "shop-odb.hxx"
ShopForm::ShopForm(QWidget *parent) :
@ -18,6 +22,7 @@ ShopForm::ShopForm(QWidget *parent) :
{
ui->setupUi(this);
m_itemsModel = NULL;
m_commodityModel = NULL;
ui->temporarySaveButton->setEnabled(false);
ui->saveButton->setEnabled(false);
@ -50,12 +55,31 @@ void ShopForm::loadLast()
connectItemSignals();
ui->total->setText(QString::number(m_voucher->totalPrice().toDouble(), 'f', 2));
if (!m_voucher->items().isEmpty())
{
ui->temporarySaveButton->setEnabled(true);
ui->saveButton->setEnabled(true);
ui->payButton->setEnabled(true);
}
}
if (m_commodityModel == NULL)
{
m_commodityModel = new AutoTableModel<ShopItem>(this);
m_commodityModel->setTranslations(Context::instance().plugin("SHOP")->translations());
ui->commodityTable->setModel(m_commodityModel);
connect(ui->commodityTable->selectionModel(), &QItemSelectionModel::currentRowChanged, [this](const QModelIndex &current, const QModelIndex &){
ui->btnAddItem->setEnabled(current.isValid());
});
}
m_commodityModel->setData(srv.allSellableItems());
ui->commodityTable->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
ui->commodityTable->setColumnHidden(3, true);
}
void ShopForm::fillRaceiptCombo()
{
bool oldState = ui->receiptCombo->blockSignals(true);
@ -84,11 +108,7 @@ void ShopForm::on_directSale_clicked()
form->setAttribute(Qt::WA_DeleteOnClose);
connect(form, &QDialog::accepted, [this, form](){
ShopService srv;
srv.addShopItem(m_voucher, form->shopItem(), ((DirectSaleItem*)form->shopItem().data())->count());
this->m_itemsModel->addRow(m_voucher->items()[m_voucher->items().count() - 1]);
connect(m_voucher->items()[m_voucher->items().count() - 1].data(), SIGNAL(countChanged()), this, SLOT(onCountChanged()));
onCountChanged();
addItem(form->shopItem(), ((DirectSaleItem*)form->shopItem().data())->count());
});
form->show();
@ -104,10 +124,25 @@ void ShopForm::on_saveButton_clicked()
ReceiptSaveForm *form = new ReceiptSaveForm(m_voucher, this);
form->setAttribute(Qt::WA_DeleteOnClose);
connect(form, &QDialog::accepted, [this]() {
connect(form, &QDialog::accepted, [this, form]() {
ShopService srv;
if (form->saveAsNew())
{
m_voucher->setStatus(Voucher::NOT_PAID);
srv.saveVoucher(m_voucher);
createEmptyVoucher();
}
else
{
VoucherPtr selVoucher = form->selectedVoucher();
srv.moveItems(m_voucher->items(), m_voucher, selVoucher);
srv.calculate(selVoucher);
srv.updateVoucher(selVoucher);
createEmptyVoucher();
}
m_itemsModel->setData(m_voucher->items());
ui->total->setText("0");
});
form->show();
@ -117,10 +152,27 @@ void ShopForm::on_loadButton_clicked()
{
ReceiptLoadForm *form = new ReceiptLoadForm(this);
form->setAttribute(Qt::WA_DeleteOnClose);
connect(form, &QDialog::accepted, [this, form](){
ShopService srv;
if (m_voucher.isNull())
{
m_voucher = srv.createVoucher();
}
srv.moveItems(form->selectedItems(), form->selectedVoucher(), this->m_voucher);
m_itemsModel->setData(m_voucher->items());
connectItemSignals();
onCountChanged();
});
form->show();
}
void ShopForm::onCountChanged()
void ShopForm::onCountChanged(int oldCount/* = 0*/)
{
VoucherItem *item = qobject_cast<VoucherItem*>(sender());
if (item != NULL && item->count() == 0)
@ -150,6 +202,12 @@ void ShopForm::onCountChanged()
{
srv.updateVoucher(m_voucher);
}
if (item != NULL)
{
int countAdded = item->count() - oldCount;
srv.updateRelatedItem(item, countAdded);
}
}
void ShopForm::createVoucher()
@ -212,7 +270,7 @@ void ShopForm::changeReceipt()
void ShopForm::connectItemSignals()
{
foreach (QSharedPointer<VoucherItem> item, m_voucher->items()) {
connect(item.data(), SIGNAL(countChanged()), this, SLOT(onCountChanged()));
connect(item.data(), SIGNAL(countChanged(int)), this, SLOT(onCountChanged(int)));
}
}
@ -226,6 +284,15 @@ void ShopForm::createEmptyVoucher()
ui->payButton->setEnabled(false);
}
void ShopForm::addItem(QSharedPointer<IShopItem> item, int count)
{
ShopService srv;
srv.addShopItem(m_voucher, item, count);
this->m_itemsModel->addRow(m_voucher->items()[m_voucher->items().count() - 1]);
connect(m_voucher->items()[m_voucher->items().count() - 1].data(), SIGNAL(countChanged(int)), this, SLOT(onCountChanged(int)));
onCountChanged();
}
void ShopForm::on_receiptCombo_currentIndexChanged(int)
{
if (!m_voucher.isNull() && m_voucher->items().isEmpty())
@ -256,6 +323,29 @@ void ShopForm::on_payButton_clicked()
connect(dialog, &QDialog::accepted, [this](){
ShopService srv;
srv.pay(m_voucher);
QString eetMsg;
if (srv.isEetEnabled())
{
bool eetRet = srv.processEet(m_voucher, eetMsg);
if (!eetRet)
{
QString errMsg = tr("EET communication error.\n");
if (!eetMsg.isEmpty())
{
errMsg += tr("Message from portal: ") + eetMsg + "\n";
}
errMsg += tr("Switch to offline?");
if (srv.isEetOnline() && QMessageBox::question(this, tr("EET error"), errMsg) == QMessageBox::Yes)
{
srv.setEetOnline(false);
}
}
}
ReceiptGenerator generator;
generator.setVoucher(m_voucher);
@ -274,3 +364,42 @@ void ShopForm::on_showPaiedButton_clicked()
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
}
void ShopForm::on_btnAddItem_clicked()
{
if (m_voucher.isNull())
{
createVoucher();
}
ShopItemPtr item = m_commodityModel->itemFromIndex(ui->commodityTable->currentIndex());
addItem(item, ui->spnCount->value());
}
void ShopForm::on_commoditySearch_textChanged(const QString &text)
{
QSortFilterProxyModel proxy;
proxy.setSourceModel(m_commodityModel);
proxy.setFilterKeyColumn(0);
proxy.setFilterFixedString(text);
auto moveToIndex = [this](const QModelIndex &matchingIndex) {
ui->commodityTable->scrollTo(matchingIndex,QAbstractItemView::EnsureVisible);
ui->commodityTable->setCurrentIndex(matchingIndex);
};
QModelIndex matchingIndex = proxy.mapToSource(proxy.index(0,0));
if(matchingIndex.isValid()) {
moveToIndex(matchingIndex);
}
else
{
proxy.setFilterKeyColumn(1);
matchingIndex = proxy.mapToSource(proxy.index(0,0));
if (matchingIndex.isValid())
{
moveToIndex(matchingIndex);
}
}
}

@ -6,6 +6,9 @@
#include "data/shop-data.h"
#include <autotablemodel.h>
class ShopItem;
class IShopItem;
namespace Ui {
class ShopForm;
}
@ -29,7 +32,7 @@ private slots:
void on_loadButton_clicked();
void onCountChanged();
void onCountChanged(int oldCount = 0);
void on_receiptCombo_currentIndexChanged(int index);
@ -37,16 +40,22 @@ private slots:
void on_showPaiedButton_clicked();
void on_btnAddItem_clicked();
void on_commoditySearch_textChanged(const QString &text);
private:
Ui::ShopForm *ui;
QSharedPointer<Voucher> m_voucher;
AutoTableModel<VoucherItem> *m_itemsModel;
AutoTableModel<ShopItem> *m_commodityModel;
void createVoucher();
void doTempSave(bool comboChanged);
void changeReceipt();
void connectItemSignals();
void createEmptyVoucher();
void addItem(QSharedPointer<IShopItem> item, int count);
};
#endif // SHOPFORM_H

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>959</width>
<height>582</height>
<height>643</height>
</rect>
</property>
<property name="windowTitle">
@ -55,7 +55,14 @@
<widget class="QLineEdit" name="commoditySearch"/>
</item>
<item>
<widget class="QTableView" name="commodityTable"/>
<widget class="QTableView" name="commodityTable">
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_8" native="true">
@ -68,7 +75,7 @@
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox">
<widget class="QSpinBox" name="spnCount">
<property name="wrapping">
<bool>false</bool>
</property>
@ -78,13 +85,23 @@
<property name="showGroupSeparator" stdset="0">
<bool>false</bool>
</property>
<property name="minimum">
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<widget class="QPushButton" name="btnAddItem">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Add Item</string>
</property>
<property name="icon">
<iconset resource="../core/rc.qrc">
<normaloff>:/icons/new.svg</normaloff>:/icons/new.svg</iconset>
</property>
</widget>
</item>
</layout>
@ -114,6 +131,11 @@
</item>
<item row="0" column="0">
<widget class="QToolButton" name="directSale">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string>Direct Sale</string>
</property>
@ -160,7 +182,82 @@
<number>0</number>
</property>
<item row="0" column="0">
<layout class="QGridLayout" name="favorites2"/>
<widget class="QToolButton" name="toolFav1">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QToolButton" name="toolFav5">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QToolButton" name="toolFav2">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="toolFav3">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QToolButton" name="toolFav4">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="5">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
@ -183,8 +280,96 @@
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="1">
<widget class="QToolButton" name="toolFav7">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QGridLayout" name="favorites3"/>
<widget class="QToolButton" name="toolFav6">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="toolFav8">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QToolButton" name="toolFav9">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QToolButton" name="toolFav10">
<property name="minimumSize">
<size>
<width>75</width>
<height>75</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="0" column="5">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
@ -386,8 +571,8 @@
</layout>
</widget>
<resources>
<include location="shoprc.qrc"/>
<include location="../core/rc.qrc"/>
<include location="shoprc.qrc"/>
</resources>
<connections/>
</ui>

@ -0,0 +1,6 @@
#include "shopitem.h"
ShopItem::ShopItem(QObject *parent) : QObject(parent)
{
}

@ -0,0 +1,37 @@
#ifndef SHOPITEM_H
#define SHOPITEM_H
#include <QObject>
#include "shop_global.h"
#include "ishopitem.h"
class SHOPSHARED_EXPORT ShopItem : public QObject, public IShopItem
{
Q_OBJECT
Q_PROPERTY(QString code READ code)
Q_PROPERTY(QString name READ name)
Q_PROPERTY(QDecDouble unitPrice READ unitPrice)
Q_PROPERTY(Enums::VatType vatType READ vatType)
public:
explicit ShopItem(QObject *parent = 0);
signals:
public slots:
// IShopItem interface
public:
virtual int id() override { return 0; }
virtual QString code() { return ""; }
virtual QString name() override { return ""; }
virtual QDecDouble unitPrice() override { return QDecDouble(); }
virtual Enums::VatType vatType() override { return Enums::NONE; }
virtual QString pluginId() override { return ""; }
};
typedef QSharedPointer<ShopItem> ShopItemPtr;
#endif // SHOPITEM_H

@ -5,5 +5,6 @@
<file>icons/tempSave.svg</file>
<file>icons/paied.svg</file>
<file>icons/pay.svg</file>
<file>icons/sendEet.svg</file>
</qresource>
</RCC>

@ -1,19 +1,25 @@
#include "shopservice.h"
#include "numberseriesservice.h"
#include "isellableservice.h"
#include "shop-odb.hxx"
#include "settings/shopsettings.h"
#include <eetcpp.h>
#include <QEventLoop>
ShopService::ShopService()
{
}
QSharedPointer<Voucher> ShopService::createVoucher()
VoucherPtr ShopService::createVoucher()
{
QSharedPointer<Voucher> voucher(new Voucher);
voucher->setStatus(Voucher::NEW);
return voucher;
}
void ShopService::addShopItem(QSharedPointer<Voucher> voucher, QSharedPointer<IShopItem> item, int count)
void ShopService::addShopItem(VoucherPtr voucher, QSharedPointer<IShopItem> item, int count)
{
QSharedPointer<VoucherItem> vItem(new VoucherItem);
vItem->setName(item->name());
@ -24,9 +30,11 @@ void ShopService::addShopItem(QSharedPointer<Voucher> voucher, QSharedPointer<IS
vItem->setVatType(item->vatType());
voucher->addItem(vItem);
updateRelatedItem(vItem.data(), count);
}
void ShopService::calculate(QSharedPointer<Voucher> voucher)
void ShopService::calculate(VoucherPtr voucher)
{
QDecDouble total;
@ -65,7 +73,7 @@ void ShopService::calculate(QSharedPointer<Voucher> voucher)
voucher->setTotalPrice(total);
}
void ShopService::calculateItem(QSharedPointer<VoucherItem> item)
void ShopService::calculateItem(VoucherItemPtr item)
{
loadSettings();
if (m_gs->vatPayer())
@ -81,13 +89,13 @@ void ShopService::calculateItem(QSharedPointer<VoucherItem> item)
}
}
void ShopService::loadItems(QSharedPointer<Voucher> voucher)
void ShopService::loadItems(VoucherPtr voucher)
{
Service<VoucherItem> srv;
voucher->setItems(srv.all(QString("voucher = %1").arg(voucher->id())));
}
void ShopService::pay(QSharedPointer<Voucher> voucher)
void ShopService::pay(VoucherPtr voucher)
{
Transaction tx;
NumberSeriesService srvNs;
@ -98,6 +106,7 @@ void ShopService::pay(QSharedPointer<Voucher> voucher)
voucher->setNumSer(numSerStr);
voucher->setStatus(Voucher::PAID);
voucher->setEetStatus(Voucher::EET_FOR_SEND);
voucher->setPayDateTime(QDateTime::currentDateTime());
this->update(voucher);
@ -105,21 +114,180 @@ void ShopService::pay(QSharedPointer<Voucher> voucher)
tx.commit();
}
QList<QSharedPointer<Voucher> > ShopService::savedVouchers()
void ShopService::updateRelatedItem(VoucherItem* item, int countAdded)
{
IPlugin *plugin = Context::instance().plugin(item->itemPlugin());
IService *srv = (plugin != NULL ? plugin->service<IService>() : NULL);
ISellableService *selSrv = dynamic_cast<ISellableService*>(srv);
if (selSrv != NULL)
{
selSrv->addedToVoucher(item->refId(), countAdded);
}
}
bool ShopService::processEet(VoucherPtr voucher, QString &message)
{
if (voucher->eetStatus() == Voucher::EET_NOT_ENTERING)
{
return true;
}
SettingsService srvSettings("SHOP");
ShopSettingsPtr settings = srvSettings.loadSettings<ShopSettings>();
loadSettings();
EetRequest request;
request.setCelkTrzba(voucher->totalPrice().toDouble());
request.setDatTrzby(voucher->payDateTime());
request.setIdPokl(settings->eetRegisterId());
request.setIdProvoz(settings->eetShopId());
request.setPrvniZaslani(voucher->eetStatus() == Voucher::EET_FOR_SEND);
request.setDicPopl(m_gs->dic());
request.setPoradCis(voucher->numSer());
request.setDatOdesl(QDateTime::currentDateTime());
request.setRezim((EetRequest::EetRezim)settings->eetMode());
EetSender *sender = new EetSender(this);
sender->setupSigner(settings->eetCertificate(), settings->eetKeyPassword());
sender->setPlayground(settings->eetPlayground());
QEventLoop loop;
bool replyFinished = false;
connect(sender, &EetSender::sendFinished, [this, voucher, sender, &loop, &replyFinished](){
Transaction tx;
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);
}
else
{
voucher->setEetStatus(Voucher::EET_ERROR);
}
this->update(voucher);
tx.commit();
sender->deleteLater();
loop.quit();
replyFinished = true;
});
sender->sendRequest(&request);
if (!replyFinished)
{
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;
}
bool ShopService::isEetOnline()
{
return EetSender::m_online;
}
bool ShopService::isEetEnabled()
{
SettingsService srvSettings("SHOP");
ShopSettingsPtr settings = srvSettings.loadSettings<ShopSettings>();
return settings->eetActive();
}
void ShopService::moveItems(QList<VoucherItemPtr> items, VoucherPtr source, VoucherPtr target)
{
Transaction tx;
if (target->status() == Voucher::NEW && target->id() == 0)
{
this->saveVoucher(target);
}
odb::database *db = Context::instance().db();
foreach (VoucherItemPtr item, items) {
QString sql = QString("update VoucherItem set voucher = %1 where id = %2").arg(QString::number(target->id()), QString::number(item->id()));
db->execute(sql.toStdString());
}
loadItems(source);
loadItems(target);
if (source->items().isEmpty())
{
erase(source);
}
tx.commit();
}
QList<VoucherPtr> ShopService::savedVouchers()
{
return all(QString("status = %1").arg(QString::number(Voucher::NOT_PAID)));
}
QList<QSharedPointer<Voucher> > ShopService::tempVouchers()
QList<VoucherPtr> ShopService::tempVouchers()
{
return all(QString("status = %1").arg(QString::number(Voucher::TEMPORARY)));
}
QList<QSharedPointer<Voucher> > ShopService::paiedVouchers()
QList<VoucherPtr> ShopService::paiedVouchers()
{
return all(QString("status = %1").arg(QString::number(Voucher::PAID)));
}
QList<VoucherPtr> ShopService::vouchersForEet()
{
return all(QString("status = %1 AND eetStatus <> %2 AND eetStatus <> %3")
.arg(QString::number(Voucher::PAID), QString::number(Voucher::EET_SENT), QString::number(Voucher::EET_NOT_ENTERING)));
}
QList<ShopItemPtr> ShopService::allSellableItems()
{
QList<QSharedPointer<ShopItem> > items;
foreach (IPlugin *plugin, Context::instance().plugins()) {
IService *srv = plugin->service<IService>();
ISellableService *selSrv = dynamic_cast<ISellableService*>(srv);
if (selSrv != NULL)
{
items.append(selSrv->shopItems());
}
}
return items;
}
QDecDouble ShopService::includeVat(QDecDouble price, Enums::VatType vatType)
{
return price * ((vatRate(vatType) / 100) + QDecDouble(1));
@ -159,7 +327,7 @@ QDecDouble ShopService::vatRate(Enums::VatType vatType)
return vatRate;
}
void ShopService::saveVoucher(QSharedPointer<Voucher> entity)
void ShopService::saveVoucher(VoucherPtr entity)
{
Transaction tr;
odb::database *db = Context::instance().db();
@ -174,7 +342,7 @@ void ShopService::saveVoucher(QSharedPointer<Voucher> entity)
tr.commit();
}
void ShopService::updateVoucher(QSharedPointer<Voucher> entity)
void ShopService::updateVoucher(VoucherPtr entity)
{
Transaction tr;
odb::database *db = Context::instance().db();

@ -7,21 +7,29 @@
#include <settings/globalsettings.h>
#include "data/shop-data.h"
#include "ishopitem.h"
#include "shopitem.h"
class ShopService : public Service<Voucher>
{
public:
ShopService();
QSharedPointer<Voucher> createVoucher();
void addShopItem(QSharedPointer<Voucher> voucher, QSharedPointer<IShopItem> item, int count);
void calculate(QSharedPointer<Voucher> voucher);
void calculateItem(QSharedPointer<VoucherItem> item);
void loadItems(QSharedPointer<Voucher> voucher);
void pay(QSharedPointer<Voucher> voucher);
QList<QSharedPointer<Voucher> > savedVouchers();
QList<QSharedPointer<Voucher> > tempVouchers();
QList<QSharedPointer<Voucher> > paiedVouchers();
VoucherPtr createVoucher();
void addShopItem(VoucherPtr voucher, QSharedPointer<IShopItem> item, int count);
void calculate(VoucherPtr voucher);
void calculateItem(VoucherItemPtr item);
void loadItems(VoucherPtr voucher);
void pay(VoucherPtr voucher);
void moveItems(QList<VoucherItemPtr> items, VoucherPtr source, VoucherPtr target);
void updateRelatedItem(VoucherItem* item, int countAdded);
bool processEet(VoucherPtr voucher, QString &message);
void setEetOnline(bool online);
bool isEetOnline();
bool isEetEnabled();
QList<VoucherPtr> savedVouchers();
QList<VoucherPtr> tempVouchers();
QList<VoucherPtr> paiedVouchers();
QList<VoucherPtr> vouchersForEet();
QList<ShopItemPtr> allSellableItems();
private:
QDecDouble includeVat(QDecDouble price, Enums::VatType vatType);
@ -31,8 +39,8 @@ private:
QDecDouble vatRate(Enums::VatType vatType);
public:
void saveVoucher(QSharedPointer<Voucher> entity);
void updateVoucher(QSharedPointer<Voucher> entity);
void saveVoucher(VoucherPtr entity);
void updateVoucher(VoucherPtr entity);
};
#endif // SHOPSERVICE_H

@ -0,0 +1,319 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="cs_CZ">
<context>
<name>DirectSaleForm</name>
<message>
<location filename="../directsaleform.ui" line="14"/>
<source>Form</source>
<translation>Zboží</translation>
</message>
<message>
<location filename="../directsaleform.ui" line="20"/>
<source>Commodity Name</source>
<translation>Název</translation>
</message>
<message>
<location filename="../directsaleform.ui" line="30"/>
<source>Price</source>
<translation>Cena</translation>
</message>
<message>
<location filename="../directsaleform.ui" line="44"/>
<source>Count</source>
<translation>Počet</translation>
</message>
<message>
<location filename="../directsaleform.ui" line="58"/>
<source>VAT rate</source>
<translation>Sazba DPH</translation>
</message>
<message>
<location filename="../directsaleform.cpp" line="17"/>
<source>None</source>
<translation>Žádná</translation>
</message>
<message>
<location filename="../directsaleform.cpp" line="18"/>
<source>High</source>
<translation>Vysoká</translation>
</message>
<message>
<location filename="../directsaleform.cpp" line="19"/>
<source>First Lower</source>
<translation>První snížená</translation>
</message>
<message>
<location filename="../directsaleform.cpp" line="20"/>
<source>Second Lower</source>
<translation>Druhá snížená</translation>
</message>
</context>
<context>
<name>PayDialog</name>
<message>
<location filename="../paydialog.ui" line="14"/>
<source>Recieve money</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../paydialog.ui" line="30"/>
<source>Total:</source>
<translation type="unfinished">Celkem:</translation>
</message>
<message>
<location filename="../paydialog.ui" line="44"/>
<location filename="../paydialog.ui" line="101"/>
<source>0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../paydialog.ui" line="59"/>
<source>Recieved</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../paydialog.ui" line="89"/>
<source>Return</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PaydVouchersDialog</name>
<message>
<location filename="../paydvouchersdialog.ui" line="14"/>
<source>Paied vouchers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../paydvouchersdialog.ui" line="29"/>
<source>Print receipt</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../paydvouchersdialog.ui" line="55"/>
<location filename="../paydvouchersdialog.cpp" line="51"/>
<source>Save receipt</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../paydvouchersdialog.ui" line="58"/>
<source>...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../paydvouchersdialog.ui" line="104"/>
<source>Items</source>
<translation type="unfinished">Položky</translation>
</message>
<message>
<location filename="../paydvouchersdialog.ui" line="137"/>
<source>Total:</source>
<translation type="unfinished">Celkem:</translation>
</message>
<message>
<location filename="../paydvouchersdialog.ui" line="157"/>
<source>0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../paydvouchersdialog.cpp" line="51"/>
<source>Text files (*.txt)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ReceiptLoadForm</name>
<message>
<location filename="../receiptloadform.ui" line="14"/>
<source>Dialog</source>
<translation></translation>
</message>
<message>
<location filename="../receiptloadform.ui" line="20"/>
<source>Receipts</source>
<translation>Účtenky</translation>
</message>
<message>
<location filename="../receiptloadform.ui" line="29"/>
<source>Search</source>
<translation>Hledat</translation>
</message>
<message>
<location filename="../receiptloadform.ui" line="42"/>
<source>Items</source>
<translation>Položky</translation>
</message>
</context>
<context>
<name>ReceiptSaveForm</name>
<message>
<location filename="../receiptsaveform.ui" line="33"/>
<source>Existing Receipts</source>
<translation>Přidat k již uložené</translation>
</message>
<message>
<location filename="../receiptsaveform.ui" line="39"/>
<source>Search</source>
<translation>Hledat</translation>
</message>
<message>
<source>GroupBox</source>
<translation type="vanished">Uložit novou</translation>
</message>
<message>
<location filename="../receiptsaveform.ui" line="14"/>
<source>Save receipt</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../receiptsaveform.ui" line="23"/>
<source>Add to existing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../receiptsaveform.ui" line="62"/>
<source>Save as new</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../receiptsaveform.ui" line="69"/>
<source>New receipt</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../receiptsaveform.ui" line="78"/>
<source>Name</source>
<translation>Název</translation>
</message>
<message>
<location filename="../receiptsaveform.ui" line="88"/>
<source>Description</source>
<translation>Popis</translation>
</message>
<message>
<location filename="../receiptsaveform.ui" line="98"/>
<source>Search Contacts</source>
<translation>Vyhledat kontakt</translation>
</message>
</context>
<context>
<name>ShopForm</name>
<message>
<location filename="../shopform.ui" line="14"/>
<source>Form</source>
<translation></translation>
</message>
<message>
<location filename="../shopform.ui" line="50"/>
<source>Commodity</source>
<translation>Zboží</translation>
</message>
<message>
<location filename="../shopform.ui" line="73"/>
<source>Count</source>
<translation>Počet</translation>
</message>
<message>
<location filename="../shopform.ui" line="99"/>
<source>Add Item</source>
<translation>Přidat položku</translation>
</message>
<message>
<location filename="../shopform.ui" line="135"/>
<source>Direct Sale</source>
<translation>Přímý prodej</translation>
</message>
<message>
<location filename="../shopform.ui" line="148"/>
<source>Ctrl+D</source>
<translation></translation>
</message>
<message>
<location filename="../shopform.ui" line="221"/>
<source>Receipt</source>
<translation>Účtenka</translation>
</message>
<message>
<location filename="../shopform.ui" line="257"/>
<source>Total:</source>
<translation>Celkem:</translation>
</message>
<message>
<location filename="../shopform.ui" line="274"/>
<source>0</source>
<translation></translation>
</message>
<message>
<location filename="../shopform.ui" line="295"/>
<source>Temporary Save</source>
<translation>Dočasné uložení</translation>
</message>
<message>
<location filename="../shopform.ui" line="317"/>
<source>Save</source>
<translation>Uložení</translation>
</message>
<message>
<location filename="../shopform.ui" line="339"/>
<source>Load</source>
<translation>Načíst</translation>
</message>
<message>
<location filename="../shopform.ui" line="361"/>
<source>Show paied</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../shopform.ui" line="383"/>
<source>Pay</source>
<translation>Zaplatit</translation>
</message>
<message>
<location filename="../shopform.cpp" line="84"/>
<source>&lt;&lt; empty &gt;&gt;</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ShopSettingsForm</name>
<message>
<location filename="../settings/shopsettingsform.ui" line="14"/>
<source>Form</source>
<translation type="unfinished">Zboží</translation>
</message>
<message>
<location filename="../settings/shopsettingsform.ui" line="20"/>
<source>Printer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settings/shopsettingsform.ui" line="26"/>
<source>Output device</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settings/shopsettingsform.ui" line="36"/>
<source>Letters per line</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../settings/shopsettingsform.ui" line="46"/>
<source>Footer text</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TemporaryReceiptSaveForm</name>
<message>
<location filename="../temporaryreceiptsaveform.ui" line="14"/>
<source>Dialog</source>
<translation>Dočasné uložení</translation>
</message>
<message>
<location filename="../temporaryreceiptsaveform.ui" line="20"/>
<source>Temporary Receipt Name</source>
<translation>Název dočasně uložené účtenky</translation>
</message>
</context>
</TS>
Loading…
Cancel
Save