X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fincludes%2Fdb%2Fitems_category_db.inc;h=fc474d5e88034c5d1d8e3149c0d86c30952f7fc1;hb=1466764d49233238c6097c95341875be552d7487;hp=11f9486ddc3b7a2f3ef41bde988a0c1b1c500243;hpb=ebc600101ceab69c06eac4b1bd4d1782af45de05;p=fa-stable.git diff --git a/inventory/includes/db/items_category_db.inc b/inventory/includes/db/items_category_db.inc index 11f9486d..fc474d5e 100644 --- a/inventory/includes/db/items_category_db.inc +++ b/inventory/includes/db/items_category_db.inc @@ -64,6 +64,17 @@ function delete_item_category($id) db_query($sql,"an item category could not be deleted"); } +function get_item_categories($show_inactive) +{ + $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"; + $sql .= " ORDER by description"; + + return db_query($sql, "could not get stock categories"); +} + function get_item_category($id) { $sql="SELECT * FROM ".TB_PREF."stock_category WHERE category_id=".db_escape($id);