<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Active/Inactive bank]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=3917</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=3917&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Active/Inactive bank.]]></description>
		<lastBuildDate>Wed, 06 Mar 2013 16:24:07 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Active/Inactive bank]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15920#p15920</link>
			<description><![CDATA[<p>Hi Joe</p><p>The fix has solve the bug.</p><p>Thanks</p>]]></description>
			<author><![CDATA[null@example.com (dvarsani)]]></author>
			<pubDate>Wed, 06 Mar 2013 16:24:07 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15920#p15920</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active/Inactive bank]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15916#p15916</link>
			<description><![CDATA[<p>The cast fix is rather from Janusz <img src="https://frontaccounting.com/punbb/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Wed, 06 Mar 2013 15:02:54 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15916#p15916</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active/Inactive bank]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15911#p15911</link>
			<description><![CDATA[<p>Thanks Joe. <a href="https://frontaccounting.hg.sourceforge.net/hgweb/frontaccounting/frontaccounting/rev/6dcb53cc88df">HG 3196</a> fixes it. Your cast fix is elegant:<br /></p><div class="codebox"><pre><code>$sql = &quot;UPDATE &quot;.TB_PREF.$table.&quot; SET inactive = &quot;
        . ((int)$status).&quot; WHERE $key=&quot;.db_escape($id);</code></pre></div><p>The list of tables and fields that have a non integer primary key or multiple keys and having field name &quot;inactive&quot; are:<br /></p><div class="quotebox"><blockquote><p><strong>Table Name&nbsp; &nbsp; &nbsp; Primary Key&nbsp; &nbsp; &nbsp; Field Type</strong><br />chart_class&nbsp; &nbsp; &nbsp; cid&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;varchar(3)<br />chart_master&nbsp; &nbsp;account_code&nbsp; &nbsp; varchar(15)<br />chart_types&nbsp; &nbsp; &nbsp;id&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar(10)<br />currencies&nbsp; &nbsp; &nbsp; &nbsp; curr_abbrev&nbsp; &nbsp; &nbsp; char(3)<br />item_units&nbsp; &nbsp; &nbsp; &nbsp;abbr&nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar(20)<br />locations&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loc_code&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;varchar(5)<br />stock_master&nbsp; &nbsp;stock_id&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; varchar(20)</p><p>cust_branch&nbsp; &nbsp; &nbsp;branch_code, debtor_no&nbsp; &nbsp; &nbsp; &nbsp;int(11), int(11)</p></blockquote></div><p>It is the last one above that is worrisome as the function used assumes a single primary key only. Kindly test what happens when same debtor is in multiple branches (or multiple debtors for same branch) and it is sought to make inactive a certain branch_code/debtor_no combination only.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 06 Mar 2013 11:22:49 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15911#p15911</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active/Inactive bank]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15908#p15908</link>
			<description><![CDATA[<p>Hello guys,</p><p>Yes, certain releases of MySql don&#039;t like this.</p><p>This has now been fixed in file sql_functions.inc. Please download and replace on your server.</p><p>HG repository updated.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Tue, 05 Mar 2013 22:36:42 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15908#p15908</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active/Inactive bank]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15904#p15904</link>
			<description><![CDATA[<p>Hi</p><p>after updating the .inc file, I am now getting this error</p><p>DATABASE ERROR : Can&#039;t update record status<br />error code : 1064<br />error message : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;0 WHERE id=&#039;6&#039;&#039; at line 1<br />sql that failed was : 0 WHERE id=&#039;6&#039;</p>]]></description>
			<author><![CDATA[null@example.com (dvarsani)]]></author>
			<pubDate>Tue, 05 Mar 2013 17:29:16 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15904#p15904</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active/Inactive bank]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15902#p15902</link>
			<description><![CDATA[<p>Roles and Permissions issue?<br />Should the statement be to set <strong>inactive=0</strong> instead of <strong>inactive=&#039;&#039;</strong>?</p><p>Offending code is at lines 56-61 in <strong>includes/db/sql_functions.inc</strong>:<br /></p><div class="codebox"><pre><code>function update_record_status($id, $status, $table, $key) {
    $sql = &quot;UPDATE &quot;.TB_PREF.$table.&quot; SET inactive = &quot;
        . db_escape($status).&quot; WHERE $key=&quot;.db_escape($id);
        
      db_query($sql, &quot;Can&#039;t update record status&quot;);
}</code></pre></div><p>Beware of legacy issues of if and when the column changed to be integer and whether all such tables have the same field type for field name <strong>inactive</strong>.</p><p>There are a total of 31 tables having <strong>inactive tinyint(1)</strong> and none having a field name of <strong>inactive</strong> with any other field type. Extensions are another matter though and whether they use this function here is also to be checked especially if they are not tinyint(1) or any int() for that matter.</p><p>Therefore it can be safely be changed to:<br /></p><div class="codebox"><pre><code>function update_record_status($id, $status, $table, $key) {
    $sql = &quot;UPDATE &quot;.TB_PREF.$table.&quot; SET inactive = &quot; . $status+0
                . &quot; WHERE $key=&quot;.db_escape($id);
        
      db_query($sql, &quot;Can&#039;t update record status&quot;);
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Tue, 05 Mar 2013 15:09:59 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15902#p15902</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active/Inactive bank]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15893#p15893</link>
			<description><![CDATA[<p>I am using 2.3.15</p>]]></description>
			<author><![CDATA[null@example.com (dvarsani)]]></author>
			<pubDate>Tue, 05 Mar 2013 11:42:02 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15893#p15893</guid>
		</item>
		<item>
			<title><![CDATA[Re: Active/Inactive bank]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15891#p15891</link>
			<description><![CDATA[<p>No problem here. Which version are you using? I tested with v 2.3.15.</p>]]></description>
			<author><![CDATA[null@example.com (doitashimashite)]]></author>
			<pubDate>Tue, 05 Mar 2013 10:59:17 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15891#p15891</guid>
		</item>
		<item>
			<title><![CDATA[Active/Inactive bank]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=15889#p15889</link>
			<description><![CDATA[<p>There is a bug on bank accounts. When I untick inactive box I am getting this error. I am also getting this type when I make taxes active from inactive status.</p><p>DATABASE ERROR : Can&#039;t update record status<br />error code : 1366<br />error message : Incorrect integer value: &#039;&#039; for column &#039;inactive&#039; at row 1<br />sql that failed was : UPDATE 0_bank_accounts SET inactive = &#039;&#039; WHERE id=&#039;6&#039;</p>]]></description>
			<author><![CDATA[null@example.com (dvarsani)]]></author>
			<pubDate>Tue, 05 Mar 2013 10:40:41 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=15889#p15889</guid>
		</item>
	</channel>
</rss>
