<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Inventory planning report 2.4.3]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7311</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7311&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Inventory planning report 2.4.3.]]></description>
		<lastBuildDate>Mon, 05 Feb 2018 22:32:44 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Inventory planning report 2.4.3]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30727#p30727</link>
			<description><![CDATA[<p>Ah, now I see the problem. Of course it gives weird results using the move.stock_id value instead of move.qty <img src="https://frontaccounting.com/punbb/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Will be fixed asap and committed to 2.4. repo. Thanks for observing this.</p><p>/Joe</p><p><a href="https://github.com/FrontAccountingERP/FA/commit/2b58a999e31c48e47358d9c9e87b0f69849f029f">Committed</a></p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Mon, 05 Feb 2018 22:32:44 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30727#p30727</guid>
		</item>
		<item>
			<title><![CDATA[Re: Inventory planning report 2.4.3]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30726#p30726</link>
			<description><![CDATA[<p>Hello,</p><p>Strange, shouldn&#039;t IFNULL(move.stock_id, 0) give the same result as you suggest. I will investigate this.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Mon, 05 Feb 2018 22:19:28 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30726#p30726</guid>
		</item>
		<item>
			<title><![CDATA[Inventory planning report 2.4.3]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=30725#p30725</link>
			<description><![CDATA[<p>There&#039;s a small error in reporting/rep302.php in the first sql statement that causes the QOH column to show weird results.</p><p>I copied the similar statement from rep303.php with a change from QtyOnHand to qty_on_hand and that seems to correct the issue.</p><p>Here is the new code: </p><div class="codebox"><pre><code>function getTransactions($category, $location)
{
    $sql = &quot;SELECT item.category_id,
            category.description AS cat_description,
            item.stock_id, item.units,
            item.description, item.inactive,
            IF(move.stock_id IS NULL, &#039;&#039;, move.loc_code) AS loc_code,
            SUM(IF(move.stock_id IS NULL,0,move.qty)) AS qty_on_hand
        FROM (&quot;
            .TB_PREF.&quot;stock_master item,&quot;
            .TB_PREF.&quot;stock_category category)
            LEFT JOIN &quot;.TB_PREF.&quot;stock_moves move ON item.stock_id=move.stock_id
        WHERE item.category_id=category.category_id
        AND (item.mb_flag=&#039;B&#039; OR item.mb_flag=&#039;M&#039;)&quot;;
    if ($category != 0)
        $sql .= &quot; AND item.category_id = &quot;.db_escape($category);
    if ($location != &#039;all&#039;)
        $sql .= &quot; AND IF(move.stock_id IS NULL, &#039;1=1&#039;,move.loc_code = &quot;.db_escape($location).&quot;)&quot;;

    $sql .= &quot; GROUP BY item.category_id,
        category.description,
        item.stock_id,
        item.description
        ORDER BY item.category_id,
        item.stock_id&quot;;

    return db_query($sql,&quot;No transactions were returned&quot;);

}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (ckrosco)]]></author>
			<pubDate>Mon, 05 Feb 2018 21:08:27 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=30725#p30725</guid>
		</item>
	</channel>
</rss>
