diff --git a/app/Models/Asset.php b/app/Models/Asset.php index c07ebbfec..c57157817 100644 --- a/app/Models/Asset.php +++ b/app/Models/Asset.php @@ -413,15 +413,12 @@ class Asset extends Depreciable return $this->rules; } - public function customFieldsForCheckinCheckout($type) { + public function customFieldsForCheckinCheckout($checkin_checkout) { // Check to see if any of the custom fields were included on the form and if they have any values if (($this->model) && ($this->model->fieldset) && ($this->model->fieldset->fields)) { foreach ($this->model->fieldset->fields as $field) { - - if ($field->{$type} == 1) { - if (request()->has($field->db_column)) { - $this->{$field->db_column} = request()->get($field->db_column); - } + if (($field->{$checkin_checkout} == 1) && (request()->has($field->db_column))){ + $this->{$field->db_column} = request()->get($field->db_column); } } }