fix problems from tests

This commit is contained in:
2026-10-12 16:29:43 +02:00
parent a0a745df0c
commit 3a4c517a75
4 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -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
{
+3 -1
View File
@@ -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
+4 -1
View File
@@ -237,7 +237,10 @@ protected:
}
else
{
obj->setProperty("updatedBy", Context::instance().currentUser()->login());
if (!Context::instance().currentUser().isNull()) {
obj->setProperty("updatedBy", Context::instance().currentUser()->login());
}
obj->setProperty("updated", QDateTime::currentDateTime());
}
}
+1 -1
View File
@@ -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
{