mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
update formatCustomField value to accept nullable client
This commit is contained in:
parent
2f18ab1eeb
commit
710c08cdef
@ -41,15 +41,15 @@ class Helpers
|
||||
|
||||
/**
|
||||
* A centralised way to format the custom fields content.
|
||||
*
|
||||
* @param mixed $custom_fields
|
||||
* @param mixed $field
|
||||
* @param mixed $value
|
||||
* @param null|\App\Models\Client $client
|
||||
*
|
||||
* @return null|string
|
||||
*
|
||||
* @param mixed $custom_fields
|
||||
* @param mixed $field
|
||||
* @param mixed $value
|
||||
* @param \App\Models\Client|null $client
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function formatCustomFieldValue($custom_fields, $field, $value, ?Client $client): ?string
|
||||
public function formatCustomFieldValue($custom_fields, $field, $value, Client $client = null): ?string
|
||||
{
|
||||
$custom_field = '';
|
||||
|
||||
@ -64,7 +64,7 @@ class Helpers
|
||||
|
||||
switch ($custom_field) {
|
||||
case 'date':
|
||||
return $this->formatDate($value, $client->date_format());
|
||||
return is_null($client) ? $value : $this->formatDate($value, $client->date_format());
|
||||
break;
|
||||
|
||||
case 'switch':
|
||||
|
Loading…
x
Reference in New Issue
Block a user