<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Problem with Manufacturing  Auto Increment reference is not working]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5750&amp;type=atom" />
	<updated>2015-09-18T05:37:13Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=5750</id>
		<entry>
			<title type="html"><![CDATA[Re: Problem with Manufacturing  Auto Increment reference is not working]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=24309#p24309" />
			<content type="html"><![CDATA[<p>The <strong><em>function </em>save_next_reference</strong> defined in <strong>includes/db/references_db.inc</strong> just saves the given reference to the table <span class="bbu">without any increment</span> using:<br /></p><div class="codebox"><pre><code>function save_next_reference($type, $reference)
{
    $sql = &quot;UPDATE &quot;.TB_PREF.&quot;sys_types SET next_reference=&quot; . db_escape(trim($reference)) 
        . &quot; WHERE type_id = &quot;.db_escape($type);

    db_query($sql, &quot;The next transaction ref for $type could not be updated&quot;);
}</code></pre></div><p>The above function is called from <strong>admin/forms_setup.php</strong> to post the form variables<span class="bbu"> just as is</span> into the <strong>sys_types</strong> table.</p><p>The file <strong>includes/references.inc</strong> has defined the (class references) methods <strong>save()</strong> and <strong>restore_last()</strong> which <span class="bbu">first increment or decrement</span> and then call the above function.</p><p>Hence in the file <strong>@kvvaradha</strong> referred to - <strong>manufacturing/includes/db/work_order<span style="color: red">s</span>_db.inc</strong> - the <strong>save()</strong> method does not need any increment in the argument.</p><p>Furthermore, the <a href="https://github.com/apmuthu/frontaccounting/tree/master/extensions/Extensions/import_transactions">import_transactions</a> extension has a redundant line 250 in <a href="https://github.com/apmuthu/frontaccounting/blob/master/extensions/Extensions/import_transactions/import_transactions.php#L250">modules/import_transactions/import_transactions.php</a><br /></p><div class="codebox"><pre><code>           save_next_reference($type, $reference);</code></pre></div><p>Hence nothing needs to be done in the FA codebase for now.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2015-09-18T05:37:13Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=24309#p24309</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem with Manufacturing  Auto Increment reference is not working]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=24307#p24307" />
			<content type="html"><![CDATA[<p>Hi <br />Sorry for the delayed response. </p><p>Actually there is a function to save next reference number on tAble.&nbsp; Which will be brought to use automatically&nbsp; for the next work order.&nbsp; Here the function is missed to&nbsp; configure.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2015-09-18T00:35:54Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=24307#p24307</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem with Manufacturing  Auto Increment reference is not working]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=23580#p23580" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>I had problem with the&nbsp; Work order auto next reference.</p></blockquote></div><p>What was the exact problem you tried to solve?</p><p>Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2015-05-22T09:51:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=23580#p23580</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Problem with Manufacturing  Auto Increment reference is not working]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=23575#p23575" />
			<content type="html"><![CDATA[<p>@joe: include into core?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2015-05-22T02:06:18Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=23575#p23575</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Problem with Manufacturing  Auto Increment reference is not working]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=23567#p23567" />
			<content type="html"><![CDATA[<p>hi, </p><p>I had problem with the&nbsp; Work order auto next reference . So i discovered a solution myself. It may be useful to someone.</p><p>open your work_order_db.inc&nbsp; &nbsp;and find the function &quot;add_work_order&quot; . Here you can see the function like this</p><br /><br /><p>$Refs-&gt;save(ST_WORKORDER, $woid, $wo_ref);</p><p>just replace with the follwing code. </p><br /><p>save_next_reference(ST_WORKORDER, $wo_ref+1);</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2015-05-21T11:23:22Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=23567#p23567</id>
		</entry>
</feed>
