Show service detail on invoices

This commit is contained in:
Deon George
2021-09-30 12:54:44 +10:00
parent 5be4fe6784
commit c0ad46ba65
2 changed files with 11 additions and 2 deletions

View File

@@ -26,7 +26,9 @@ use App\Traits\NextKey;
*
* Attributes for services:
* + billing_period : The period that this service is billed for by default
* + name : Service short name with service address
* + name_short : Service Product short name, eg: phone number, domain name, certificate CN
* + name_detail : Service Detail, eg: service_address
* + sid : System ID for service
*
* @package App\Models
@@ -697,7 +699,7 @@ class Service extends Model implements IDs
public function getNameAttribute(): string
{
return $this->product->name_short.': '.$this->getNameShortAttribute();
return $this->getNameShortAttribute().(($x=$this->getNameDetailAttribute()) ? ': '.$x : '');
}
/**
@@ -712,6 +714,11 @@ class Service extends Model implements IDs
return $this->type ? $this->type->service_name : $this->id;
}
public function getNameDetailAttribute()
{
return $this->type ? $this->type->service_address : $this->id;
}
/**
* @deprecated see getInvoiceNextAttribute()
*/