From 67cace93c71cc0c3d6d6ca8a16cf725ff7621f97 Mon Sep 17 00:00:00 2001 From: objecttothis <17935339+objecttothis@users.noreply.github.com> Date: Tue, 12 Sep 2017 18:33:07 +0400 Subject: [PATCH] allow custom format in receivings as well --- application/models/Item.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/application/models/Item.php b/application/models/Item.php index 8ad8142aa..231d4af4c 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -577,7 +577,7 @@ class Item extends CI_Model { $suggestions = array(); - $this->db->select('item_id, name'); + $this->db->select($this->get_search_suggestion_format('item_id, name')); $this->db->from('items'); $this->db->where('deleted', $filters['is_deleted']); $this->db->where("item_type = " . ITEM); // standard, exclude kit items since kits will be picked up later @@ -586,10 +586,10 @@ class Item extends CI_Model $this->db->order_by('name', 'asc'); foreach($this->db->get()->result() as $row) { - $suggestions[] = array('value' => $row->item_id, 'label' => $row->name); + $suggestions[] = array('value' => $row->item_id, 'label' => $this->get_search_suggestion_label($row)); } - $this->db->select('item_id, item_number'); + $this->db->select($this->get_search_suggestion_format('item_id, item_number')); $this->db->from('items'); $this->db->where('deleted', $filters['is_deleted']); $this->db->where("item_type = " . ITEM); // standard, exclude kit items since kits will be picked up later @@ -598,7 +598,7 @@ class Item extends CI_Model $this->db->order_by('item_number', 'asc'); foreach($this->db->get()->result() as $row) { - $suggestions[] = array('value' => $row->item_id, 'label' => $row->item_number); + $suggestions[] = array('value' => $row->item_id, 'label' => $this->get_search_suggestion_label($row)); } if(!$unique) @@ -631,7 +631,7 @@ class Item extends CI_Model } //Search by description - $this->db->select('item_id, name, description'); + $this->db->select($this->get_search_suggestion_format('item_id, name, description')); $this->db->from('items'); $this->db->where('deleted', $filters['is_deleted']); $this->db->where("item_type = " . ITEM); // standard, exclude kit items since kits will be picked up later @@ -640,7 +640,7 @@ class Item extends CI_Model $this->db->order_by('description', 'asc'); foreach($this->db->get()->result() as $row) { - $entry = array('value' => $row->item_id, 'label' => $row->name); + $entry = array('value' => $row->item_id, 'label' => $this->get_search_suggestion_label($row)); if(!array_walk($suggestions, function($value, $label) use ($entry) { return $entry['label'] != $label; } )) { $suggestions[] = $entry; @@ -668,7 +668,7 @@ class Item extends CI_Model $this->db->where('deleted', $filters['is_deleted']); foreach($this->db->get()->result() as $row) { - $suggestions[] = array('value' => $row->item_id, 'label' => $row->name); + $suggestions[] = array('value' => $row->item_id, 'label' => $this->get_search_suggestion_label($row)); } } }