<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — A bug in Report Supplier Balances rep201.php]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=7663</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7663&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in A bug in Report Supplier Balances rep201.php.]]></description>
		<lastBuildDate>Wed, 22 Aug 2018 19:18:15 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: A bug in Report Supplier Balances rep201.php]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32518#p32518</link>
			<description><![CDATA[<p>Yes, I can verify</p>]]></description>
			<author><![CDATA[null@example.com (boxygen)]]></author>
			<pubDate>Wed, 22 Aug 2018 19:18:15 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32518#p32518</guid>
		</item>
		<item>
			<title><![CDATA[Re: A bug in Report Supplier Balances rep201.php]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32516#p32516</link>
			<description><![CDATA[<p><a href="https://github.com/FrontAccountingERP/FA/commit/d25e06f889d2c81871fcb6edb42e53e2ea316601">Committed</a>.<br />Kindly verify if the functionality is okay.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Wed, 22 Aug 2018 15:47:04 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32516#p32516</guid>
		</item>
		<item>
			<title><![CDATA[Re: A bug in Report Supplier Balances rep201.php]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32445#p32445</link>
			<description><![CDATA[<p>@boxygen</p><p>I am out of office until Friday. Will fix it then and commit. Thanks.</p><p>Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Mon, 13 Aug 2018 09:33:01 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32445#p32445</guid>
		</item>
		<item>
			<title><![CDATA[Re: A bug in Report Supplier Balances rep201.php]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32444#p32444</link>
			<description><![CDATA[<p>I copied the Logic from <strong>rep101.php</strong> and it worked.</p><div class="codebox"><pre><code>function get_open_balance($supplier_id, $to)
{
    if($to)
        $to = date2sql($to);

        $sql = &quot;SELECT SUM(IF(t.type = &quot;.ST_SUPPINVOICE.&quot; OR (t.type IN (&quot;.ST_JOURNAL.&quot; , &quot;.ST_BANKDEPOSIT.&quot;) AND t.ov_amount&gt;0),
                        -abs(t.ov_amount + t.ov_gst + t.ov_discount), 0)) AS charges,&quot;;

 $sql .= &quot;SUM(IF(t.type != &quot;.ST_SUPPINVOICE.&quot; AND NOT(t.type IN (&quot;.ST_JOURNAL.&quot; , &quot;.ST_BANKDEPOSIT.&quot;) AND t.ov_amount&gt;0),
                        abs(t.ov_amount + t.ov_gst + t.ov_discount) * -1, 0)) AS credits,&quot;;

     $sql .= &quot;SUM(IF(t.type != &quot;.ST_SUPPINVOICE.&quot; AND NOT(t.type IN (&quot;.ST_JOURNAL.&quot; , &quot;.ST_BANKDEPOSIT.&quot;)), t.alloc * -1, t.alloc)) AS Allocated,&quot;;

     $sql .=    &quot;SUM(IF(t.type = &quot;.ST_SUPPINVOICE.&quot;, 1, -1) *
             (abs(t.ov_amount + t.ov_gst + t.ov_discount) - abs(t.alloc))) AS OutStanding
        FROM &quot;.TB_PREF.&quot;supp_trans t
        WHERE t.supplier_id = &quot;.db_escape($supplier_id);
    if ($to)
        $sql .= &quot; AND t.tran_date &lt; &#039;$to&#039;&quot;;
    $sql .= &quot; GROUP BY supplier_id&quot;;

    $result = db_query($sql,&quot;No transactions were returned&quot;);
    return db_fetch($result);
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (boxygen)]]></author>
			<pubDate>Mon, 13 Aug 2018 08:41:46 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32444#p32444</guid>
		</item>
		<item>
			<title><![CDATA[A bug in Report Supplier Balances rep201.php]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=32443#p32443</link>
			<description><![CDATA[<p>I found a bug in Supplier Balances Report.</p><p>Check this <a href="https://www.dropbox.com/s/ofa1zn376mdl3xt/BugInSupplierBalances.png?dl=0">screen shot</a> of comparison. Opening Balance of the SUpplier was recorded on 30th June. When we query including 30th June the report shows value correctly under Charges Column But When we query from 1st July the Reports Shows the opening balance wrongly under Credits Column.</p><p>The reason is that the Opening Balance was entered through Journal Entry. and Journal Entry is not being checked in the <strong>get_open_balance()</strong> function in <strong>rep201.php</strong>.</p>]]></description>
			<author><![CDATA[null@example.com (boxygen)]]></author>
			<pubDate>Mon, 13 Aug 2018 08:00:56 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=32443#p32443</guid>
		</item>
	</channel>
</rss>
