X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fincludes%2Fdb%2Fitems_units_db.inc;h=b5c98d9118f7afd5f39d2fcc0f9754618e16a9ed;hb=3ff9ed87cb909f19c8fe3e7dfda5df79d0c01a6c;hp=1f63252a3e932eef412790129c53b1d02165da2b;hpb=99730b8d6deb7e81d2f1ebeb2ce7066d27729485;p=fa-stable.git diff --git a/inventory/includes/db/items_units_db.inc b/inventory/includes/db/items_units_db.inc index 1f63252a..b5c98d91 100644 --- a/inventory/includes/db/items_units_db.inc +++ b/inventory/includes/db/items_units_db.inc @@ -1,5 +1,14 @@ . +***********************************************************************/ function write_item_unit($selected, $abbr, $description, $decimals) { if($selected!='') @@ -49,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