Compare commits
5
Commits
285fc8e80f
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a4c517a75 | ||
|
|
a0a745df0c | ||
|
|
e3a5e44c33 | ||
|
|
12dd6ddba0 | ||
|
|
de2bab90de |
@@ -1,2 +1,3 @@
|
||||
cmake*
|
||||
!CMakePresets.json
|
||||
build
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
url = https://github.com/semihc/qdecimal.git
|
||||
[submodule "3rdparty/QxOrm"]
|
||||
path = 3rdparty/QxOrm
|
||||
url = https://github.com/PepaRokos/QxOrm.git
|
||||
url = https://github.com/QxOrm/QxOrm.git
|
||||
[submodule "3rdparty/LimeReport"]
|
||||
path = 3rdparty/LimeReport
|
||||
url = https://github.com/PepaRokos/LimeReport.git
|
||||
|
||||
Vendored
+1
-1
Submodule 3rdparty/QxOrm updated: 975c3b5ad3...44fd7f1617
@@ -1,6 +1,13 @@
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
project(prodejna-root)
|
||||
|
||||
include(CTest)
|
||||
option(ENABLE_ZINT "Enable LimeReport barcode support" ON)
|
||||
|
||||
find_package(Qt6 6.11.2 REQUIRED COMPONENTS Core Core5Compat Test Gui Widgets PrintSupport Sql Qml Network Xml Svg)
|
||||
|
||||
set(CMAKE_POLICY_VERSION_MINIMUM 3.10)
|
||||
|
||||
add_subdirectory(3rdparty/qdecimal)
|
||||
add_subdirectory(3rdparty/QxOrm)
|
||||
add_subdirectory(3rdparty/LimeReport)
|
||||
@@ -15,3 +22,7 @@ add_subdirectory(shop)
|
||||
add_subdirectory(commodity)
|
||||
add_subdirectory(camp)
|
||||
|
||||
if(BUILD_TESTING)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"version": 5,
|
||||
"cmakeMinimumRequired": {
|
||||
"major": 3,
|
||||
"minor": 24,
|
||||
"patch": 0
|
||||
},
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "qt6-debug",
|
||||
"displayName": "Qt 6.11.2+ Debug",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build/presets/${presetName}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
}
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
{
|
||||
"name": "qt6-debug",
|
||||
"configurePreset": "qt6-debug"
|
||||
}
|
||||
],
|
||||
"testPresets": [
|
||||
{
|
||||
"name": "qt6-debug",
|
||||
"configurePreset": "qt6-debug",
|
||||
"output": {
|
||||
"outputOnFailure": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -84,7 +84,7 @@ QDecDouble CommodityData::price() const
|
||||
|
||||
void CommodityData::setPrice(const QDecDouble &price)
|
||||
{
|
||||
m_price = price.toDouble() * DEC_MULTIPLE;
|
||||
m_price = qRound(price.toDouble() * DEC_MULTIPLE);
|
||||
}
|
||||
Enums::VatType CommodityData::vat() const
|
||||
{
|
||||
|
||||
@@ -95,6 +95,10 @@ void Role::clearPermissions()
|
||||
m_listPermissions.clear();
|
||||
}
|
||||
|
||||
QStringList Role::eagerLoad() {
|
||||
return {"object_id_fk", "value_fk"};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ public:
|
||||
void addPermission(QSharedPointer<Permission> perm);
|
||||
void clearPermissions();
|
||||
|
||||
Q_INVOKABLE QStringList eagerLoad();
|
||||
|
||||
private:
|
||||
long m_id;
|
||||
QString m_name;
|
||||
|
||||
@@ -112,6 +112,10 @@ void User::setIsAdmin(bool isAdmin)
|
||||
m_isAdmin = isAdmin;
|
||||
}
|
||||
|
||||
QStringList User::eagerLoad() {
|
||||
return {"object_id_fk"};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ public:
|
||||
|
||||
void clearRoles();
|
||||
|
||||
Q_INVOKABLE QStringList eagerLoad();
|
||||
|
||||
private:
|
||||
long m_id;
|
||||
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
#ifndef DEFINE_H
|
||||
#define DEFINE_H
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
#define ALL(arr) arr.begin(), arr.end()
|
||||
|
||||
// default rights
|
||||
@@ -11,7 +13,7 @@
|
||||
|
||||
#define DEC_MULTIPLE 100
|
||||
#define TO_DEC(num) (QDecDouble(num) / QDecDouble(DEC_MULTIPLE))
|
||||
#define FROM_DEC(num) (num * QDecDouble(DEC_MULTIPLE)).toDouble()
|
||||
#define FROM_DEC(num) qRound((num * QDecDouble(DEC_MULTIPLE)).toDouble())
|
||||
|
||||
#ifndef PLUGIN_ROOT
|
||||
#ifdef _WIN32
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ protected:
|
||||
m_translator = new QTranslator();
|
||||
|
||||
if (!m_translator->load(fileName + QLocale::system().name())) {
|
||||
qDebug() << "Cannot load translation";
|
||||
qDebug() << "Cannot load translation " << QLocale::system().name();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "permissionservice.h"
|
||||
#include "service.h"
|
||||
#include <QCryptographicHash>
|
||||
|
||||
QList<QSharedPointer<Permission> > PermissionService::forPlugin(const QString &pluginId)
|
||||
@@ -54,6 +55,10 @@ QSharedPointer<User> PermissionService::loadUser(const QString &login)
|
||||
auto admin = srvUser.all("login = '" + login + "'");
|
||||
|
||||
if (admin.count() == 1) {
|
||||
Service<Role> srvRole;
|
||||
for (auto& role : admin[0]->listRoles()) {
|
||||
srvRole.load(role);
|
||||
}
|
||||
return admin[0];
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -156,7 +156,7 @@ public:
|
||||
pSession = ptrSession.data();
|
||||
}
|
||||
|
||||
*pSession += qx::dao::delete_by_id(entity);
|
||||
*pSession += qx::dao::delete_by_id(entity, pSession->database());
|
||||
|
||||
if (!pSession->isValid()) {
|
||||
qDebug() << pSession->firstError().text();
|
||||
@@ -237,7 +237,10 @@ protected:
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Context::instance().currentUser().isNull()) {
|
||||
obj->setProperty("updatedBy", Context::instance().currentUser()->login());
|
||||
}
|
||||
|
||||
obj->setProperty("updated", QDateTime::currentDateTime());
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -129,83 +129,83 @@
|
||||
<translation>Hlavní nastavení</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="104"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="107"/>
|
||||
<source>Web</source>
|
||||
<translation>Web</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="111"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="114"/>
|
||||
<source>E-mail</source>
|
||||
<translation>E-mail</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="118"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="121"/>
|
||||
<source>Phone</source>
|
||||
<translation>Telefon</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="166"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="169"/>
|
||||
<source>Company info</source>
|
||||
<translation>Informace o společnosti</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="175"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="178"/>
|
||||
<source>IC</source>
|
||||
<translation>IČO</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="185"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="188"/>
|
||||
<source>VAT number</source>
|
||||
<translation>DIČ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="195"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="198"/>
|
||||
<source>VAT payer</source>
|
||||
<translation>Plátce DPH</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="208"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="211"/>
|
||||
<source>VAT rates</source>
|
||||
<translation>Sazby DPH</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="214"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="217"/>
|
||||
<source>High</source>
|
||||
<translation>Vysoká</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="228"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="231"/>
|
||||
<source>First lower</source>
|
||||
<translation>První snížená</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="242"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="245"/>
|
||||
<source>Second lower</source>
|
||||
<translation>Druhá snížená</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="259"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="262"/>
|
||||
<source>Prices with VAT</source>
|
||||
<translation>Ceny s DPH</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="270"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="331"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="273"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="334"/>
|
||||
<source>Number series</source>
|
||||
<translation>Číselné řady</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="299"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="302"/>
|
||||
<source>Edit name</source>
|
||||
<translation>Upravit název</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="310"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="313"/>
|
||||
<source>Season</source>
|
||||
<translation>Sezóna</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="317"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="320"/>
|
||||
<source>Create new</source>
|
||||
<translation>Vytvořit novou</translation>
|
||||
</message>
|
||||
@@ -215,67 +215,75 @@
|
||||
<translation>Kontaktní údaje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="45"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="48"/>
|
||||
<source>Firm Name</source>
|
||||
<translation>Název společnosti</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="55"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="58"/>
|
||||
<source>Street</source>
|
||||
<translation>Ulice</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="65"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="68"/>
|
||||
<source>House Number</source>
|
||||
<translation>Číslo popisné</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="75"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="78"/>
|
||||
<source>City</source>
|
||||
<translation>Město</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="85"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="88"/>
|
||||
<source>ZIP code</source>
|
||||
<translation>PSČ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="128"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="131"/>
|
||||
<source>Logo</source>
|
||||
<translation>Logo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.ui" line="156"/>
|
||||
<location filename="../settings/globalsettingsform.ui" line="159"/>
|
||||
<source>Select file</source>
|
||||
<translation>Vyber soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.cpp" line="82"/>
|
||||
<location filename="../settings/globalsettingsform.cpp" line="95"/>
|
||||
<source>Switch season</source>
|
||||
<translation>Změna sezóny</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.cpp" line="82"/>
|
||||
<source>Realy switch active season?</source>
|
||||
<translation>Opravdu si přejete změnit aktivní sezónu?</translation>
|
||||
<translation type="vanished">Opravdu si přejete změnit aktivní sezónu?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.cpp" line="150"/>
|
||||
<location filename="../settings/globalsettingsform.cpp" line="155"/>
|
||||
<source>New season</source>
|
||||
<translation>Nová sezóna</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.cpp" line="150"/>
|
||||
<source>Realy create new season and switch to it?</source>
|
||||
<translation type="vanished">Opravdu si přejete vytvořit novou sezónu a přepnout na ni?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.cpp" line="95"/>
|
||||
<source>Really switch active season?</source>
|
||||
<translation>Opravdu si přejete změnit aktivní sezónu?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.cpp" line="155"/>
|
||||
<source>Really create new season and switch to it?</source>
|
||||
<translation>Opravdu si přejete vytvořit novou sezónu a přepnout na ni?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.cpp" line="173"/>
|
||||
<location filename="../settings/globalsettingsform.cpp" line="178"/>
|
||||
<source>Select logo</source>
|
||||
<translation>Vybrat logo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/globalsettingsform.cpp" line="173"/>
|
||||
<location filename="../settings/globalsettingsform.cpp" line="178"/>
|
||||
<source>Images (*.png *.xpm *.jpg)</source>
|
||||
<translation>Obrázky (*.png *.xpm *.jpg)</translation>
|
||||
</message>
|
||||
@@ -359,17 +367,17 @@
|
||||
<translation>Import dat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../importdialog.ui" line="20"/>
|
||||
<location filename="../importdialog.ui" line="23"/>
|
||||
<source>File</source>
|
||||
<translation>Soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../importdialog.ui" line="27"/>
|
||||
<location filename="../importdialog.ui" line="30"/>
|
||||
<source>Separator</source>
|
||||
<translation>Oddělovač</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../importdialog.ui" line="65"/>
|
||||
<location filename="../importdialog.ui" line="68"/>
|
||||
<source>...</source>
|
||||
<translation>...</translation>
|
||||
</message>
|
||||
@@ -400,12 +408,12 @@
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../iplugin.h" line="58"/>
|
||||
<location filename="../iplugin.h" line="52"/>
|
||||
<source>Permission denied</source>
|
||||
<translation>Nedostatečná oprávnění</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../iplugin.h" line="58"/>
|
||||
<location filename="../iplugin.h" line="52"/>
|
||||
<source>You don't have permission to open this plugin.</source>
|
||||
<translation>Nemáte oprávnění otevřít tento modul.</translation>
|
||||
</message>
|
||||
@@ -590,39 +598,39 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../autoform.h" line="46"/>
|
||||
<location filename="../gridform.h" line="250"/>
|
||||
<location filename="../gridform.h" line="262"/>
|
||||
<location filename="../gridform.h" line="274"/>
|
||||
<location filename="../gridform.h" line="252"/>
|
||||
<location filename="../gridform.h" line="264"/>
|
||||
<location filename="../gridform.h" line="276"/>
|
||||
<source>Permission denied</source>
|
||||
<translation>Nedostatečná oprávnění</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gridform.h" line="250"/>
|
||||
<location filename="../gridform.h" line="252"/>
|
||||
<source>You don't have permission to add new record.</source>
|
||||
<translation>Nemáte oprávnění přidat nový záznam.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gridform.h" line="262"/>
|
||||
<location filename="../gridform.h" line="264"/>
|
||||
<source>You don't have permission to edit record.</source>
|
||||
<translation>Nemáte oprávnění upravit záznam.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gridform.h" line="274"/>
|
||||
<location filename="../gridform.h" line="276"/>
|
||||
<source>You don't have permission to delete record.</source>
|
||||
<translation>Nemáte oprávnění smazat záznam.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gridform.h" line="231"/>
|
||||
<location filename="../gridform.h" line="233"/>
|
||||
<source>Delete record</source>
|
||||
<translation>Smazat záznam</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gridform.h" line="231"/>
|
||||
<location filename="../gridform.h" line="233"/>
|
||||
<source>Realy delete this record?</source>
|
||||
<translation>Opravdu si přejete smazat tento záznam?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../gridform.h" line="327"/>
|
||||
<location filename="../gridform.h" line="329"/>
|
||||
<source>Import</source>
|
||||
<translation>Import</translation>
|
||||
</message>
|
||||
@@ -635,37 +643,37 @@
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../users/userform.ui" line="20"/>
|
||||
<location filename="../users/userform.ui" line="23"/>
|
||||
<source>Login</source>
|
||||
<translation>Uživatelské jméno</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../users/userform.ui" line="30"/>
|
||||
<location filename="../users/userform.ui" line="33"/>
|
||||
<source>Password</source>
|
||||
<translation>Heslo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../users/userform.ui" line="44"/>
|
||||
<location filename="../users/userform.ui" line="47"/>
|
||||
<source>Name</source>
|
||||
<translation>Jméno</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../users/userform.ui" line="57"/>
|
||||
<location filename="../users/userform.ui" line="60"/>
|
||||
<source>Is Admin</source>
|
||||
<translation>Admin</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../users/userform.ui" line="67"/>
|
||||
<location filename="../users/userform.ui" line="70"/>
|
||||
<source>Active</source>
|
||||
<translation>Aktivní</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../users/userform.ui" line="77"/>
|
||||
<location filename="../users/userform.ui" line="80"/>
|
||||
<source>Roles</source>
|
||||
<translation>Role</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../users/userform.ui" line="91"/>
|
||||
<location filename="../users/userform.ui" line="94"/>
|
||||
<source>Retype Password</source>
|
||||
<translation>Zopakujte heslo</translation>
|
||||
</message>
|
||||
|
||||
@@ -39,7 +39,7 @@ QDecDouble AccService::price() const
|
||||
|
||||
void AccService::setPrice(QDecDouble price)
|
||||
{
|
||||
m_price = price.toDouble() * DEC_MULTIPLE;
|
||||
m_price = qRound(price.toDouble() * DEC_MULTIPLE);
|
||||
}
|
||||
bool AccService::active() const
|
||||
{
|
||||
|
||||
@@ -60,10 +60,6 @@ void ShopService::calculate(VoucherPtr voucher)
|
||||
|
||||
loadSettings();
|
||||
|
||||
if (voucher->items().isEmpty()) {
|
||||
load(voucher);
|
||||
}
|
||||
|
||||
foreach (QSharedPointer<VoucherItem> item, voucher->items()) {
|
||||
|
||||
if (item->refId() == ROUNDING_ITEM)
|
||||
@@ -384,6 +380,9 @@ void ShopService::moveItems(QList<VoucherItemPtr> items, VoucherPtr source, Vouc
|
||||
it->setVoucher(target);
|
||||
}
|
||||
|
||||
calculate(target);
|
||||
update(target, &session);
|
||||
|
||||
if (source->items().isEmpty())
|
||||
{
|
||||
erase(source, &session);
|
||||
|
||||
Binary file not shown.
+179
-95
@@ -29,22 +29,22 @@
|
||||
<translation>Sazba DPH</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../directsaleform.cpp" line="17"/>
|
||||
<location filename="../directsaleform.cpp" line="18"/>
|
||||
<source>None</source>
|
||||
<translation>Žádná</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../directsaleform.cpp" line="18"/>
|
||||
<location filename="../directsaleform.cpp" line="19"/>
|
||||
<source>High</source>
|
||||
<translation>Vysoká</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../directsaleform.cpp" line="19"/>
|
||||
<location filename="../directsaleform.cpp" line="20"/>
|
||||
<source>First Lower</source>
|
||||
<translation>První snížená</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../directsaleform.cpp" line="20"/>
|
||||
<location filename="../directsaleform.cpp" line="21"/>
|
||||
<source>Second Lower</source>
|
||||
<translation>Druhá snížená</translation>
|
||||
</message>
|
||||
@@ -60,36 +60,41 @@
|
||||
<context>
|
||||
<name>PayDialog</name>
|
||||
<message>
|
||||
<location filename="../paydialog.ui" line="14"/>
|
||||
<location filename="../paydialog.ui" line="20"/>
|
||||
<source>Recieve money</source>
|
||||
<translation>Platba</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydialog.ui" line="30"/>
|
||||
<location filename="../paydialog.ui" line="36"/>
|
||||
<source>Total:</source>
|
||||
<translation>Celkem:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydialog.ui" line="44"/>
|
||||
<location filename="../paydialog.ui" line="101"/>
|
||||
<location filename="../paydialog.ui" line="50"/>
|
||||
<location filename="../paydialog.ui" line="107"/>
|
||||
<source>0</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydialog.ui" line="59"/>
|
||||
<location filename="../paydialog.ui" line="65"/>
|
||||
<source>Recieved</source>
|
||||
<translation>Obdrženo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydialog.ui" line="89"/>
|
||||
<location filename="../paydialog.ui" line="95"/>
|
||||
<source>Return</source>
|
||||
<translation>Vrátit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydialog.ui" line="124"/>
|
||||
<location filename="../paydialog.ui" line="117"/>
|
||||
<source>Send to EET portal</source>
|
||||
<translation>Odeslat na EET</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydialog.ui" line="142"/>
|
||||
<source>OK</source>
|
||||
<translation>OK</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>PaydVouchersDialog</name>
|
||||
@@ -104,65 +109,66 @@
|
||||
<translation>Vytisknout účtenku</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydvouchersdialog.ui" line="55"/>
|
||||
<location filename="../paydvouchersdialog.cpp" line="99"/>
|
||||
<location filename="../paydvouchersdialog.ui" line="75"/>
|
||||
<location filename="../paydvouchersdialog.cpp" line="110"/>
|
||||
<source>Save receipt</source>
|
||||
<translation>Uložit účtenku</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydvouchersdialog.ui" line="58"/>
|
||||
<location filename="../paydvouchersdialog.ui" line="52"/>
|
||||
<location filename="../paydvouchersdialog.ui" line="78"/>
|
||||
<location filename="../paydvouchersdialog.ui" line="101"/>
|
||||
<location filename="../paydvouchersdialog.ui" line="98"/>
|
||||
<location filename="../paydvouchersdialog.ui" line="121"/>
|
||||
<source>...</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydvouchersdialog.ui" line="153"/>
|
||||
<location filename="../paydvouchersdialog.ui" line="173"/>
|
||||
<source>Items</source>
|
||||
<translation>Položky</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydvouchersdialog.ui" line="168"/>
|
||||
<location filename="../paydvouchersdialog.ui" line="188"/>
|
||||
<source>EET:</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydvouchersdialog.ui" line="219"/>
|
||||
<location filename="../paydvouchersdialog.ui" line="239"/>
|
||||
<source>Total:</source>
|
||||
<translation>Celkem:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydvouchersdialog.ui" line="239"/>
|
||||
<location filename="../paydvouchersdialog.ui" line="259"/>
|
||||
<source>0</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydvouchersdialog.cpp" line="63"/>
|
||||
<location filename="../paydvouchersdialog.cpp" line="74"/>
|
||||
<source>not entering</source>
|
||||
<translation>Nevstupuje</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydvouchersdialog.cpp" line="66"/>
|
||||
<location filename="../paydvouchersdialog.cpp" line="77"/>
|
||||
<source>for send</source>
|
||||
<translation>K odeslání</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydvouchersdialog.cpp" line="69"/>
|
||||
<location filename="../paydvouchersdialog.cpp" line="80"/>
|
||||
<source>error</source>
|
||||
<translation>Chyba</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydvouchersdialog.cpp" line="72"/>
|
||||
<location filename="../paydvouchersdialog.cpp" line="83"/>
|
||||
<source>sent</source>
|
||||
<translation>Odesláno</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydvouchersdialog.cpp" line="99"/>
|
||||
<location filename="../paydvouchersdialog.cpp" line="110"/>
|
||||
<source>Text files (*.txt)</source>
|
||||
<translation>Textové soubory (*.txt)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../paydvouchersdialog.cpp" line="139"/>
|
||||
<location filename="../paydvouchersdialog.cpp" line="150"/>
|
||||
<source>Error</source>
|
||||
<translation>Chyba</translation>
|
||||
</message>
|
||||
@@ -170,33 +176,33 @@
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../shopform.cpp" line="36"/>
|
||||
<location filename="../shopform.cpp" line="35"/>
|
||||
<source>EET communication error.
|
||||
</source>
|
||||
<translation>Chyba komunikace s EET</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.cpp" line="40"/>
|
||||
<location filename="../shopform.cpp" line="39"/>
|
||||
<source>Message from portal: </source>
|
||||
<translation>Zpráva z EET portálu:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.cpp" line="43"/>
|
||||
<location filename="../shopform.cpp" line="42"/>
|
||||
<source>Switch to offline?</source>
|
||||
<translation>Přepnout do offline?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.cpp" line="45"/>
|
||||
<location filename="../shopform.cpp" line="44"/>
|
||||
<source>EET error</source>
|
||||
<translation>Chyba EET</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.cpp" line="51"/>
|
||||
<location filename="../shopform.cpp" line="50"/>
|
||||
<source><a href="#eet">Online</a></source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.cpp" line="51"/>
|
||||
<location filename="../shopform.cpp" line="50"/>
|
||||
<source><a href="#eet">Offline</a></source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
@@ -223,6 +229,11 @@
|
||||
<source>Items</source>
|
||||
<translation>Položky</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../receiptloadform.ui" line="55"/>
|
||||
<source>Select &all</source>
|
||||
<translation>Vybrat &vše</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ReceiptSaveForm</name>
|
||||
@@ -284,142 +295,167 @@
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="44"/>
|
||||
<location filename="../shopform.ui" line="111"/>
|
||||
<source>Commodity</source>
|
||||
<translation>Zboží</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="73"/>
|
||||
<location filename="../shopform.ui" line="140"/>
|
||||
<source>Count</source>
|
||||
<translation>Počet</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="99"/>
|
||||
<location filename="../shopform.ui" line="166"/>
|
||||
<source>Add Item</source>
|
||||
<translation>Přidat položku</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="127"/>
|
||||
<source>Direct Sale</source>
|
||||
<translation>Přímý prodej</translation>
|
||||
<translation type="vanished">Přímý prodej</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="140"/>
|
||||
<location filename="../shopform.ui" line="62"/>
|
||||
<source>Ctrl+D</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="162"/>
|
||||
<location filename="../shopform.ui" line="84"/>
|
||||
<source>Favorities</source>
|
||||
<translation>Oblíbené</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="186"/>
|
||||
<source>Receipt</source>
|
||||
<translation>Účtenka</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="201"/>
|
||||
<location filename="../shopform.ui" line="231"/>
|
||||
<source>10%</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="260"/>
|
||||
<location filename="../shopform.ui" line="289"/>
|
||||
<source>0%</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="273"/>
|
||||
<location filename="../shopform.ui" line="302"/>
|
||||
<source>21%</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="312"/>
|
||||
<location filename="../shopform.ui" line="340"/>
|
||||
<source>15%</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="361"/>
|
||||
<location filename="../shopform.ui" line="387"/>
|
||||
<source>Witouth VAT</source>
|
||||
<translation>Bez DPH</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="371"/>
|
||||
<location filename="../shopform.ui" line="397"/>
|
||||
<source>VAT</source>
|
||||
<translation>DPH</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="381"/>
|
||||
<location filename="../shopform.ui" line="407"/>
|
||||
<source>Total</source>
|
||||
<translation>Celkem</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="409"/>
|
||||
<location filename="../shopform.ui" line="435"/>
|
||||
<source>EET status:</source>
|
||||
<translation>EET status:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="425"/>
|
||||
<location filename="../shopform.ui" line="450"/>
|
||||
<source><a href="#eet">dfghdfg</a></source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="455"/>
|
||||
<location filename="../shopform.ui" line="479"/>
|
||||
<source>Total:</source>
|
||||
<translation>Celkem:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="185"/>
|
||||
<location filename="../shopform.ui" line="208"/>
|
||||
<location filename="../shopform.ui" line="218"/>
|
||||
<location filename="../shopform.ui" line="228"/>
|
||||
<location filename="../shopform.ui" line="244"/>
|
||||
<location filename="../shopform.ui" line="280"/>
|
||||
<location filename="../shopform.ui" line="296"/>
|
||||
<location filename="../shopform.ui" line="325"/>
|
||||
<location filename="../shopform.ui" line="335"/>
|
||||
<location filename="../shopform.ui" line="351"/>
|
||||
<location filename="../shopform.ui" line="472"/>
|
||||
<location filename="../shopform.ui" line="627"/>
|
||||
<location filename="../shopform.cpp" line="655"/>
|
||||
<source>Delete items</source>
|
||||
<translation>Smazat položky</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="630"/>
|
||||
<source>Ctrl+Del</source>
|
||||
<translation>Ctrl+Del</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="215"/>
|
||||
<location filename="../shopform.ui" line="238"/>
|
||||
<location filename="../shopform.ui" line="248"/>
|
||||
<location filename="../shopform.ui" line="258"/>
|
||||
<location filename="../shopform.ui" line="273"/>
|
||||
<location filename="../shopform.ui" line="309"/>
|
||||
<location filename="../shopform.ui" line="324"/>
|
||||
<location filename="../shopform.ui" line="352"/>
|
||||
<location filename="../shopform.ui" line="362"/>
|
||||
<location filename="../shopform.ui" line="377"/>
|
||||
<location filename="../shopform.ui" line="495"/>
|
||||
<source>0</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="493"/>
|
||||
<location filename="../shopform.ui" line="49"/>
|
||||
<source>Direct Sell</source>
|
||||
<translation>Přímý prodej</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="516"/>
|
||||
<source>Temporary Save</source>
|
||||
<translation>Dočasné uložení</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="515"/>
|
||||
<location filename="../shopform.ui" line="538"/>
|
||||
<source>Save</source>
|
||||
<translation>Uložení</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="537"/>
|
||||
<location filename="../shopform.ui" line="560"/>
|
||||
<source>Load</source>
|
||||
<translation>Načíst</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="559"/>
|
||||
<location filename="../shopform.ui" line="582"/>
|
||||
<source>Show paid</source>
|
||||
<translation>Zobrazit zaplacené</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.ui" line="581"/>
|
||||
<location filename="../shopform.ui" line="604"/>
|
||||
<source>Pay</source>
|
||||
<translation>Zaplatit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.cpp" line="149"/>
|
||||
<location filename="../shopform.cpp" line="595"/>
|
||||
<location filename="../shopform.cpp" line="157"/>
|
||||
<location filename="../shopform.cpp" line="640"/>
|
||||
<source><a href="#eet">Online</a></source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.cpp" line="149"/>
|
||||
<location filename="../shopform.cpp" line="595"/>
|
||||
<location filename="../shopform.cpp" line="157"/>
|
||||
<location filename="../shopform.cpp" line="640"/>
|
||||
<source><a href="#eet">Offline</a></source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.cpp" line="223"/>
|
||||
<location filename="../shopform.cpp" line="236"/>
|
||||
<source><< empty >></source>
|
||||
<translation><< nevybráno >></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopform.cpp" line="655"/>
|
||||
<source>Really delete selected voucher items?</source>
|
||||
<translation>Opravdu chcete smazat vybrané položky?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>EET communication error.
|
||||
</source>
|
||||
@@ -453,7 +489,9 @@
|
||||
<message>
|
||||
<location filename="../shopoverview.ui" line="52"/>
|
||||
<location filename="../shopoverview.ui" line="75"/>
|
||||
<location filename="../shopoverview.ui" line="110"/>
|
||||
<location filename="../shopoverview.ui" line="108"/>
|
||||
<location filename="../shopoverview.ui" line="131"/>
|
||||
<location filename="../shopoverview.ui" line="154"/>
|
||||
<source>TextLabel</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
@@ -463,10 +501,20 @@
|
||||
<translation>Nezaplaceno v Kč:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopoverview.ui" line="91"/>
|
||||
<location filename="../shopoverview.ui" line="90"/>
|
||||
<source>Unsend to EET:</source>
|
||||
<translation>Neodesláno na EET:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopoverview.ui" line="118"/>
|
||||
<source>Today sales:</source>
|
||||
<translation>Dnešní tržba:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../shopoverview.ui" line="141"/>
|
||||
<source>Number of sales today:</source>
|
||||
<translation>Dnešní počet prodejů:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ShopSettingsForm</name>
|
||||
@@ -481,127 +529,148 @@
|
||||
<translation>Nastavení rychlé volby</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="236"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="245"/>
|
||||
<source>...</source>
|
||||
<translation></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="126"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="129"/>
|
||||
<source>Printer</source>
|
||||
<translation>Tiskárna</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="89"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="92"/>
|
||||
<source>Columns</source>
|
||||
<translation>Sloupců</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="99"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="102"/>
|
||||
<source>Rows</source>
|
||||
<translation>Řádků</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="109"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="112"/>
|
||||
<source>Size</source>
|
||||
<translation>Velikost</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="132"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="138"/>
|
||||
<source>Output device</source>
|
||||
<translation>Jméno tiskárny</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="142"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="148"/>
|
||||
<source>Letters per line</source>
|
||||
<translation>Znaků na řádek</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="152"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="158"/>
|
||||
<source>Footer text</source>
|
||||
<translation>Patička</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="163"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="169"/>
|
||||
<source>EET</source>
|
||||
<translation>EET</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="169"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="175"/>
|
||||
<source>Activate EET</source>
|
||||
<translation>Zapnout podporu EET</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="181"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="190"/>
|
||||
<source>Shop ID</source>
|
||||
<translation>ID provozovny</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="191"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="200"/>
|
||||
<source>Cash register ID</source>
|
||||
<translation>ID zařízení</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="201"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="210"/>
|
||||
<source>EET mode</source>
|
||||
<translation>EET režim</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="211"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="220"/>
|
||||
<source>Certificate file</source>
|
||||
<translation>Certifikát</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="246"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="255"/>
|
||||
<source>Private key password</source>
|
||||
<translation>Heslo k certifikátu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="260"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="269"/>
|
||||
<source>Test mode</source>
|
||||
<translation>Testovací režim</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="267"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="276"/>
|
||||
<source>Communication with playground </source>
|
||||
<translation>Testovací EET server </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="278"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="287"/>
|
||||
<source>Other</source>
|
||||
<translation>Jiné</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="284"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="293"/>
|
||||
<source>Rounding</source>
|
||||
<translation>Zaokrouhlování</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="290"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="302"/>
|
||||
<source>Direction</source>
|
||||
<translation>Typ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="300"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="312"/>
|
||||
<source>Decimal places</source>
|
||||
<translation>Desetiných míst</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="313"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="325"/>
|
||||
<source>Rounding item text</source>
|
||||
<translation>Název položky</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.cpp" line="27"/>
|
||||
<location filename="../settings/shopsettingsform.ui" line="335"/>
|
||||
<source>Default VAT type</source>
|
||||
<translation>Výchozí sazba daně</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="348"/>
|
||||
<source>Doub&le print bill</source>
|
||||
<translation>Z&dvojená účtenka</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="363"/>
|
||||
<source>Item name</source>
|
||||
<translation>Jméno položky</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.ui" line="376"/>
|
||||
<source>Show field for item count</source>
|
||||
<translation>Zobrazit pole pro počet položek</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.cpp" line="24"/>
|
||||
<source>Simplifyed</source>
|
||||
<translation>Zjednodušený</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.cpp" line="27"/>
|
||||
<location filename="../settings/shopsettingsform.cpp" line="24"/>
|
||||
<source>Standard</source>
|
||||
<translation>Standartní</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.cpp" line="40"/>
|
||||
<location filename="../settings/shopsettingsform.cpp" line="55"/>
|
||||
<source>None</source>
|
||||
<translation>Žádný</translation>
|
||||
</message>
|
||||
@@ -620,6 +689,21 @@
|
||||
<source>Mathematic</source>
|
||||
<translation>Matematické</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.cpp" line="56"/>
|
||||
<source>High</source>
|
||||
<translation>Vysoká</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.cpp" line="57"/>
|
||||
<source>First lower</source>
|
||||
<translation>První snížená</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../settings/shopsettingsform.cpp" line="58"/>
|
||||
<source>Second lower</source>
|
||||
<translation>Druhá snížená</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>TemporaryReceiptSaveForm</name>
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QtTest>
|
||||
|
||||
#include "data/campdata.h"
|
||||
#include "data/serviceitem.h"
|
||||
#include "data/addressitem.h"
|
||||
#include "data/personprice.h"
|
||||
|
||||
class CampTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void campDataDefaultsAreZeroed()
|
||||
{
|
||||
CampData camp;
|
||||
|
||||
QCOMPARE(camp.totalPrice().toDouble(), 0.0);
|
||||
QCOMPARE(camp.sale().toDouble(), 0.0);
|
||||
QCOMPARE(camp.totalSale().toDouble(), 0.0);
|
||||
QCOMPARE(camp.fullPrice().toDouble(), 0.0);
|
||||
QVERIFY(!camp.fixedSale());
|
||||
QVERIFY(!camp.onVoucher());
|
||||
}
|
||||
|
||||
void campPricesRoundTripWithoutLoss()
|
||||
{
|
||||
CampData camp;
|
||||
|
||||
camp.setTotalPrice(QDecDouble(19.9));
|
||||
camp.setSale(QDecDouble(4.9));
|
||||
camp.setFullPrice(QDecDouble(24.8));
|
||||
|
||||
QVERIFY(qAbs(camp.totalPrice().toDouble() - 19.9) < 0.0001);
|
||||
QVERIFY(qAbs(camp.sale().toDouble() - 4.9) < 0.0001);
|
||||
QVERIFY(qAbs(camp.fullPrice().toDouble() - 24.8) < 0.0001);
|
||||
}
|
||||
|
||||
void campCollectsPeopleAndServices()
|
||||
{
|
||||
CampData camp;
|
||||
auto person = QSharedPointer<AddressItem>::create();
|
||||
auto service = QSharedPointer<ServiceItem>::create();
|
||||
|
||||
camp.addPerson(person);
|
||||
camp.addServiceItem(service);
|
||||
QCOMPARE(camp.people().size(), 1);
|
||||
QCOMPARE(camp.services().size(), 1);
|
||||
|
||||
camp.removePerson(person);
|
||||
camp.removeServiceItem(service);
|
||||
QVERIFY(camp.people().isEmpty());
|
||||
QVERIFY(camp.services().isEmpty());
|
||||
}
|
||||
|
||||
void serviceItemPricesRoundTrip()
|
||||
{
|
||||
ServiceItem item;
|
||||
|
||||
item.setPrice(QDecDouble(33.3));
|
||||
item.setTotalPrice(QDecDouble(66.6));
|
||||
item.setSale(QDecDouble(3.3));
|
||||
|
||||
QVERIFY(qAbs(item.price().toDouble() - 33.3) < 0.0001);
|
||||
QVERIFY(qAbs(item.totalPrice().toDouble() - 66.6) < 0.0001);
|
||||
QVERIFY(qAbs(item.sale().toDouble() - 3.3) < 0.0001);
|
||||
}
|
||||
|
||||
void addressItemOwnerFlagAndPrice()
|
||||
{
|
||||
AddressItem person;
|
||||
|
||||
person.setOwner(true);
|
||||
person.setPrice(QDecDouble(12.5));
|
||||
|
||||
QVERIFY(person.owner());
|
||||
QVERIFY(qAbs(person.price().toDouble() - 12.5) < 0.0001);
|
||||
}
|
||||
|
||||
void personPriceAgeRangeAndPrice()
|
||||
{
|
||||
PersonPrice price;
|
||||
|
||||
price.setFromAge(3);
|
||||
price.setToAge(12);
|
||||
price.setPrice(QDecDouble(7.5));
|
||||
price.setActive(true);
|
||||
|
||||
QCOMPARE(price.fromAge(), 3);
|
||||
QCOMPARE(price.toAge(), 12);
|
||||
QVERIFY(qAbs(price.price().toDouble() - 7.5) < 0.0001);
|
||||
QVERIFY(price.active());
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
CampTests tests;
|
||||
return QTest::qExec(&tests, argc, argv);
|
||||
}
|
||||
|
||||
#include "camp_tests.moc"
|
||||
@@ -0,0 +1,82 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QtTest>
|
||||
|
||||
#include "data/commoditydata.h"
|
||||
|
||||
class CommodityTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void defaultsAreZero()
|
||||
{
|
||||
CommodityData commodity;
|
||||
|
||||
QCOMPARE(commodity.price().toDouble(), 0.0);
|
||||
QCOMPARE(commodity.count(), 0);
|
||||
QCOMPARE(commodity.vat(), Enums::NONE);
|
||||
QVERIFY(!commodity.favorite());
|
||||
}
|
||||
|
||||
void priceRoundTripUsesFixedPointStorage()
|
||||
{
|
||||
CommodityData commodity;
|
||||
|
||||
commodity.setPrice(QDecDouble(19.9));
|
||||
|
||||
QVERIFY(qAbs(commodity.price().toDouble() - 19.9) < 0.0001);
|
||||
QCOMPARE(commodity.price(), commodity.unitPrice());
|
||||
}
|
||||
|
||||
void priceRoundTripHandlesWholeAmounts()
|
||||
{
|
||||
CommodityData commodity;
|
||||
|
||||
commodity.setPrice(QDecDouble(125));
|
||||
|
||||
QCOMPARE(commodity.price().toDouble(), 125.0);
|
||||
}
|
||||
|
||||
void vatMirrorsShopItemInterface()
|
||||
{
|
||||
CommodityData commodity;
|
||||
|
||||
commodity.setVat(Enums::HIGH);
|
||||
|
||||
QCOMPARE(commodity.vat(), Enums::HIGH);
|
||||
QCOMPARE(commodity.vatType(), Enums::HIGH);
|
||||
}
|
||||
|
||||
void pluginIdMatchesEmbeddedMetadata()
|
||||
{
|
||||
CommodityData commodity;
|
||||
|
||||
QCOMPARE(commodity.pluginId(), QStringLiteral("COMMODITY"));
|
||||
}
|
||||
|
||||
void basicPropertiesRoundTrip()
|
||||
{
|
||||
CommodityData commodity;
|
||||
|
||||
commodity.setName(QStringLiteral("Položka"));
|
||||
commodity.setShortName(QStringLiteral("Pol."));
|
||||
commodity.setCode(QStringLiteral("A-01"));
|
||||
commodity.setCount(7);
|
||||
commodity.setFavorite(true);
|
||||
|
||||
QCOMPARE(commodity.name(), QStringLiteral("Položka"));
|
||||
QCOMPARE(commodity.shortName(), QStringLiteral("Pol."));
|
||||
QCOMPARE(commodity.code(), QStringLiteral("A-01"));
|
||||
QCOMPARE(commodity.count(), 7);
|
||||
QVERIFY(commodity.favorite());
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
CommodityTests tests;
|
||||
return QTest::qExec(&tests, argc, argv);
|
||||
}
|
||||
|
||||
#include "commodity_tests.moc"
|
||||
@@ -0,0 +1,157 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
#include <QLocale>
|
||||
#include <QSettings>
|
||||
#include <QSignalSpy>
|
||||
#include <QTemporaryDir>
|
||||
#include <QtTest>
|
||||
|
||||
#include "context.h"
|
||||
#include "data/permission.h"
|
||||
#include "data/role.h"
|
||||
#include "data/user.h"
|
||||
#include "imetadataplugin.h"
|
||||
#include "permissionevaluator.h"
|
||||
|
||||
class CoreTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void init()
|
||||
{
|
||||
Context::instance().setCurrentUser({});
|
||||
}
|
||||
|
||||
void cleanup()
|
||||
{
|
||||
Context::instance().setCurrentUser({});
|
||||
}
|
||||
|
||||
void metadataRejectsMissingObject()
|
||||
{
|
||||
QVERIFY(!IMetaDataPlugin::loadBaseMetaData({}));
|
||||
QVERIFY(!IMetaDataPlugin::loadBaseMetaData(QJsonObject{{"MetaData", QStringLiteral("invalid")}}));
|
||||
}
|
||||
|
||||
void metadataUsesDefaultLocaleAndExtractsSchema()
|
||||
{
|
||||
const QJsonObject metadata{
|
||||
{"id", QStringLiteral("EXAMPLE")},
|
||||
{"schemaVersion", 2},
|
||||
{"name", QJsonObject{{"default", QStringLiteral("Example plugin")}}},
|
||||
{"description", QJsonObject{{"default", QStringLiteral("Example description")}}},
|
||||
{"sql", QJsonArray{QStringLiteral("CREATE TABLE example (id INTEGER)")}},
|
||||
{"dependencies", QJsonArray{QStringLiteral("CORE")}}
|
||||
};
|
||||
|
||||
const MetaDataPtr result = IMetaDataPlugin::loadBaseMetaData(QJsonObject{{"MetaData", metadata}});
|
||||
|
||||
QVERIFY(result);
|
||||
QCOMPARE(result->getId(), QStringLiteral("EXAMPLE"));
|
||||
QCOMPARE(result->getName(), QStringLiteral("Example plugin"));
|
||||
QCOMPARE(result->getDescription(), QStringLiteral("Example description"));
|
||||
QCOMPARE(result->getSchemaVersion(), 2);
|
||||
QCOMPARE(result->getSchemas(), QStringList{QStringLiteral("CREATE TABLE example (id INTEGER)")});
|
||||
QCOMPARE(result->getDependsOn(), QStringList{QStringLiteral("CORE")});
|
||||
}
|
||||
|
||||
void metadataPrefersSystemLocale()
|
||||
{
|
||||
const QString locale = QLocale::system().name();
|
||||
const QJsonObject metadata{
|
||||
{"id", QStringLiteral("LOCALIZED")},
|
||||
{"name", QJsonObject{{"default", QStringLiteral("Fallback")}, {locale, QStringLiteral("Localized")}}},
|
||||
{"description", QJsonObject{{"default", QStringLiteral("Fallback description")}}}
|
||||
};
|
||||
|
||||
const MetaDataPtr result = IMetaDataPlugin::loadBaseMetaData(QJsonObject{{"MetaData", metadata}});
|
||||
|
||||
QVERIFY(result);
|
||||
QCOMPARE(result->getName(), QStringLiteral("Localized"));
|
||||
QCOMPARE(result->getDescription(), QStringLiteral("Fallback description"));
|
||||
}
|
||||
|
||||
void permissionDeniedWithoutUser()
|
||||
{
|
||||
PermissionEvaluator evaluator;
|
||||
QSignalSpy denied(&evaluator, &PermissionEvaluator::permissionDenied);
|
||||
|
||||
QVERIFY(!evaluator.hasPermission(QStringLiteral("SHOP"), QStringLiteral("READ")));
|
||||
QCOMPARE(denied.count(), 0);
|
||||
}
|
||||
|
||||
void administratorBypassesPermissionLookup()
|
||||
{
|
||||
auto user = QSharedPointer<User>::create();
|
||||
user->setIsAdmin(true);
|
||||
Context::instance().setCurrentUser(user);
|
||||
|
||||
PermissionEvaluator evaluator;
|
||||
QSignalSpy denied(&evaluator, &PermissionEvaluator::permissionDenied);
|
||||
|
||||
QVERIFY(evaluator.hasPermission(QStringLiteral("SHOP"), QStringLiteral("DELETE")));
|
||||
QCOMPARE(denied.count(), 0);
|
||||
}
|
||||
|
||||
void matchingRolePermissionIsGranted()
|
||||
{
|
||||
auto permission = QSharedPointer<Permission>::create();
|
||||
permission->setPluginId(QStringLiteral("SHOP"));
|
||||
permission->setPermissionName(QStringLiteral("READ"));
|
||||
|
||||
auto role = QSharedPointer<Role>::create();
|
||||
role->addPermission(permission);
|
||||
|
||||
auto user = QSharedPointer<User>::create();
|
||||
user->setIsAdmin(false);
|
||||
user->addRole(role);
|
||||
Context::instance().setCurrentUser(user);
|
||||
|
||||
PermissionEvaluator evaluator;
|
||||
QSignalSpy denied(&evaluator, &PermissionEvaluator::permissionDenied);
|
||||
|
||||
QVERIFY(evaluator.hasPermission(QStringLiteral("SHOP"), QStringLiteral("READ")));
|
||||
QCOMPARE(denied.count(), 0);
|
||||
}
|
||||
|
||||
void mismatchedPermissionIsDeniedAndEmitsSignal()
|
||||
{
|
||||
auto permission = QSharedPointer<Permission>::create();
|
||||
permission->setPluginId(QStringLiteral("SHOP"));
|
||||
permission->setPermissionName(QStringLiteral("READ"));
|
||||
|
||||
auto role = QSharedPointer<Role>::create();
|
||||
role->addPermission(permission);
|
||||
|
||||
auto user = QSharedPointer<User>::create();
|
||||
user->setIsAdmin(false);
|
||||
user->addRole(role);
|
||||
Context::instance().setCurrentUser(user);
|
||||
|
||||
PermissionEvaluator evaluator;
|
||||
QSignalSpy denied(&evaluator, &PermissionEvaluator::permissionDenied);
|
||||
|
||||
QVERIFY(!evaluator.hasPermission(QStringLiteral("SHOP"), QStringLiteral("DELETE")));
|
||||
QCOMPARE(denied.count(), 1);
|
||||
QCOMPARE(denied.takeFirst().at(0).toString(), QStringLiteral("DELETE"));
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
QTemporaryDir settingsDirectory;
|
||||
if (!settingsDirectory.isValid()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||
QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, settingsDirectory.path());
|
||||
|
||||
CoreTests tests;
|
||||
return QTest::qExec(&tests, argc, argv);
|
||||
}
|
||||
|
||||
#include "core_tests.moc"
|
||||
@@ -0,0 +1,81 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QFileInfo>
|
||||
#include <QSettings>
|
||||
#include <QTemporaryDir>
|
||||
#include <QtTest>
|
||||
|
||||
#include <QxOrm.h>
|
||||
|
||||
#include "context.h"
|
||||
#include "service.h"
|
||||
#include "../countryregister/data/countrydata.h"
|
||||
|
||||
class PersistenceTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void crudCycleOnTemporaryDatabase()
|
||||
{
|
||||
QTemporaryDir dir;
|
||||
QVERIFY(dir.isValid());
|
||||
const QString dbPath = dir.filePath(QStringLiteral("countries.db"));
|
||||
|
||||
qx::QxSqlDatabase::getSingleton()->setDriverName(QStringLiteral("QSQLITE"));
|
||||
qx::QxSqlDatabase::getSingleton()->setDatabaseName(dbPath);
|
||||
|
||||
const QSqlError createError = qx::dao::create_table<CountryData>();
|
||||
QVERIFY2(!createError.isValid(), qPrintable(createError.text()));
|
||||
QVERIFY(QFileInfo::exists(dbPath));
|
||||
|
||||
Service<CountryData> service;
|
||||
|
||||
auto country = QSharedPointer<CountryData>::create();
|
||||
country->setCode2(QStringLiteral("CZ"));
|
||||
country->setCode3(QStringLiteral("CZE"));
|
||||
country->setCzechName(QStringLiteral("Česko"));
|
||||
country->setEnglishName(QStringLiteral("Czechia"));
|
||||
|
||||
QSignalSpy errorSpy(&service, &Service<CountryData>::dbError);
|
||||
service.save(country);
|
||||
QCOMPARE(errorSpy.count(), 0);
|
||||
QVERIFY(country->id() > 0);
|
||||
|
||||
const QList<QSharedPointer<CountryData>> all = service.all();
|
||||
QCOMPARE(all.size(), 1);
|
||||
QCOMPARE(all.first()->code2(), QStringLiteral("CZ"));
|
||||
QCOMPARE(all.first()->czechName(), QStringLiteral("Česko"));
|
||||
|
||||
auto loaded = service.loadById(country->id());
|
||||
QVERIFY(!loaded.isNull());
|
||||
QCOMPARE(loaded->code3(), QStringLiteral("CZE"));
|
||||
|
||||
loaded->setCzechName(QStringLiteral("Česká republika"));
|
||||
service.update(loaded);
|
||||
QCOMPARE(errorSpy.count(), 0);
|
||||
|
||||
auto reloaded = service.loadById(country->id());
|
||||
QCOMPARE(reloaded->czechName(), QStringLiteral("Česká republika"));
|
||||
|
||||
service.erase(reloaded);
|
||||
QCOMPARE(errorSpy.count(), 0);
|
||||
QVERIFY(service.all().isEmpty());
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
QTemporaryDir settingsDirectory;
|
||||
if (!settingsDirectory.isValid()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
QSettings::setDefaultFormat(QSettings::IniFormat);
|
||||
QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, settingsDirectory.path());
|
||||
|
||||
PersistenceTests tests;
|
||||
return QTest::qExec(&tests, argc, argv);
|
||||
}
|
||||
|
||||
#include "persistence_tests.moc"
|
||||
@@ -0,0 +1,73 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QFileInfo>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
#include <QPluginLoader>
|
||||
#include <QtTest>
|
||||
|
||||
#include "imetadataplugin.h"
|
||||
#include "iplugin.h"
|
||||
|
||||
struct PluginExpectation
|
||||
{
|
||||
QString path;
|
||||
QString id;
|
||||
};
|
||||
|
||||
class PluginMetadataTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PluginMetadataTests(QList<PluginExpectation> plugins)
|
||||
: m_plugins(std::move(plugins))
|
||||
{
|
||||
}
|
||||
|
||||
private slots:
|
||||
void embeddedMetadataMatchesPluginContract()
|
||||
{
|
||||
for (const PluginExpectation &plugin : m_plugins) {
|
||||
QVERIFY2(QFileInfo::exists(plugin.path), qPrintable(plugin.path));
|
||||
|
||||
QPluginLoader loader(plugin.path);
|
||||
const QJsonObject metadata = loader.metaData();
|
||||
QVERIFY2(!metadata.isEmpty(), qPrintable(loader.errorString()));
|
||||
QCOMPARE(metadata.value(QStringLiteral("IID")).toString(), QString::fromLatin1(PluginInterface_iid));
|
||||
|
||||
const QJsonObject data = metadata.value(QStringLiteral("MetaData")).toObject();
|
||||
QVERIFY2(!data.isEmpty(), qPrintable(plugin.path));
|
||||
QCOMPARE(data.value(QStringLiteral("id")).toString(), plugin.id);
|
||||
QVERIFY(data.value(QStringLiteral("schemaVersion")).toInt() > 0);
|
||||
QVERIFY(data.value(QStringLiteral("sql")).isArray());
|
||||
QVERIFY(data.value(QStringLiteral("dependencies")).isArray());
|
||||
|
||||
const MetaDataPtr parsed = IMetaDataPlugin::loadBaseMetaData(metadata);
|
||||
QVERIFY(parsed);
|
||||
QCOMPARE(parsed->getId(), plugin.id);
|
||||
QCOMPARE(parsed->getSchemaVersion(), data.value(QStringLiteral("schemaVersion")).toInt());
|
||||
QCOMPARE(parsed->getSchemas().size(), data.value(QStringLiteral("sql")).toArray().size());
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
QList<PluginExpectation> m_plugins;
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
if (argc < 3 || (argc - 1) % 2 != 0) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
QList<PluginExpectation> plugins;
|
||||
for (int index = 1; index < argc; index += 2) {
|
||||
plugins.append({QString::fromLocal8Bit(argv[index]), QString::fromLocal8Bit(argv[index + 1])});
|
||||
}
|
||||
|
||||
PluginMetadataTests tests(std::move(plugins));
|
||||
return QTest::qExec(&tests, 1, argv);
|
||||
}
|
||||
|
||||
#include "plugin_metadata_tests.moc"
|
||||
@@ -0,0 +1,67 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QtTest>
|
||||
|
||||
#include "data/accservice.h"
|
||||
|
||||
class ServicesTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void defaultsMatchExpectedInitialState()
|
||||
{
|
||||
AccService service;
|
||||
|
||||
QCOMPARE(service.price().toDouble(), 0.0);
|
||||
QVERIFY(service.active());
|
||||
QVERIFY(!service.salePossible());
|
||||
QCOMPARE(service.serviceType(), AccService::OTHER);
|
||||
QCOMPARE(service.vatType(), Enums::NONE);
|
||||
}
|
||||
|
||||
void priceRoundTripUsesFixedPointStorage()
|
||||
{
|
||||
AccService service;
|
||||
|
||||
service.setPrice(QDecDouble(19.9));
|
||||
|
||||
QVERIFY(qAbs(service.price().toDouble() - 19.9) < 0.0001);
|
||||
}
|
||||
|
||||
void priceRoundTripHandlesWholeAmounts()
|
||||
{
|
||||
AccService service;
|
||||
|
||||
service.setPrice(QDecDouble(250));
|
||||
|
||||
QCOMPARE(service.price().toDouble(), 250.0);
|
||||
}
|
||||
|
||||
void basicPropertiesRoundTrip()
|
||||
{
|
||||
AccService service;
|
||||
|
||||
service.setAccServiceName(QStringLiteral("Ubytování"));
|
||||
service.setAccServiceCode(QStringLiteral("UB-1"));
|
||||
service.setActive(false);
|
||||
service.setSalePossible(true);
|
||||
service.setServiceType(AccService::TENT);
|
||||
service.setVatType(Enums::FIRST_LOWER);
|
||||
|
||||
QCOMPARE(service.accServiceName(), QStringLiteral("Ubytování"));
|
||||
QCOMPARE(service.accServiceCode(), QStringLiteral("UB-1"));
|
||||
QVERIFY(!service.active());
|
||||
QVERIFY(service.salePossible());
|
||||
QCOMPARE(service.serviceType(), AccService::TENT);
|
||||
QCOMPARE(service.vatType(), Enums::FIRST_LOWER);
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
ServicesTests tests;
|
||||
return QTest::qExec(&tests, argc, argv);
|
||||
}
|
||||
|
||||
#include "services_tests.moc"
|
||||
@@ -0,0 +1,57 @@
|
||||
#include <QCoreApplication>
|
||||
#include <QtTest>
|
||||
|
||||
#include "data/voucher.h"
|
||||
|
||||
class ShopTests : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void defaultsMatchNewVoucherState()
|
||||
{
|
||||
Voucher voucher;
|
||||
|
||||
QCOMPARE(voucher.totalPrice().toDouble(), 0.0);
|
||||
QCOMPARE(voucher.status(), Voucher::NEW);
|
||||
QCOMPARE(voucher.eetStatus(), Voucher::EET_FOR_SEND);
|
||||
}
|
||||
|
||||
void totalPriceRoundTripUsesFixedPointStorage()
|
||||
{
|
||||
Voucher voucher;
|
||||
|
||||
voucher.setTotalPrice(QDecDouble(19.9));
|
||||
|
||||
QVERIFY(qAbs(voucher.totalPrice().toDouble() - 19.9) < 0.0001);
|
||||
}
|
||||
|
||||
void vatAmountIsDifferenceBetweenTotalAndBase()
|
||||
{
|
||||
Voucher voucher;
|
||||
|
||||
voucher.setTotalPriceVatHigh(QDecDouble(121));
|
||||
voucher.setPriceVatHigh(QDecDouble(100));
|
||||
|
||||
QVERIFY(qAbs(voucher.vatAmountHigh().toDouble() - 21.0) < 0.0001);
|
||||
}
|
||||
|
||||
void voucherSumAccumulatesPricesWithoutTruncation()
|
||||
{
|
||||
VoucherSum sum(0, 0);
|
||||
|
||||
sum.addPrice(QDecDouble(19.9));
|
||||
sum.addPrice(QDecDouble(0.1));
|
||||
|
||||
QVERIFY(qAbs(sum.totalPrice().toDouble() - 20.0) < 0.0001);
|
||||
}
|
||||
};
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication app(argc, argv);
|
||||
ShopTests tests;
|
||||
return QTest::qExec(&tests, argc, argv);
|
||||
}
|
||||
|
||||
#include "shop_tests.moc"
|
||||
Reference in New Issue
Block a user