<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Closing a fiscal year needs to update the query a bit.]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7666&amp;type=atom" />
	<updated>2018-08-26T15:14:00Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7666</id>
		<entry>
			<title type="html"><![CDATA[Re: Closing a fiscal year needs to update the query a bit.]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32535#p32535" />
			<content type="html"><![CDATA[<p>No, not really. However in normal conditions the old code should work.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2018-08-26T15:14:00Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32535#p32535</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Closing a fiscal year needs to update the query a bit.]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32534#p32534" />
			<content type="html"><![CDATA[<p>@joe: any developments?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-08-26T11:05:53Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32534#p32534</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Closing a fiscal year needs to update the query a bit.]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32495#p32495" />
			<content type="html"><![CDATA[<p>Ok, let me investigate this a little more.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2018-08-18T13:58:59Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32495#p32495</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Closing a fiscal year needs to update the query a bit.]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32494#p32494" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>joe wrote:</cite><blockquote><p>But isn&#039;t the voided entries all set to 0 amounts? So in my eyes this is a redundant change, right?</p><p>Joe</p></blockquote></div><p>I guess you are right. But one of a FA user asked to check it,when he closes the fiscal year. he had some voided balance included in the balance. His version is 2.4.3.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2018-08-18T12:11:03Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32494#p32494</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Closing a fiscal year needs to update the query a bit.]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32492#p32492" />
			<content type="html"><![CDATA[<p>But isn&#039;t the voided entries all set to 0 amounts? So in my eyes this is a redundant change, right?</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2018-08-18T06:26:49Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32492#p32492</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Closing a fiscal year needs to update the query a bit.]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32491#p32491" />
			<content type="html"><![CDATA[<p>@kvvaradha: Since you are making a LEFT JOIN for the voided entries, there could be many null voided entries in the result set that would have the <strong>v.date_</strong> field as NULL anyway!</p><p>@joe: can polish it up and check and include it if needed.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-08-17T16:05:35Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32491#p32491</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Closing a fiscal year needs to update the query a bit.]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32486#p32486" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>rafat wrote:</cite><blockquote><p>Which file is this in?</p></blockquote></div><p>Fiscal years db file. The fiscal year close function</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2018-08-17T02:28:22Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32486#p32486</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Closing a fiscal year needs to update the query a bit.]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32482#p32482" />
			<content type="html"><![CDATA[<p>@rafat, numerous text editors have search in file functionality(Notepad++ for one), and it takes seconds to carry out</p>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2018-08-16T14:30:01Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32482#p32482</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Closing a fiscal year needs to update the query a bit.]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32481#p32481" />
			<content type="html"><![CDATA[<p>Which file is this in?</p>]]></content>
			<author>
				<name><![CDATA[rafat]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41964</uri>
			</author>
			<updated>2018-08-16T14:15:43Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32481#p32481</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Closing a fiscal year needs to update the query a bit.]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=32479#p32479" />
			<content type="html"><![CDATA[<p>The fiscal year close needs to change the query to get the amount.</p><p>It was now like this.</p><div class="codebox"><pre><code>// retrieve total balances from balance sheet accounts
    $sql = &quot;SELECT SUM(amount) FROM &quot;.TB_PREF.&quot;gl_trans INNER JOIN &quot;.TB_PREF.&quot;chart_master ON account=account_code
        INNER JOIN &quot;.TB_PREF.&quot;chart_types ON account_type=id INNER JOIN &quot;.TB_PREF.&quot;chart_class ON class_id=cid 
        WHERE ctype&gt;=&quot;.CL_ASSETS.&quot; AND ctype &lt;=&quot;.CL_EQUITY.&quot; AND tran_date &lt;= &#039;$to&#039;&quot;;</code></pre></div><p>And it should be like this </p><div class="codebox"><pre><code>// retrieve total balances from balance sheet accounts        
        $sql = &quot;SELECT SUM(amount) FROM &quot;.TB_PREF.&quot;gl_trans trans LEFT JOIN &quot;.TB_PREF.&quot;voided v ON trans.type_no=v.id AND v.type=trans.type INNER JOIN &quot;.TB_PREF.&quot;chart_master ON account=account_code
        INNER JOIN &quot;.TB_PREF.&quot;chart_types types ON account_type=types.id INNER JOIN &quot;.TB_PREF.&quot;chart_class ON class_id=cid WHERE ctype&gt;=&quot;.CL_ASSETS.&quot; AND ctype &lt;=&quot;.CL_EQUITY.&quot; AND tran_date &lt;= &#039;$to&#039; AND ISNULL(v.date_)&quot;;</code></pre></div><p>I think we missed to check voided transactions before getting results.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2018-08-16T09:53:55Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=32479#p32479</id>
		</entry>
</feed>
