Initial invoice rendering
This commit is contained in:
@@ -12,11 +12,11 @@ class Service extends Model
|
||||
|
||||
protected $appends = [
|
||||
'category',
|
||||
'name',
|
||||
'next_invoice',
|
||||
'product_name',
|
||||
'service_id',
|
||||
'service_id_url',
|
||||
'service_name',
|
||||
'status',
|
||||
];
|
||||
protected $visible = [
|
||||
@@ -24,11 +24,11 @@ class Service extends Model
|
||||
'category',
|
||||
'data_orig',
|
||||
'id',
|
||||
'name',
|
||||
'next_invoice',
|
||||
'product_name',
|
||||
'service_id',
|
||||
'service_id_url',
|
||||
'service_name',
|
||||
'status',
|
||||
];
|
||||
|
||||
@@ -80,6 +80,14 @@ class Service extends Model
|
||||
return $this->product->prod_plugin_file;
|
||||
}
|
||||
|
||||
public function getNameAttribute()
|
||||
{
|
||||
if (! isset($this->getServiceDetail()->name))
|
||||
return 'Unknown';
|
||||
|
||||
return $this->getServiceDetail()->name;
|
||||
}
|
||||
|
||||
public function getNextInvoiceAttribute()
|
||||
{
|
||||
return $this->date_next_invoice ? $this->date_next_invoice->format('Y-m-d') : NULL;
|
||||
@@ -127,14 +135,6 @@ class Service extends Model
|
||||
return sprintf('<a href="/u/service/view/%s">%s</a>',$this->id,$this->service_id);
|
||||
}
|
||||
|
||||
public function getServiceNameAttribute()
|
||||
{
|
||||
if (! isset($this->getServiceDetail()->name))
|
||||
return 'Unknown';
|
||||
|
||||
return $this->getServiceDetail()->name;
|
||||
}
|
||||
|
||||
public function getServiceNumberAttribute()
|
||||
{
|
||||
return sprintf('%02s.%04s.%04s',$this->site_id,$this->account_id,$this->id);
|
||||
|
Reference in New Issue
Block a user