mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 22:54:25 +01:00
Create virtual display_name field on client
- Create virtual display_name field on client - Create accessor for it
This commit is contained in:
parent
f091cbd060
commit
42c51ea94a
@ -49,6 +49,13 @@ class Client extends EntityModel
|
|||||||
'website',
|
'website',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $appends = [
|
||||||
|
'display_name',
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
@ -331,6 +338,17 @@ class Client extends EntityModel
|
|||||||
return $contact->getDisplayName();
|
return $contact->getDisplayName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Making the virtual property display_name accessible
|
||||||
|
* via an accessor
|
||||||
|
*
|
||||||
|
* @return mixed|string
|
||||||
|
*/
|
||||||
|
public function getDisplayNameAttribute()
|
||||||
|
{
|
||||||
|
return $this->getDisplayName();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
|
@ -142,7 +142,7 @@ class Invoice extends EntityModel implements BalanceAffecting
|
|||||||
{
|
{
|
||||||
return $this->is_recurring
|
return $this->is_recurring
|
||||||
? trans('texts.recurring')
|
? trans('texts.recurring')
|
||||||
: $this->invoice_number.' ('.$this->client->name.')';
|
: $this->invoice_number.' ('.$this->client->display_name.')';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user