<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — sales_order_ui.inc has a bug]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7966&amp;type=atom" />
	<updated>2019-04-23T03:25:28Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7966</id>
		<entry>
			<title type="html"><![CDATA[Re: sales_order_ui.inc has a bug]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34793#p34793" />
			<content type="html"><![CDATA[<p>For me it works fine.&nbsp; If you&nbsp; face problem with this. find a better solution for it. we will adapt to your solutions.&nbsp; I tested it on Linux and Windows.&nbsp; Both works fine for me</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2019-04-23T03:25:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34793#p34793</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: sales_order_ui.inc has a bug]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34790#p34790" />
			<content type="html"><![CDATA[<p>The new code works for now.<br />More testing is needed to check for edge conditions stated above.</p><p>I had to set config.php variable &quot;$no_check_edit_conflicts = 1;&quot; in windows for it to work though - it did not work for earlier commits.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2019-04-22T17:58:01Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34790#p34790</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: sales_order_ui.inc has a bug]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34789#p34789" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>!isset($_POST[&#039;stock_id&#039;])</code></pre></div><p>does not necessarily mean that the stock_id does not exist - it merely states that it was not chosen in the $_POST variable.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2019-04-22T17:50:09Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34789#p34789</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: sales_order_ui.inc has a bug]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34785#p34785" />
			<content type="html"><![CDATA[<p>Ok, thanks @kvvaradha.</p><p>Committed and a new file <a href="https://sourceforge.net/p/frontaccounting/git/ci/master/tree/sales/includes/ui/sales_order_ui.inc">here</a>.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2019-04-22T08:11:53Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34785#p34785</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: sales_order_ui.inc has a bug]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34779#p34779" />
			<content type="html"><![CDATA[<p>@joe, Yes you are right.</p><p>As like @Apmuthu words, it rolls back to the last item sold to the customer. we are not able to change the item to sell. But we can try this option.it may be fessible to work on.</p><p>We will put an if condition, if the stock_id is not exist, we can get the last_sales_order_detail,like this, here is code<br /></p><div class="codebox"><pre><code>if ($order-&gt;fixed_asset)
            stock_disposable_fa_list_cells(null,&#039;stock_id&#039;, null, _(&#039;[Select item]&#039;), true, $order-&gt;line_items);
        else{
            if(!isset($_POST[&#039;stock_id&#039;])){   // Check the stock id not exist
            $_POST[&#039;stock_id&#039;] = last_sales_order_detail($order, &#039;stk_code&#039;);  //get the llast sales stock id.
        }
             sales_items_list_cells(null,&#039;stock_id&#039;, last_sales_order_detail($order, &#039;stk_code&#039;), false, true, true);
        }
        if (list_updated(&#039;stock_id&#039;)) {            
            $Ajax-&gt;activate(&#039;price&#039;);
            $Ajax-&gt;activate(&#039;units&#039;);
            $Ajax-&gt;activate(&#039;qty&#039;);
            $Ajax-&gt;activate(&#039;line_total&#039;);
        }</code></pre></div><p>Hope this may be fixed the problem.</p><p>if not, we remove the function from sales_order_d.inc <strong>last_sales_order_detail</strong>. It was defined there. and keep the sales item list cells like this<br /></p><div class="codebox"><pre><code>sales_items_list_cells(null,&#039;stock_id&#039;, null, false, true, true);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2019-04-22T05:22:15Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34779#p34779</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: sales_order_ui.inc has a bug]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34778#p34778" />
			<content type="html"><![CDATA[<p>@kvvaradha.</p><p>Did you mean that it was ok to change the<br /></p><div class="codebox"><pre><code>line 505 in /sales/includes/ui/sales_order_ui.inc 
from:
            sales_items_list_cells(null,&#039;stock_id&#039;, last_sales_order_detail($order, &#039;stk_code&#039;), false, true, true);
to:
            sales_items_list_cells(null,&#039;stock_id&#039;, null, false, true, true);</code></pre></div><p>?</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2019-04-21T20:57:04Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34778#p34778</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: sales_order_ui.inc has a bug]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34766#p34766" />
			<content type="html"><![CDATA[<p>@kvvaradha: Your Post #3 is the same as your post #7 which has been incorporated in <a href="https://github.com/FrontAccountingERP/FA/commit/85adfd5e202218a984ef5e1b64197472e0a2ccac">this official commit</a> which is what I would like to revert and <a href="https://github.com/apmuthu/frontac24/commit/d24fc30ad235da23a59a36504ab3b37a2071e9b5">make it as per my commit</a>.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2019-04-21T12:05:19Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34766#p34766</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: sales_order_ui.inc has a bug]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34764#p34764" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>kvvaradha wrote:</cite><blockquote><p>@joe ,sorry for my mistake.</p><p>the code should be like this.</p><div class="codebox"><pre><code>if ($order-&gt;fixed_asset)
            stock_disposable_fa_list_cells(null,&#039;stock_id&#039;, null, _(&#039;[Select item]&#039;), true, $order-&gt;line_items);
        else
             sales_items_list_cells(null,&#039;stock_id&#039;, last_sales_order_detail($order, &#039;stk_code&#039;), false, true, true);
        if (list_updated(&#039;stock_id&#039;)) {            
            $Ajax-&gt;activate(&#039;price&#039;);
            $Ajax-&gt;activate(&#039;units&#039;);
            $Ajax-&gt;activate(&#039;qty&#039;);
            $Ajax-&gt;activate(&#039;line_total&#039;);
        }
            </code></pre></div><p>By mistake i put in else part of list_updated.</p></blockquote></div><p> @joe - here I gave the same code exactly what he committed there. So you can update it.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2019-04-21T11:09:16Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34764#p34764</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: sales_order_ui.inc has a bug]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34754#p34754" />
			<content type="html"><![CDATA[<p>@kvvaradha</p><p>Please make a comment on this. Do you agree with @apmuthu?</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2019-04-20T15:35:43Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34754#p34754</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: sales_order_ui.inc has a bug]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34741#p34741" />
			<content type="html"><![CDATA[<p>Will need to revert <a href="https://github.com/FrontAccountingERP/FA/commit/85adfd5e202218a984ef5e1b64197472e0a2ccac">this commit</a> - see <a href="https://frontaccounting.com/punbb/viewtopic.php?id=8109">this post</a>.</p><p>What is the purpose of getting the <strong>last_sales_order_detail() field</strong> (in this case, &#039;stk_code&#039; which is the stock_id)? Byusing this commit, we are making the default choice of the Item description select box override the actual selection made in it. Should this be restricted to only those with editable description alone if used at all?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2019-04-20T09:57:55Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34741#p34741</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: sales_order_ui.inc has a bug]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34080#p34080" />
			<content type="html"><![CDATA[<p>Ok, @kvvaradha <img src="https://frontaccounting.com/punbb/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Fixed and a new file can be downloaded <a href="https://sourceforge.net/p/frontaccounting/git/ci/master/tree/sales/includes/ui/sales_order_ui.inc">here</a>.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2019-01-25T09:27:25Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34080#p34080</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: sales_order_ui.inc has a bug]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34077#p34077" />
			<content type="html"><![CDATA[<p>@joe ,sorry for my mistake.</p><p>the code should be like this.</p><div class="codebox"><pre><code>if ($order-&gt;fixed_asset)
            stock_disposable_fa_list_cells(null,&#039;stock_id&#039;, null, _(&#039;[Select item]&#039;), true, $order-&gt;line_items);
        else
             sales_items_list_cells(null,&#039;stock_id&#039;, last_sales_order_detail($order, &#039;stk_code&#039;), false, true, true);
        if (list_updated(&#039;stock_id&#039;)) {            
            $Ajax-&gt;activate(&#039;price&#039;);
            $Ajax-&gt;activate(&#039;units&#039;);
            $Ajax-&gt;activate(&#039;qty&#039;);
            $Ajax-&gt;activate(&#039;line_total&#039;);
        }
            </code></pre></div><p>By mistake i put in else part of list_updated.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2019-01-25T05:19:47Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34077#p34077</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: sales_order_ui.inc has a bug]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34073#p34073" />
			<content type="html"><![CDATA[<p>Fixed and sent to repo. Thanks @kvvaradha.</p><p>The fixed file can be downloaded <a href="https://sourceforge.net/p/frontaccounting/git/ci/master/tree/sales/includes/ui/sales_order_ui.inc">here</a>.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2019-01-24T22:35:34Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34073#p34073</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[sales_order_ui.inc has a bug]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=34070#p34070" />
			<content type="html"><![CDATA[<p>it looks like this now.</p><div class="codebox"><pre><code> 
if ($order-&gt;fixed_asset)
            stock_disposable_fa_list_cells(null,&#039;stock_id&#039;, null, _(&#039;[Select item]&#039;), true, $order-&gt;line_items);
        else
        if (list_updated(&#039;stock_id&#039;)) {
            sales_items_list_cells(null,&#039;stock_id&#039;, null, false, true, true);
            $Ajax-&gt;activate(&#039;price&#039;);
            $Ajax-&gt;activate(&#039;units&#039;);
            $Ajax-&gt;activate(&#039;qty&#039;);
            $Ajax-&gt;activate(&#039;line_total&#039;);
        } else
             sales_items_list_cells(null,&#039;stock_id&#039;, last_sales_order_detail($order, &#039;stk_code&#039;), false, true, true);</code></pre></div><p>But it should be like this</p><div class="codebox"><pre><code>if ($order-&gt;fixed_asset)
            stock_disposable_fa_list_cells(null,&#039;stock_id&#039;, null, _(&#039;[Select item]&#039;), true, $order-&gt;line_items);
        else
            sales_items_list_cells(null,&#039;stock_id&#039;, null, false, true, true);
        if (list_updated(&#039;stock_id&#039;)) {            
            $Ajax-&gt;activate(&#039;price&#039;);
            $Ajax-&gt;activate(&#039;units&#039;);
            $Ajax-&gt;activate(&#039;qty&#039;);
            $Ajax-&gt;activate(&#039;line_total&#039;);
        } else
             sales_items_list_cells(null,&#039;stock_id&#039;, last_sales_order_detail($order, &#039;stk_code&#039;), false, true, true);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2019-01-24T19:05:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=34070#p34070</id>
		</entry>
</feed>
