Feature. Add Supplier Invoice Menu after Supplier Payment. Fixed.
[fa-stable.git] / includes / db / audit_trail_db.inc
index feb85a991f744b6ed3facf54fd4fffaff18d7964..79061e18be97a78c6564ab01f140b4637180702f 100644 (file)
@@ -12,6 +12,7 @@
 
 function add_audit_trail($trans_type, $trans_no, $trans_date, $descr='')
 {
+       $descr = substr($descr, 0, 60);
        begin_transaction();
 
        $date = date2sql($trans_date);
@@ -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);
 
@@ -124,7 +125,7 @@ function get_journal_number($type, $trans_no) {
        if (db_num_rows($res))
        {
                $myrow =db_fetch($res);
-               return $myrow['gl_seq'] ? $myrow['gl_seq'] : _('None');
+               return $myrow['gl_seq'] ? $myrow['gl_seq'] : 0;
        }
        return "-";
 }