Old ineffective sql_trail superseded by new improved db_trail logging only calls...
[fa-stable.git] / inventory / includes / db / items_units_db.inc
index d90b03b39e18944493aa4819da6826d756e49cb2..ee9f17464cfc363330d0832a6bb7a4bebc766e50 100644 (file)
@@ -11,6 +11,8 @@
 ***********************************************************************/
 function write_item_unit($selected, $abbr, $description, $decimals)
 {
+       begin_transaction(__FUNCTION__, func_get_args());
+
     if($selected!='')
                $sql = "UPDATE ".TB_PREF."item_units SET
                abbr = ".db_escape($abbr).",
@@ -23,13 +25,16 @@ function write_item_unit($selected, $abbr, $description, $decimals)
                        ".db_escape($description).", ".db_escape($decimals).")";
 
        db_query($sql,"an item unit could not be updated");
+       commit_transaction();
 }
 
 function delete_item_unit($unit)
 {
+       begin_transaction(__FUNCTION__, func_get_args());
        $sql="DELETE FROM ".TB_PREF."item_units WHERE abbr=".db_escape($unit);
 
        db_query($sql,"an unit of measure could not be deleted");
+       commit_transaction();
 }
 
 function get_item_unit($unit)