Cleanup in types.inc
[fa-stable.git] / includes / db / audit_trail_db.inc
index feb85a991f744b6ed3facf54fd4fffaff18d7964..e297d2ba1f54d7983e27b9446c7a708dfbc8e0fe 100644 (file)
@@ -12,7 +12,8 @@
 
 function add_audit_trail($trans_type, $trans_no, $trans_date, $descr='')
 {
-       begin_transaction();
+       $descr = substr($descr, 0, 60);
+       begin_transaction(__FUNCTION__, func_get_args());
 
        $date = date2sql($trans_date);
        $sql = "INSERT INTO ".TB_PREF."audit_trail"
@@ -26,7 +27,7 @@ function add_audit_trail($trans_type, $trans_no, $trans_date, $descr='')
        // to avoid need for subqueries (not existing in MySQL 3) all over the code
        $sql = "UPDATE ".TB_PREF."audit_trail audit LEFT JOIN ".TB_PREF."fiscal_year year ON year.begin<='$date' AND year.end>='$date'
                SET audit.gl_seq = IF(audit.id=".db_insert_id().", 0, NULL),"
-               ."audit.fiscal_year=year.id, stamp=CURRENT_TIMESTAMP"
+               ."audit.fiscal_year=year.id"
                . " WHERE type=".db_escape($trans_type)." AND trans_no="
                . db_escape($trans_no);
 
@@ -62,7 +63,7 @@ function get_audit_trail_last($trans_type, $trans_no)
 */
 function close_transactions($todate) {
 
-       begin_transaction();
+       begin_transaction(__FUNCTION__, func_get_args());
 
        $errors = 0;
        // select only those audit trail records which produce any GL postings