fix problems from tests
This commit is contained in:
@@ -84,7 +84,7 @@ QDecDouble CommodityData::price() const
|
|||||||
|
|
||||||
void CommodityData::setPrice(const QDecDouble &price)
|
void CommodityData::setPrice(const QDecDouble &price)
|
||||||
{
|
{
|
||||||
m_price = price.toDouble() * DEC_MULTIPLE;
|
m_price = qRound(price.toDouble() * DEC_MULTIPLE);
|
||||||
}
|
}
|
||||||
Enums::VatType CommodityData::vat() const
|
Enums::VatType CommodityData::vat() const
|
||||||
{
|
{
|
||||||
|
|||||||
+3
-1
@@ -1,6 +1,8 @@
|
|||||||
#ifndef DEFINE_H
|
#ifndef DEFINE_H
|
||||||
#define DEFINE_H
|
#define DEFINE_H
|
||||||
|
|
||||||
|
#include <QtGlobal>
|
||||||
|
|
||||||
#define ALL(arr) arr.begin(), arr.end()
|
#define ALL(arr) arr.begin(), arr.end()
|
||||||
|
|
||||||
// default rights
|
// default rights
|
||||||
@@ -11,7 +13,7 @@
|
|||||||
|
|
||||||
#define DEC_MULTIPLE 100
|
#define DEC_MULTIPLE 100
|
||||||
#define TO_DEC(num) (QDecDouble(num) / QDecDouble(DEC_MULTIPLE))
|
#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
|
#ifndef PLUGIN_ROOT
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|||||||
@@ -237,7 +237,10 @@ protected:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (!Context::instance().currentUser().isNull()) {
|
||||||
obj->setProperty("updatedBy", Context::instance().currentUser()->login());
|
obj->setProperty("updatedBy", Context::instance().currentUser()->login());
|
||||||
|
}
|
||||||
|
|
||||||
obj->setProperty("updated", QDateTime::currentDateTime());
|
obj->setProperty("updated", QDateTime::currentDateTime());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ QDecDouble AccService::price() const
|
|||||||
|
|
||||||
void AccService::setPrice(QDecDouble price)
|
void AccService::setPrice(QDecDouble price)
|
||||||
{
|
{
|
||||||
m_price = price.toDouble() * DEC_MULTIPLE;
|
m_price = qRound(price.toDouble() * DEC_MULTIPLE);
|
||||||
}
|
}
|
||||||
bool AccService::active() const
|
bool AccService::active() const
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user