Added inactive records support.
[fa-stable.git] / inventory / includes / db / items_units_db.inc
index 2d23210273e8ddafe98d3177f17f5d5884651c03..b5c98d9118f7afd5f39d2fcc0f9754618e16a9ed 100644 (file)
@@ -58,8 +58,10 @@ function item_unit_used($unit) {
        return ($myrow[0] > 0);
 }
 
-function get_all_item_units() {
-    $sql = "SELECT * FROM ".TB_PREF."item_units ORDER BY name";
+function get_all_item_units($all=false) {
+    $sql = "SELECT * FROM ".TB_PREF."item_units";
+       if (!$all) $sql .= " WHERE !inactive";
+       $sql .= " ORDER BY name";
     return  db_query($sql, "could not get stock categories");
 }
 // 2008-06-15. Added Joe Hunt to get a measure of unit by given stock_id