last from 01 2019

This commit is contained in:
Kevin Adametz 2019-02-07 16:25:02 +01:00
parent f9fcaac838
commit ed80b25b85
19 changed files with 626 additions and 341 deletions

View file

@ -106,5 +106,22 @@ class DraftItem extends Model
return isset($this->attributes['price_children']) ? $this->attributes['price_children'] : 0;
}
public function setPriceAttribute($value)
{
$value = $this->_format_number($value);
$this->attributes['price'] = floatval(str_replace(',', '.', $value));
}
public function getPriceAttribute()
{
// 2 = decimal places | '.' = decimal seperator | ',' = thousand seperator
return number_format(($this->attributes['price']), 2, ',', '.');
}
public function getPriceRaw()
{
return isset($this->attributes['price']) ? $this->attributes['price'] : 0;
}
}