Update Journal Entry SQL query fixed. Strange that it passed the MySql server!
[fa-stable.git] / inventory / includes / db / items_units_db.inc
index b3df604a14c40902f1d9a9ce5bf466680e86529e..e1841f1cd8508a2fc8e1ae031639e5bd86fcae1f 100644 (file)
@@ -58,11 +58,13 @@ 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
+// 2008-06-15. Added to get a measure of unit by given stock_id
 function get_unit_dec($stock_id)
 {
        $sql = "SELECT decimals FROM ".TB_PREF."item_units,     ".TB_PREF."stock_master
@@ -73,4 +75,3 @@ function get_unit_dec($stock_id)
        return $row[0];
 }
 
-?>
\ No newline at end of file