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

fix: empty vat in article

Übergeordneter 2e23e89d
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -126,8 +126,10 @@ public function __construct($attributes = array())
$this->attributes['quantity'] = $attributes['quantity'];
}
if (isset($attributes['vat'])) {
if (isset($attributes['vat']) && $attributes['vat'] !== '') {
$this->attributes['vat'] = $attributes['vat'];
} else {
$this->attributes['vat'] = '';
}
if (isset($attributes['discount'])) {
......@@ -241,7 +243,7 @@ public function getSum()
*/
public function getVat()
{
if (isset($this->attributes['vat'])) {
if (isset($this->attributes['vat']) && $this->attributes['vat'] !== '') {
return (int)$this->attributes['vat'];
}
......@@ -397,10 +399,10 @@ public function calc($Instance = null)
*/
public function toArray()
{
$vat = false;
$vat = '';
$discount = '';
if (isset($this->attributes['vat'])) {
if (isset($this->attributes['vat']) && $this->attributes['vat'] !== '') {
$vat = (int)$this->attributes['vat'];
}
......
......@@ -90,7 +90,7 @@ public function __construct(array $attributes)
}
}
$this->id = (int)$attributes['id'];
$this->id = $attributes['id'];
$this->isCompany = (bool)$attributes['isCompany'];
$this->lang = $attributes['lang'];
......
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