From 83ec60cf704376a32b9b676b7c125d8db0dac0df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Fri, 25 Dec 2020 12:25:28 +0100 Subject: [PATCH] Remove unused makeCustomFieldKeyValuePair() method --- app/Utils/Traits/MakesInvoiceValues.php | 30 +------------------------ 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/app/Utils/Traits/MakesInvoiceValues.php b/app/Utils/Traits/MakesInvoiceValues.php index 08356c076822..6d78e614c40a 100644 --- a/app/Utils/Traits/MakesInvoiceValues.php +++ b/app/Utils/Traits/MakesInvoiceValues.php @@ -74,6 +74,7 @@ trait MakesInvoiceValues if ($custom_fields && property_exists($custom_fields, $field)) { $custom_field = $custom_fields->{$field}; + $custom_field_parts = explode('|', $custom_field); return $custom_field_parts[0]; @@ -96,35 +97,6 @@ trait MakesInvoiceValues return ''; } - /** - * This method produces the key /value pairs for - * custom fields. - * - * We need to explode the field name and search for the | - * we split on the pipe, the first value is the field name - * and the second is the field _type_ - * - * We transform the $value depending the $field type - * - * @param string $field The full field name - * @param string $value The custom value - * @return array The key value pair - */ - private function makeCustomFieldKeyValuePair($field, $value) - { - if ($this->findCustomType($field) == 'date') { - $value = $this->formatDate($value, $this->client->date_format()); - } elseif ($this->findCustomType($field) == 'switch') { - $value = ctrans('texts.'.$value); - } - - if (! $value) { - $value = ''; - } - - return ['value' => $value, 'field' => $this->makeCustomField($field)]; - } - public function makeLabels($contact = null) :array { $data = [];