The average material cost test for either qoh > 0 and qoh + qty > 0 has changed to...
[fa-stable.git] / taxes / db / item_tax_types_db.inc
index 61959f81edfb3726a7af09c5a8589f4779718e4a..446a5dc7cb99ffe5839ccebe0f0929070206c1da 100644 (file)
@@ -62,9 +62,11 @@ function get_item_tax_type($id)
 
 function get_item_tax_type_for_item($stock_id)
 {
-       $sql = "SELECT ".TB_PREF."item_tax_types.* FROM ".TB_PREF."item_tax_types,".TB_PREF."stock_master WHERE 
-               ".TB_PREF."stock_master.stock_id=".db_escape($stock_id)."
-               AND ".TB_PREF."item_tax_types.id=".TB_PREF."stock_master.tax_type_id";
+       $sql = "SELECT item_tax_type.*
+               FROM ".TB_PREF."item_tax_types item_tax_type,"
+                       .TB_PREF."stock_master item
+               WHERE item.stock_id=".db_escape($stock_id)."
+               AND item_tax_type.id=item.tax_type_id";
        
        $result = db_query($sql, "could not get item tax type");
        
@@ -108,3 +110,8 @@ function get_item_tax_type_exemptions($id)
        return db_query($sql, "could not get item tax type exemptions");
 }
 
+function item_type_inactive($id)
+{
+       $type = get_item_tax_type($id);
+       return @$type['inactive'];
+}