<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Journal Inquiry NULL fix]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5694&amp;type=atom" />
	<updated>2015-04-11T20:18:41Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=5694</id>
		<entry>
			<title type="html"><![CDATA[Re: Journal Inquiry NULL fix]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=23234#p23234" />
			<content type="html"><![CDATA[<p>This issue has now been fixed in the db_pager.inc file itself using a subquery and hence above fix is not needed. It has been <a href="https://github.com/FrontAccountingERP/FA/commit/8d0b87e3e7dcf325fd55fe5f8c6fb3b8b45ffaa1">committed in the Official GitHub Mirror</a>.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2015-04-11T20:18:41Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=23234#p23234</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Journal Inquiry NULL fix]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=23222#p23222" />
			<content type="html"><![CDATA[<p>In the Journal Inquiry page, the <strong>db_pager.inc</strong> seems to grey out (disable) the <strong>First Prev Next Last</strong> page links since it is unable to get the total number of records using <strong>COUNT(DISTINCT(CONCAT group_by_clause))</strong>. This is because, the <strong>a.gl_seq</strong> field is NULL in many records by design (thanks to an archaic MySQL 3 workaround for lack of subqueries - see <strong>includes/db/audit_trail_db.inc</strong> first function).</p><p>The following patch will fix it:</p><div class="codebox"><pre><code>--- 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 .= &quot; AND gl_seq=0&quot;;
     }
-    $sql .= &quot; GROUP BY gl.tran_date, a.gl_seq, gl.type, gl.type_no&quot;;
+    $sql .= &quot; GROUP BY gl.tran_date, IF(ISNULL(a.gl_seq),0,a.gl_seq), gl.type, gl.type_no&quot;;
     return $sql;
 }
 ?&gt;
\ No newline at end of file</code></pre></div><p>The <strong>IF(ISNULL(...</strong> construct can be replaced in all places in the file with <strong>COALESCE(a.gl_seq,0)</strong></p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2015-04-10T16:45:36Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=23222#p23222</id>
		</entry>
</feed>
