mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 03:54:36 -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.
|
* A centralised way to format the custom fields content.
|
||||||
*
|
*
|
||||||
* @param mixed $custom_fields
|
* @param mixed $custom_fields
|
||||||
* @param mixed $field
|
* @param mixed $field
|
||||||
* @param mixed $value
|
* @param mixed $value
|
||||||
* @param null|\App\Models\Client $client
|
* @param \App\Models\Client|null $client
|
||||||
*
|
*
|
||||||
* @return null|string
|
* @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 = '';
|
$custom_field = '';
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ class Helpers
|
|||||||
|
|
||||||
switch ($custom_field) {
|
switch ($custom_field) {
|
||||||
case 'date':
|
case 'date':
|
||||||
return $this->formatDate($value, $client->date_format());
|
return is_null($client) ? $value : $this->formatDate($value, $client->date_format());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'switch':
|
case 'switch':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user