Hook files inclusion moved to session.inc
[fa-stable.git] / taxes / db / tax_groups_db.inc
index 2c0b6b0220206c0288f7b2cf80606f282ced972f..5c217aa275bb0457c67a8285b57bf0ff4f509fca 100644 (file)
@@ -47,9 +47,10 @@ function update_tax_group($id, $name, $tax_shipping, $taxes, $rates)
        commit_transaction();                   
 }
 
-function get_all_tax_groups()
+function get_all_tax_groups($all=false)
 {
        $sql = "SELECT * FROM ".TB_PREF."tax_groups";
+       if (!$all) $sql .= " WHERE !inactive";
        
        return db_query($sql, "could not get all tax group");
 } 
@@ -95,7 +96,7 @@ function delete_tax_group_items($id)
 
 function get_tax_group_items($id)
 {
-       $sql = "SELECT ".TB_PREF."tax_group_items.*, ".TB_PREF."tax_types.name AS tax_type_name, 
+       $sql = "SELECT ".TB_PREF."tax_group_items.*, ".TB_PREF."tax_types.name AS tax_type_name, ".TB_PREF."tax_types.rate, 
                ".TB_PREF."tax_types.sales_gl_code, ".TB_PREF."tax_types.purchasing_gl_code  
                FROM ".TB_PREF."tax_group_items, ".TB_PREF."tax_types 
                WHERE tax_group_id=".db_escape($id)."
@@ -127,7 +128,7 @@ function get_tax_group_items_as_array($id)
 function get_shipping_tax_group_items()
 {
 
-       $sql = "SELECT ".TB_PREF."tax_group_items.*, ".TB_PREF."tax_types.name AS tax_type_name, 
+       $sql = "SELECT ".TB_PREF."tax_group_items.*, ".TB_PREF."tax_types.name AS tax_type_name, ".TB_PREF."tax_types.rate,
                ".TB_PREF."tax_types.sales_gl_code, ".TB_PREF."tax_types.purchasing_gl_code  
                FROM " .TB_PREF."tax_group_items, ".TB_PREF."tax_types, ".TB_PREF."tax_groups
                WHERE " .TB_PREF."tax_groups.tax_shipping=1