<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Stock goes negative even, the negative inventory is turned off]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7605</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7605&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Stock goes negative even, the negative inventory is turned off.]]></description>
		<lastBuildDate>Thu, 12 Jul 2018 04:29:44 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Stock goes negative even, the negative inventory is turned off]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32184#p32184</link>
			<description><![CDATA[<p>That&#039;s perfect.</p>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Thu, 12 Jul 2018 04:29:44 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32184#p32184</guid>
		</item>
		<item>
			<title><![CDATA[Re: Stock goes negative even, the negative inventory is turned off]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32177#p32177</link>
			<description><![CDATA[<p>Ok, this was fixed tonight and committed to stable.</p><p>You can download a fixed file <a href="https://sourceforge.net/p/frontaccounting/git/ci/master/tree/admin/void_transaction.php">here</a></p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Wed, 11 Jul 2018 21:40:21 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32177#p32177</guid>
		</item>
		<item>
			<title><![CDATA[Re: Stock goes negative even, the negative inventory is turned off]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32176#p32176</link>
			<description><![CDATA[<p>@kvvaradha</p><p>Yes, I will have a look at this and be back tomorrow.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Wed, 11 Jul 2018 19:19:23 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32176#p32176</guid>
		</item>
		<item>
			<title><![CDATA[Re: Stock goes negative even, the negative inventory is turned off]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32173#p32173</link>
			<description><![CDATA[<p>@joe can you check this <a href="https://github.com/kvcodes/FA/commit/47cfe6da0b3d9a5014abad16dcaac51c9d5e5ecc"> issue</a> and fix it.</p>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Wed, 11 Jul 2018 14:06:43 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32173#p32173</guid>
		</item>
		<item>
			<title><![CDATA[Re: Stock goes negative even, the negative inventory is turned off]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32069#p32069</link>
			<description><![CDATA[<p>Also i forget to write it. Even if we void the supplier invoice and we can able to void the GRN.</p>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Tue, 03 Jul 2018 14:48:18 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32069#p32069</guid>
		</item>
		<item>
			<title><![CDATA[Stock goes negative even, the negative inventory is turned off]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32068#p32068</link>
			<description><![CDATA[<p>Yes,&nbsp; I found an issue with Voiding Transaction. Let me explain the case.&nbsp; &nbsp;I am just placing an direct GRN to receive 10 quantity of an item.&nbsp; And I didn&#039;t make supplier invoice yet. </p><p>Than i made a sales of 5 quantity for the same item and now the stock balance is 5 quantity.&nbsp; Now I am voiding the Direct GRN. </p><p>Actually the system has to stop me from voiding this Direct GRN. But it allows me to void the GRN. and stock goes to negative. </p><p>Also I found solution for this problem. </p><div class="codebox"><pre><code>if (!exist_transaction($_POST[&#039;filterType&#039;],$_POST[&#039;trans_no&#039;]))
        {
            display_error(_(&quot;The entered transaction does not exist or cannot be voided.&quot;));
            unset($_POST[&#039;trans_no&#039;]);
            unset($_POST[&#039;memo_&#039;]);
            unset($_POST[&#039;date_&#039;]);
            submit_center(&#039;ProcessVoiding&#039;, _(&quot;Void Transaction&quot;), true, &#039;&#039;, &#039;default&#039;);
        }
        else
        {
            display_warning(_(&quot;Are you sure you want to void this transaction ? This action cannot be undone.&quot;), 0, 1);
            br();
            submit_center_first(&#039;ConfirmVoiding&#039;, _(&quot;Proceed&quot;), &#039;&#039;, true);
            submit_center_last(&#039;CancelVoiding&#039;, _(&quot;Cancel&quot;), &#039;&#039;, &#039;cancel&#039;);
        }</code></pre></div><p>This is default code. If we change it to be like this.</p><div class="codebox"><pre><code> if (!exist_transaction($_POST[&#039;filterType&#039;],$_POST[&#039;trans_no&#039;]))
        {
            display_error(_(&quot;The entered transaction does not exist or cannot be voided.&quot;));
            unset($_POST[&#039;trans_no&#039;]);
            unset($_POST[&#039;memo_&#039;]);
            unset($_POST[&#039;date_&#039;]);
            submit_center(&#039;ProcessVoiding&#039;, _(&quot;Void Transaction&quot;), true, &#039;&#039;, &#039;default&#039;);
        }   else     {
            if($_POST[&#039;filterType&#039;] == ST_SUPPRECEIVE){ 
                $result = get_grn_items($_POST[&#039;trans_no&#039;]);
                 if (db_num_rows($result) &gt; 0)   {
                    while ($myrow = db_fetch($result))        {
                        if (is_inventory_item($myrow[&quot;item_code&quot;]))    {
                            if (check_negative_stock($myrow[&quot;item_code&quot;], -$myrow[&quot;qty_recd&quot;], null, $_POST[&#039;date_&#039;]))    {
                                $stock = get_item($myrow[&quot;item_code&quot;]);
                                display_error(_(&quot;The void cannot be processed because there is an insufficient quantity for item:&quot;) .
                                    &quot; &quot; . $stock[&#039;stock_id&#039;] . &quot; - &quot; . $stock[&#039;description&#039;] . &quot; - &quot; .
                                    _(&quot;Quantity On Hand&quot;) . &quot; = &quot; . number_format2(get_qoh_on_date($stock[&#039;stock_id&#039;], null, 
                                    $_POST[&#039;date_&#039;]), get_qty_dec($stock[&#039;stock_id&#039;])));
                                return false;
                            }
                        }
                    }
                }
            }
            display_warning(_(&quot;Are you sure you want to void this transaction ? This action cannot be undone.&quot;), 0, 1);
            br();
            submit_center_first(&#039;ConfirmVoiding&#039;, _(&quot;Proceed&quot;), &#039;&#039;, true);
            submit_center_last(&#039;CancelVoiding&#039;, _(&quot;Cancel&quot;), &#039;&#039;, &#039;cancel&#039;);
        }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Tue, 03 Jul 2018 14:46:22 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32068#p32068</guid>
		</item>
	</channel>
</rss>
