Gutschriften Anpassungen

This commit is contained in:
Kevin Adametz 2021-04-29 16:36:11 +02:00
parent 3754f1c571
commit e670b92f5d
28 changed files with 303 additions and 99 deletions

View file

@ -65,6 +65,7 @@ class UserCredit extends Model
protected $fillable = [
'auth_user_id',
'credit_number',
'net',
'tax_rate',
'tax',
@ -77,6 +78,20 @@ class UserCredit extends Model
'status'
];
public static $statusTypes = [
0 => 'offen',
1 => 'bezahlt',
2 => 'prüfen',
10 => 'storniert'
];
public static $statusColors = [
0 => 'warning',
1 => 'success',
2 => 'secondary',
10 => 'danger',
];
public function user()
{
return $this->belongsTo(\App\User::class, 'auth_user_id');
@ -112,5 +127,14 @@ class UserCredit extends Model
{
return formatNumber($this->attributes['total']);
}
public function getStatusType(){
return isset(self::$statusTypes[$this->status]) ? self::$statusTypes[$this->status] : "";
}
public function getStatusColor(){
return isset(self::$statusColors[$this->status]) ? self::$statusColors[$this->status] : "default";
}
}