last changes since 6-2023

This commit is contained in:
Kevin Adametz 2023-07-03 10:07:08 +02:00
parent 0341c9c189
commit 04d677d37a
142 changed files with 7895 additions and 2855 deletions

View file

@ -22,6 +22,7 @@ use App\User;
* @property Carbon|null $date
* @property int|null $points
* @property int|null $month_points
* @property int $status_points
* @property float|null $total_net
* @property float|null $month_total_net
* @property string|null $message
@ -56,10 +57,11 @@ use App\User;
* @method static \Illuminate\Database\Eloquent\Builder|UserSalesVolume whereUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|UserSalesVolume whereUserInvoiceId($value)
* @method static \Illuminate\Database\Eloquent\Builder|UserSalesVolume whereYear($value)
* @mixin \Eloquent
* @property array|null $syslog
* @method static \Illuminate\Database\Eloquent\Builder|UserSalesVolume whereSyslog($value)
* @method static \Illuminate\Database\Eloquent\Builder|UserSalesVolume whereInfo($value)
* @method static \Illuminate\Database\Eloquent\Builder|UserSalesVolume whereStatusPoints($value)
* @mixin \Eloquent
*/
class UserSalesVolume extends Model
{
@ -72,8 +74,10 @@ class UserSalesVolume extends Model
'month' => 'int',
'year' => 'int',
'points' => 'int',
'month_points' => 'int',
'month_KP_points' => 'int',
'month_TP_points' => 'int',
'month_shop_points' => 'int',
'status_points' => 'int',
'total_net' => 'float',
'month_total_net' => 'float',
'month_shop_total_net' => 'float',
@ -93,8 +97,10 @@ class UserSalesVolume extends Model
'year',
'date',
'points',
'month_points',
'month_KP_points',
'month_TP_points',
'month_shop_points',
'status_points',
'total_net',
'month_total_net',
'month_shop_total_net',
@ -105,12 +111,18 @@ class UserSalesVolume extends Model
];
public static $statusPointsTypes = [
1 => 'KP + TP', //Eigene + Team
2 => 'KP', //nur Eigene nicht Team
];
public static $statusTypes = [
0 => 'nicht zugewiesen',
1 => 'Beraterbestellung', //hinzugefügt aus
2 => 'Shopbestellung', //hinzugefügt aus
3 => 'Shopbestellung / pending', //hinzugefügt aus
4 => 'Gutschrift', //hinzugefügt aus
5 => 'Registrierung', //hinzugefügt aus
10 => ''
];
@ -120,6 +132,7 @@ class UserSalesVolume extends Model
2 => 'secondary',
3 => 'warning',
4 => 'info',
5 => 'info',
10 => 'danger',
];
@ -148,9 +161,13 @@ class UserSalesVolume extends Model
return isset($this->attributes['date']) ? $this->attributes['date'] : NULL;
}
public function getPointsSum(){
return $this->month_points + $this->month_shop_points;
public function getPointsKPSum(){
return $this->month_KP_points + $this->month_shop_points; //only KP für SUM - KP is for User
}
public function getPointsTPSum(){
return $this->month_TP_points + $this->month_shop_points; //only TP für SUM - TP is only for Payline
}
public function getTotalNetSum(){
return $this->month_total_net + $this->month_shop_total_net;
}
@ -163,6 +180,13 @@ class UserSalesVolume extends Model
return isset(self::$statusColors[$this->status]) ? self::$statusColors[$this->status] : "default";
}
public function getStatusPointsType(){
return isset(self::$statusPointsTypes[$this->status_points]) ? self::$statusPointsTypes[$this->status_points] : "";
}
public function getStatusPointsColor(){
return isset(self::$statusColors[$this->status_points]) ? self::$statusColors[$this->status_points] : "default";
}
public function getFormatedMonthYear(){
return str_pad($this->month, 2, "0", STR_PAD_LEFT)."/".$this->year;
}