X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fincludes%2Fdb%2Fitems_category_db.inc;h=3c643d523dfc2e35fb4c74dce5d8ac24742b4c08;hb=07737913eea4abbc7a8604a286852facb2134540;hp=25368ee75e12c1357e0e002e74ab686b952af1c6;hpb=53d942f2a0d20cce5e9c409c6485867ce0869e4d;p=fa-stable.git diff --git a/inventory/includes/db/items_category_db.inc b/inventory/includes/db/items_category_db.inc index 25368ee7..3c643d52 100644 --- a/inventory/includes/db/items_category_db.inc +++ b/inventory/includes/db/items_category_db.inc @@ -66,11 +66,18 @@ function delete_item_category($id) db_query($sql,"an item category could not be deleted"); } -function get_item_categories($show_inactive) +function get_item_categories($show_inactive, $fixed_asset=false) { $sql = "SELECT c.*, t.name as tax_name FROM ".TB_PREF."stock_category c, " .TB_PREF."item_tax_types t WHERE c.dflt_tax_type=t.id"; - if (!$show_inactive) $sql .= " AND !c.inactive"; + if (!$show_inactive) + $sql .= " AND !c.inactive"; + if ($fixed_asset) + $sql .= " AND c.dflt_mb_flag='F'"; + else + $sql .= " AND c.dflt_mb_flag!='F'"; + + $sql .= " ORDER by description"; return db_query($sql, "could not get stock categories"); } @@ -94,4 +101,3 @@ function get_category_name($id) return $row[0]; } -?> \ No newline at end of file