Update Framework, Invoices

This commit is contained in:
Kevin Adametz 2022-04-14 13:14:36 +02:00
parent cc5c147c27
commit 9b0b5feb7e
174 changed files with 28356 additions and 8093 deletions

View file

@ -108,6 +108,13 @@ use Illuminate\Database\Eloquent\SoftDeletes;
* @property-read int|null $ingredients_count
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ProductIngredient[] $product_ingredients
* @property-read int|null $product_ingredients_count
* @property bool|null $no_commission
* @property array|null $show_on
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Ingredient[] $p_ingredients
* @property-read int|null $p_ingredients_count
* @method static \Illuminate\Database\Eloquent\Builder|Product whereNoCommission($value)
* @method static \Illuminate\Database\Eloquent\Builder|Product whereShowOn($value)
* @method static \Illuminate\Database\Eloquent\Builder|Product withUniqueSlugConstraints(\Illuminate\Database\Eloquent\Model $model, string $attribute, array $config, string $slug)
*/
class Product extends Model
{
@ -297,8 +304,7 @@ class Product extends Model
{
return isset($this->attributes['price_ek']) ? Util::formatNumber($this->attributes['price_ek']) : "";
}
public function getFormattedPriceOld()
{
return isset($this->attributes['price_old']) ? Util::formatNumber($this->attributes['price_old']) : "";
@ -437,17 +443,18 @@ class Product extends Model
public function getShowOnTypes(){
$ret = [];
foreach($this->show_on as $show){
$ret[] = isset($this->showONs[$show]) ? $this->showONs[$show] : '-';
if($this->show_on && is_array($this->show_on)){
foreach($this->show_on as $show){
$ret[] = isset($this->showONs[$show]) ? $this->showONs[$show] : '-';
}
}
return $ret;
}
public function setPosAttribute($value){
$this->attributes['pos'] = is_numeric($value) ? $value : null;
}
public function getLang($key)
{
$lang = \App::getLocale();