Topic: Journal Inquiry NULL fix
In the Journal Inquiry page, the db_pager.inc seems to grey out (disable) the First Prev Next Last page links since it is unable to get the total number of records using COUNT(DISTINCT(CONCAT group_by_clause)). This is because, the a.gl_seq field is NULL in many records by design (thanks to an archaic MySQL 3 workaround for lack of subqueries - see includes/db/audit_trail_db.inc first function).
The following patch will fix it:
--- gl/includes/db/gl_db_trans.inc Sat Apr 04 01:10:00 2015
+++ gl/includes/db/gl_db_trans.inc Fri Apr 10 21:58:56 2015
@@ -637,7 +637,7 @@
if (!$alsoclosed) {
$sql .= " AND gl_seq=0";
}
- $sql .= " GROUP BY gl.tran_date, a.gl_seq, gl.type, gl.type_no";
+ $sql .= " GROUP BY gl.tran_date, IF(ISNULL(a.gl_seq),0,a.gl_seq), gl.type, gl.type_no";
return $sql;
}
?>
\ No newline at end of file
The IF(ISNULL(... construct can be replaced in all places in the file with COALESCE(a.gl_seq,0)