<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Banking and GL - Tax Inquiry summation problem]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7087&amp;type=atom" />
	<updated>2017-10-31T14:43:58Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7087</id>
		<entry>
			<title type="html"><![CDATA[Re: Banking and GL - Tax Inquiry summation problem]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29376#p29376" />
			<content type="html"><![CDATA[<p>Use the GL Inquiry if you want Bank Payment and Deposit entries.<br />Use Tax Inquiry only for the Taxes alone.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-10-31T14:43:58Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29376#p29376</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Banking and GL - Tax Inquiry summation problem]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29374#p29374" />
			<content type="html"><![CDATA[<p>The Tax Inquiry and General Ledger Inquiry produce inconsistent results for taxes.&nbsp; General Ledger Inquiry results are correct while Tax Inquiry is omitting Bank Payment and Deposit type of transactions.</p>]]></content>
			<author>
				<name><![CDATA[andijani]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20111</uri>
			</author>
			<updated>2017-10-31T14:10:55Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29374#p29374</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Banking and GL - Tax Inquiry summation problem]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29357#p29357" />
			<content type="html"><![CDATA[<p>This is now fixed and Repo is <a href="https://github.com/FrontAccountingERP/FA/commit/ea3fd3b07585cbf1438ed587125e38051262819b">updated</a>.</p><p>/Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2017-10-31T09:00:35Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29357#p29357</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Banking and GL - Tax Inquiry summation problem]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29354#p29354" />
			<content type="html"><![CDATA[<p>The existing SQL to debug is:<br /></p><div class="codebox"><pre><code>SELECT 
    SUM(IF(trans_type=21,-1,1) *
    IF((reg_type=0) || ((trans_type IN (20,21) OR (trans_type=0 AND reg_type=1))
        ), net_amount*ex_rate,0)
    ) net_output

    , SUM(IF(trans_type=21,-1,1) *
    IF((reg_type=0) || ((trans_type IN (20,21) OR (trans_type=0 AND reg_type=1))
        ), amount*ex_rate,0)) payable

    , SUM(IF(trans_type IN (21),-1,1) *
    IF(reg_type=1 AND tax_type_id AND taxrec.rate, net_amount*ex_rate, 0)) net_input


    , SUM(IF(trans_type IN (21),-1,1) *
    IF(reg_type=1 AND tax_type_id AND taxrec.rate, amount*ex_rate, 0)) collectible,
    taxrec.rate,
    ttype.id,
    ttype.name

FROM 0_trans_tax_details taxrec LEFT JOIN 0_tax_types ttype ON taxrec.tax_type_id=ttype.id
WHERE taxrec.trans_type IN (10, 11, 20, 21, 0)
-- AND taxrec.tran_date &gt;= &#039;$fromdate&#039;
-- AND taxrec.tran_date &lt;= &#039;$todate&#039;
GROUP BY ttype.id;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-10-31T08:02:20Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29354#p29354</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Banking and GL - Tax Inquiry summation problem]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29350#p29350" />
			<content type="html"><![CDATA[<p>I am working on this. </p><p>The reason for rewrite is the new option for adding AR/AP transactions direct into Journal Entry.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2017-10-31T07:41:05Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29350#p29350</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Banking and GL - Tax Inquiry summation problem]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29342#p29342" />
			<content type="html"><![CDATA[<p>This issue does not prevail in FA 2.3 and hence the above fix only addresses the output and not the underlying db fetch function in FA 2.4. Attached is the FA 2.3 output without the above fix and it works perfectly.</p><p>Therefore the function <strong><a href="https://github.com/FrontAccountingERP/FA/blob/master/gl/includes/db/gl_db_trans.inc#L510">get_tax_summary()</a></strong> in <strong>gl/includes/db/gl_db_trans.inc</strong> needs to be investigated and it is different from it&#039;s <a href="https://github.com/apmuthu/frontaccounting/blob/master/core/gl/includes/db/gl_db_trans.inc#L431">FA 2.3 counterpart</a>.</p><p>The new avatar has an extra parameter <strong>$also_zero_purchases</strong> set to false by default.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-10-31T06:46:19Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29342#p29342</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Banking and GL - Tax Inquiry summation problem]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29340#p29340" />
			<content type="html"><![CDATA[<p>Good catch @andijani.</p><p>The Tax Inquiry page is at <strong>gl/inquiry/tax_inquiry.php</strong>. and it&#039;s line 91:<br /></p><div class="codebox"><pre><code>        $collectible = $tx[&#039;collectible&#039;];</code></pre></div><p>should be: <br /></p><div class="codebox"><pre><code>        $collectible = -$tx[&#039;collectible&#039;];</code></pre></div><p>If the <strong>Outputs/Inputs</strong> column too should get the appropriate signs, then make line 104 show the negative value.</p><p><s>This issue prevails in FA 2.3.x (line 95) as well and wonder how it went unchecked for so many years.</s></p><p>@joe: can commit it.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-10-31T05:00:40Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29340#p29340</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Banking and GL - Tax Inquiry summation problem]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29335#p29335" />
			<content type="html"><![CDATA[<p>FA 2.4.2 Tax summing is not correct in Tax Inquiry page.&nbsp; Supplier invoice taxes also show up as sales invoice taxes and they are added instead of being subtracted. </p><p>Example.</p><p>Type&nbsp; &nbsp; Description&nbsp; &nbsp; Amount&nbsp; &nbsp; Outputs/Inputs</p><p>GST / TPS 5%&nbsp; &nbsp; Charged on sales (Output Tax):&nbsp; &nbsp; 82.80&nbsp; &nbsp; 1,656.00<br />GST / TPS 5%&nbsp; &nbsp; Paid on purchases (Input Tax):&nbsp; &nbsp; 82.80&nbsp; &nbsp; 1,656.00<br />GST / TPS 5%&nbsp; &nbsp; Net payable or collectible:&nbsp; &nbsp; 165.60</p>]]></content>
			<author>
				<name><![CDATA[andijani]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20111</uri>
			</author>
			<updated>2017-10-31T01:50:52Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29335#p29335</id>
		</entry>
</feed>
