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

fix: is netto for erp user integrated, easier netto brutto status

Übergeordneter 55da6a6f
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -58,6 +58,11 @@ class User extends QUI\QDOM implements UserInterface
*/
protected $isCompany;
/**
* @var bool|null
*/
protected $isNetto;
/**
* @var array
*/
......@@ -90,6 +95,7 @@ public function __construct(array $attributes)
$this->id = $attributes['id'];
$this->isCompany = (bool)$attributes['isCompany'];
$this->isNetto = null;
$this->lang = $attributes['lang'];
$this->username = $attributes['username'];
......@@ -180,6 +186,7 @@ public static function convertUserToErpUser(QUI\Interfaces\Users\User $User)
'lastname' => $User->getAttribute('lastname'),
'lang' => $User->getLang(),
'isCompany' => $User->isCompany(),
'isNetto' => $User->getAttribute('quiqqer.erp.isNettoUser'),
'data' => $User->getAttributes()
]);
}
......@@ -368,6 +375,26 @@ public function isCompany()
return $this->isCompany;
}
/**
* @return bool
*/
public function isNetto()
{
if ($this->isNetto === null) {
$this->isNetto = QUI\ERP\Utils\User::getBruttoNettoUserStatus($this);
}
return $this->isNetto;
}
/**
* @return bool
*/
public function hasBruttoNettoStatus()
{
return is_bool($this->isNetto);
}
/**
* @return mixed
*/
......
......@@ -40,6 +40,11 @@ public static function getBruttoNettoUserStatus(UserInterface $User)
return self::IS_NETTO_USER;
}
if ($User instanceof QUI\ERP\User && $User->hasBruttoNettoStatus()) {
return $User->isNetto();
}
$nettoStatus = $User->getAttribute('quiqqer.erp.isNettoUser');
if (is_numeric($nettoStatus)) {
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren