<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Bug in gl/includes/db/gl_journal.inc]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=9410&amp;type=atom" />
	<updated>2021-08-11T16:06:33Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=9410</id>
		<entry>
			<title type="html"><![CDATA[Re: Bug in gl/includes/db/gl_journal.inc]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39837#p39837" />
			<content type="html"><![CDATA[<p>Actually the old query INSERT INTO table1 SELECT col.. FROM table2 is a right syntax.<br />But better to keep the new query because if the subquery SELECT return null the system will raise an error meanwhile the old query can run successfully even when the SELECT subquery returns null</p>]]></content>
			<author>
				<name><![CDATA[notrinos]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=36772</uri>
			</author>
			<updated>2021-08-11T16:06:33Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39837#p39837</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug in gl/includes/db/gl_journal.inc]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39825#p39825" />
			<content type="html"><![CDATA[<p>Yes, it is amazing that this bug is first detected now after so many minor releases.</p><p>Maybe because the entrance is mostly done by the Sales routines.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2021-08-08T15:46:24Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39825#p39825</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug in gl/includes/db/gl_journal.inc]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39824#p39824" />
			<content type="html"><![CDATA[<p>Thanks. U have checked this bug has persisted since at least 2.4.2 and it is quite critical because data entry via journal entry feature that relate to account receivable will write the cust_trans using this method and it will fail because the query is wrong.</p>]]></content>
			<author>
				<name><![CDATA[barbarian]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18954</uri>
			</author>
			<updated>2021-08-08T12:07:36Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39824#p39824</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug in gl/includes/db/gl_journal.inc]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39823#p39823" />
			<content type="html"><![CDATA[<p>This has been fixed and committed to stable repo. Thanks @barbarian for finding this.</p><p>A fixed copy can be downloaded and replaced.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2021-08-08T10:34:21Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39823#p39823</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug in gl/includes/db/gl_journal.inc]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39822#p39822" />
			<content type="html"><![CDATA[<p>@joe,<br />Can you update the code and commit it to stable version&nbsp; downloads.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2021-08-08T07:07:58Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39822#p39822</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug in gl/includes/db/gl_journal.inc]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39820#p39820" />
			<content type="html"><![CDATA[<p>Instead of</p><div class="codebox"><pre><code>$sql = &quot;INSERT INTO &quot;.TB_PREF.&quot;debtor_trans (trans_no, type, debtor_no, branch_code, tran_date, reference, ov_amount, rate)
        SELECT &quot;
        .db_escape($trans_no).&quot;, &quot;.db_escape($trans_type).&quot;, debtor_no,&quot;
        .db_escape($branch_id).&quot;,&#039;&quot;.date2sql($date).&quot;&#039;, &quot;.db_escape($ref).&quot;,&quot;
        .db_escape($amount).&quot;, &quot;.db_escape($rate).&quot;
        FROM &quot;.TB_PREF.&quot;cust_branch WHERE branch_code=&quot;.db_escape($branch_id);</code></pre></div><p>It should be</p><div class="codebox"><pre><code>$sql = &quot;INSERT INTO &quot;.TB_PREF.&quot;debtor_trans (trans_no, type, debtor_no, branch_code, tran_date, reference, ov_amount, rate)
        VALUES (&quot;
        .db_escape($trans_no).&quot;, &quot;.db_escape($trans_type).&quot;, (SELECT debtor_no FROM &quot;.TB_PREF.&quot;cust_branch WHERE branch_code=&quot;.db_escape($branch_id). &quot;) ,&quot;
        .db_escape($branch_id).&quot;,&#039;&quot;.date2sql($date).&quot;&#039;, &quot;.db_escape($ref).&quot;,&quot;
        .db_escape($amount).&quot;, &quot;.db_escape($rate).&quot;)&quot;;</code></pre></div><p>The sub query SELECT debtor_no ... result should bebecome the debtor_no column when inserting.</p>]]></content>
			<author>
				<name><![CDATA[barbarian]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18954</uri>
			</author>
			<updated>2021-08-07T23:18:00Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39820#p39820</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug in gl/includes/db/gl_journal.inc]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39819#p39819" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>barbarian wrote:</cite><blockquote><p>I found this incorrect sql query:</p><p><a href="https://i.imgur.com/YcYMfc3.png"> Screenshot </a></p></blockquote></div><p>The SQL Query is wrong. INSERT INTO .... SELECT FROM ...</p>]]></content>
			<author>
				<name><![CDATA[barbarian]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18954</uri>
			</author>
			<updated>2021-08-07T18:08:08Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39819#p39819</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Bug in gl/includes/db/gl_journal.inc]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39815#p39815" />
			<content type="html"><![CDATA[<p>Can you elaborate the issue in text?</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2021-08-07T14:58:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39815#p39815</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Bug in gl/includes/db/gl_journal.inc]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39814#p39814" />
			<content type="html"><![CDATA[<p>I found this incorrect sql query:</p><p><a href="https://i.imgur.com/YcYMfc3.png"> Screenshot </a></p>]]></content>
			<author>
				<name><![CDATA[barbarian]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18954</uri>
			</author>
			<updated>2021-08-07T14:22:01Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39814#p39814</id>
		</entry>
</feed>
