diff --git a/app/Models/Service.php b/app/Models/Service.php index 7b526dc..cc84b51 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -25,6 +25,7 @@ class Service extends Model 'admin_service_id_url', 'category', 'name', + 'name_full', 'next_invoice', 'product_name', 'service_id', @@ -40,6 +41,7 @@ class Service extends Model 'data_orig', 'id', 'name', + 'name_full', 'next_invoice', 'product_name', 'service_id', @@ -144,6 +146,14 @@ class Service extends Model return $this->ServicePlugin()->name; } + public function getNameFullAttribute() + { + if (! isset($this->ServicePlugin()->full_name)) + return 'Unknown'; + + return $this->ServicePlugin()->full_name; + } + public function getNextInvoiceAttribute() { return $this->date_next_invoice ? $this->date_next_invoice->format('Y-m-d') : NULL; diff --git a/app/Models/ServiceAdsl.php b/app/Models/ServiceAdsl.php index 3799878..46588e2 100644 --- a/app/Models/ServiceAdsl.php +++ b/app/Models/ServiceAdsl.php @@ -12,6 +12,13 @@ class ServiceAdsl extends Model protected $table = 'ab_service__adsl'; public $timestamps = FALSE; + public function getFullNameAttribute() + { + return ($this->service_number AND $this->service_address) + ? sprintf('%s: %s',$this->service_number, $this->service_address) + : $this->name; + } + public function getNameAttribute() { return $this->service_number ?: $this->service_address; diff --git a/app/Models/ServiceVoip.php b/app/Models/ServiceVoip.php index 24beed5..ce9ea57 100644 --- a/app/Models/ServiceVoip.php +++ b/app/Models/ServiceVoip.php @@ -11,6 +11,13 @@ class ServiceVoip extends Model protected $table = 'ab_service__voip'; public $timestamps = FALSE; + public function getFullNameAttribute() + { + return ($this->service_number AND $this->service_address) + ? sprintf('%s: %s',$this->service_number, $this->service_address) + : $this->name; + } + public function getNameAttribute() { return $this->service_number; diff --git a/resources/theme/backend/adminlte/r/service_inactive.blade.php b/resources/theme/backend/adminlte/r/service_inactive.blade.php index 33abd62..44a91da 100644 --- a/resources/theme/backend/adminlte/r/service_inactive.blade.php +++ b/resources/theme/backend/adminlte/r/service_inactive.blade.php @@ -61,7 +61,7 @@ @endif }, { data: "account_name" }, - { data: "name" }, + { data: "name_full" }, { data: "status" }, { data: "product_name" } ], diff --git a/resources/theme/backend/adminlte/r/service_movements.blade.php b/resources/theme/backend/adminlte/r/service_movements.blade.php index af457fb..f02981f 100644 --- a/resources/theme/backend/adminlte/r/service_movements.blade.php +++ b/resources/theme/backend/adminlte/r/service_movements.blade.php @@ -61,7 +61,7 @@ @endif }, { data: "account_name" }, - { data: "name" }, + { data: "name_full" }, { data: "status" }, { data: "product_name" } ],