<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Prevent Duplicate Suppliers Short Name]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7677&amp;type=atom" />
	<updated>2018-09-07T16:56:34Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7677</id>
		<entry>
			<title type="html"><![CDATA[Re: Prevent Duplicate Suppliers Short Name]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32625#p32625" />
			<content type="html"><![CDATA[<p>This can be implemented in FA 2.4 itself as it only affects one small index. FA 2.5 is certainly years away and such important db changes should not be delayed. Remember how long FA 2.4 was in the making.....</p><p>The code changes however, are independent of the index.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-09-07T16:56:34Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32625#p32625</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Prevent Duplicate Suppliers Short Name]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32621#p32621" />
			<content type="html"><![CDATA[<p>Yes, but we can&#039;t fix the db change during 2.4.X.</p><p>Can it be used without the db change?</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2018-09-07T16:25:51Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32621#p32621</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Prevent Duplicate Suppliers Short Name]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32619#p32619" />
			<content type="html"><![CDATA[<p>@joe: nice fix?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-09-07T15:52:52Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32619#p32619</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Prevent Duplicate Suppliers Short Name]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32618#p32618" />
			<content type="html"><![CDATA[<p>Yes:</p><p>add this function to <strong>supplier_db.inc</strong><br /></p><div class="codebox"><pre><code>function duplicated_supplier_short_name($name, $id) {
    return check_empty_result(&quot;SELECT COUNT(*) FROM &quot;.TB_PREF.&quot;suppliers WHERE supp_ref = &quot;.db_escape($name).&quot; AND supplier_id != &quot;.db_escape($id));
}</code></pre></div><br /><p>add this check to submit handle (line 210) of <strong>suppliers.php</strong><br /></p><div class="codebox"><pre><code>if (duplicated_supplier_short_name($_POST[&#039;supp_ref&#039;], $supplier_id))  {
        $input_error = 1;
        display_error(_(&#039;Duplicate supplier short name found.&#039;));
        set_focus(&#039;supp_ref&#039;);
    }</code></pre></div><p>and change <strong>KEY `supp_ref` (`supp_ref`)</strong> to <strong>UNIQUE KEY `supp_ref` (`supp_ref`)</strong>&nbsp; in the <strong>suppliers</strong> table in the two sql scripts</p>]]></content>
			<author>
				<name><![CDATA[notrinos]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=36772</uri>
			</author>
			<updated>2018-09-07T11:40:56Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32618#p32618</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Prevent Duplicate Suppliers Short Name]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32526#p32526" />
			<content type="html"><![CDATA[<p>Is there any other js / ajax / php check for such duplicates in the Customer Short Name scripts that needs to be put in for the Supplier scripts as well apart from the unique key?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-08-23T19:28:10Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32526#p32526</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Prevent Duplicate Suppliers Short Name]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32523#p32523" />
			<content type="html"><![CDATA[<p>Currently Customer Short Name does not allow duplicates, this is good when we use short names as codes<br />But Suppliers Short Name is allowing duplicate, it is confusing to choose duplicated values from Suppliers List.</p><p>Should we add unique key for field <strong>supp_ref</strong> in table suppliers ?</p>]]></content>
			<author>
				<name><![CDATA[notrinos]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=36772</uri>
			</author>
			<updated>2018-08-23T16:42:55Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32523#p32523</id>
		</entry>
</feed>
