Skip to content
Code-Schnipsel Gruppen Projekte
Commit 0d168301 erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

fix: candyman-gmbh/projektplanung#97

Übergeordneter 6cdfdf38
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -112,12 +112,12 @@
<en><![CDATA[Price calculation basis]]></en>
</locale>
<locale name="user.settings.userNettoStatus.netto">
<de><![CDATA[netto]]></de>
<en><![CDATA[netto]]></en>
<de><![CDATA[gewerblich (netto / zzgl. MwSt.)]]></de>
<en><![CDATA[business (netto / incl. vat)]]></en>
</locale>
<locale name="user.settings.userNettoStatus.brutto">
<de><![CDATA[brutto]]></de>
<en><![CDATA[brutto]]></en>
<de><![CDATA[privat (brutto / inkl. MwSt.)]]></de>
<en><![CDATA[private (gross / incl. vat)]]></en>
</locale>
<locale name="user.profile.title">
......
......@@ -181,7 +181,7 @@ public function getCurrency()
public static function validatePrice($value)
{
if (\is_float($value)) {
return \round($value, 4);
return \round($value, QUI\ERP\Defaults::getPrecision());
}
$value = (string)$value;
......@@ -225,7 +225,11 @@ public static function validatePrice($value)
$value = \str_replace($decimalSeparator, '.', $value);
}
return \round(\floatval($value), 4) * $negativeTurn;
$value = \floatval($value);
$value = \round($value, QUI\ERP\Defaults::getPrecision());
$value = $value * $negativeTurn;
return $value;
}
/**
......
......@@ -447,15 +447,15 @@ public function isCompany()
public function isNetto()
{
if ($this->existsAttribute('erp.isNettoUser')) {
return $this->existsAttribute('erp.isNettoUser');
return (int)$this->getAttribute('erp.isNettoUser') === QUI\ERP\Utils\User::IS_NETTO_USER;
}
if ($this->existsAttribute('quiqqer.erp.isNettoUser')) {
return $this->existsAttribute('quiqqer.erp.isNettoUser');
return (int)$this->getAttribute('quiqqer.erp.isNettoUser') === QUI\ERP\Utils\User::IS_NETTO_USER;
}
if ($this->isNetto === null) {
$this->isNetto = QUI\ERP\Utils\User::getBruttoNettoUserStatus($this);
$this->isNetto = QUI\ERP\Utils\User::getBruttoNettoUserStatus($this) === QUI\ERP\Utils\User::IS_NETTO_USER;
}
return $this->isNetto;
......
......@@ -79,6 +79,34 @@ public static function isB2C()
return \strpos(self::getBusinessType(), 'B2C') !== false;
}
/**
* Is the shop an b2c and b2b shop, but b2c is more important
*
* @return bool
*/
public static function isB2BPrioritized()
{
if (self::isB2B() === false) {
return false;
}
return \strpos(self::getBusinessType(), 'B2B') === 0;
}
/**
* Is the shop an b2c and b2b shop, but b2c is more important
*
* @return bool
*/
public static function isB2CPrioritized()
{
if (self::isB2C() === false) {
return false;
}
return \strpos(self::getBusinessType(), 'B2C') === 0;
}
/**
* Is the shop only b2b?
*
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren