From 658a1ea0bde1951d966ff0560e24a62e3cdde6e6 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Thu, 10 Dec 2015 22:21:42 +0100 Subject: [PATCH] Removed fixed assets from list item search and popup search. --- includes/ui/ui_lists.inc | 32 ++++++++------------------------ inventory/inquiry/stock_list.php | 15 ++++++--------- 2 files changed, 14 insertions(+), 33 deletions(-) diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 29afc214..9cb41a48 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -292,11 +292,11 @@ $opts = array( // default options } default_focus(($search_box && $by_id) ? $search_box : $name); - if ($SysPrefs->use_popup_search) + $img = ""; + if ($SysPrefs->use_popup_search && !isset($opts['fixed_asset'])) { - $img = ""; - $img_title = ""; - $link = ""; + $img_title = ""; + $link = ""; $id = $name; if ($SysPrefs->use_popup_windows) { switch (strtolower($type)) { @@ -329,10 +329,6 @@ $opts = array( // default options $link = $path_to_root . "/inventory/inquiry/stock_list.php?popup=1&type=kits&client_id=" . $id; $img_title = _("Search items"); break; - case "assets": - $link = $path_to_root . "/inventory/inquiry/stock_list.php?popup=1&type=assets&client_id=" . $id; - $img_title = _("Search items"); - break; case "customer": $link = $path_to_root . "/sales/inquiry/customers_list.php?popup=1&client_id=" . $id; $img_title = _("Search customers"); @@ -363,20 +359,10 @@ $opts = array( // default options if ($opts['editlink']) $selector .= ' '.$opts['editlink']; - if ($SysPrefs->use_popup_search) - { - if ($search_box && $opts['cells']) - $str = ($edit_entry!='' ? "$edit_entry" : '')."$selector$img"; - else - $str = $edit_entry.$selector.$img; - } + if ($search_box && $opts['cells']) + $str = ($edit_entry!='' ? "$edit_entry" : '')."$selector$img"; else - { - if ($search_box && $opts['cells']) - $str = ($edit_entry!='' ? "$edit_entry" : '')."$selector"; - else - $str = $edit_entry.$selector; - } + $str = $edit_entry.$selector.$img; return $str; } @@ -828,8 +814,6 @@ function stock_items_list($name, $selected_id=null, $all_option=false, if ($editkey) set_editor('item', $name, $editkey); - if (isset($opts['fixed_asset']) && $opts['fixed_asset']) - $type = 'assets'; $ret = combo_input($name, $selected_id, $sql, 'stock_id', 's.description', array_merge( array( @@ -838,7 +822,7 @@ function stock_items_list($name, $selected_id=null, $all_option=false, 'spec_id' => ALL_TEXT, 'search_box' => true, 'search' => array("stock_id", "c.description","s.description"), - 'search_submit' => get_company_pref('no_item_list')!=0, + 'search_submit' => get_company_pref('no_item_list')!=0 && !isset($opts['fixed_asset']), 'size'=>10, 'select_submit'=> $submit_on_change, 'category' => 2, diff --git a/inventory/inquiry/stock_list.php b/inventory/inquiry/stock_list.php index c0db0f69..d33ab81a 100644 --- a/inventory/inquiry/stock_list.php +++ b/inventory/inquiry/stock_list.php @@ -75,29 +75,26 @@ if (isset($_GET['type'])) { switch ($type) { case "sales": - $sql .= " AND !s.no_sale AND mb_flag != 'F'"; + $sql .= " AND !s.no_sale AND mb_flag <> 'F'"; break; case "manufactured": $sql .= " AND mb_flag = 'M'"; break; case "purchasable": - $sql .= " AND NOT no_purchase AND mb_flag != 'F' AND i.item_code=i.stock_id"; + $sql .= " AND NOT no_purchase AND mb_flag <> 'F' AND i.item_code=i.stock_id"; break; case "costable": - $sql .= " AND mb_flag != 'D' AND mb_flag != 'F' AND i.item_code=i.stock_id"; + $sql .= " AND mb_flag <> 'D' AND mb_flag <> 'F' AND i.item_code=i.stock_id"; break; case "component": $parent = $_GET['parent']; - $sql .= " AND i.item_code=i.stock_id AND i.stock_id <> '$parent' AND mb_flag != 'F' "; - break; - case "assets": - $sql .= " AND mb_flag = 'F'"; + $sql .= " AND i.item_code=i.stock_id AND i.stock_id <> '$parent' AND mb_flag <> 'F' "; break; case "kits": - $sql .= " AND !i.is_foreign AND i.item_code!=i.stock_id AND mb_flag != 'F'"; + $sql .= " AND !i.is_foreign AND i.item_code!=i.stock_id AND mb_flag <> 'F'"; break; case "all": - $sql .= " AND mb_flag != 'F' AND i.item_code=i.stock_id"; + $sql .= " AND mb_flag <> 'F' AND i.item_code=i.stock_id"; // NOTHING TO DO. break; } -- 2.30.2