From 3f12d57f8212f2eb24441d306ea7df69fc3b78b0 Mon Sep 17 00:00:00 2001 From: Steve Ireland Date: Mon, 11 Jun 2018 14:02:04 -0400 Subject: [PATCH] Fix item select issue introduced with temp item feature --- application/libraries/Sale_lib.php | 4 ++-- application/models/Item.php | 20 -------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index 4c90e2612..7dfb3fed9 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -698,7 +698,7 @@ class Sale_lib public function add_item(&$item_id, $quantity = 1, $item_location, $discount = 0, $price_mode = PRICE_MODE_STANDARD, $kit_price_option = NULL, $kit_print_option = NULL, $price_override = NULL, $description = NULL, $serialnumber = NULL, $include_deleted = FALSE, $print_option = NULL ) { - $item_info = $this->CI->Item->get_info_by_id($item_id); + $item_info = $this->CI->Item->get_info_by_id_or_number($item_id); //make sure item exists if(empty($item_info)) @@ -875,7 +875,7 @@ class Sale_lib //make sure item exists if($item_id != -1) { - $item_info = $this->CI->Item->get_info_by_id($item_id); + $item_info = $this->CI->Item->get_info_by_id_or_number($item_id); if($item_info->stock_type == HAS_STOCK) { diff --git a/application/models/Item.php b/application/models/Item.php index 7b911b7dd..fcb28c670 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -351,26 +351,6 @@ class Item extends CI_Model return ''; } - /* - * Gets information about a particular active item by item id - */ - public function get_info_by_id($item_id) - { - $this->db->from('items'); - - $this->db->where('items.item_id', (int) $item_id); - - $this->db->where('items.deleted', 0); - - $query = $this->db->get(); - - if($query->num_rows() == 1) - { - return $query->row(); - } - - return ''; - } /* Get an item id given an item number */