#53, #52, #51 change Points

This commit is contained in:
Kevin Adametz 2022-07-21 10:37:34 +02:00
parent 582ca8299d
commit 263cf93a1e
41 changed files with 812 additions and 288 deletions

View file

@ -152,9 +152,9 @@ class ShoppingOrder extends Model
];
public static $apiStatusTypes = [
0 => 'offen',
1 => 'offen / pre',
2 => 'bestellt',
0 => 'bestellt',
1 => 'im Prozess',
2 => 'bezahlt',
5 => 'entfernt',
];
public static $apiStatusColors = [
@ -180,7 +180,7 @@ class ShoppingOrder extends Model
5 => 'Homeparty',
6 => 'Shop',
7 => 'extern',
8 => 'Sammelbestellung',
8 => 'Sammelrechnung',
10 => '',
];
@ -259,11 +259,11 @@ class ShoppingOrder extends Model
}
public function user_sales_volume(){
return $this->hasMany('App\Models\UserSalesVolume', 'shopping_order_id');
return $this->hasOne('App\Models\UserSalesVolume', 'shopping_order_id');
}
public function user_sales_volume_no_userid(){
return $this->hasMany('App\Models\UserSalesVolume', 'shopping_order_id')->where('user_id', '=', NULL)->first();
return $this->hasOne('App\Models\UserSalesVolume', 'shopping_order_id')->where('user_id', '=', NULL)->first();
}
@ -318,13 +318,12 @@ class ShoppingOrder extends Model
}
public function getAPIStatusType(){
return isset(self::$apiStatusTypes[$this->api_status]) ? self::$apiStatusTypes[$this->api_status] : "offen";
return isset(self::$apiStatusTypes[$this->api_status]) ? self::$apiStatusTypes[$this->api_status] : "bestellt";
}
public function getAPIStatusColor(){
return isset(self::$apiStatusColors[$this->api_status]) ? self::$apiStatusColors[$this->api_status] : "warning";
}
public function getFormattedTotal()
{