<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=5684&amp;type=atom" />
	<updated>2017-04-10T11:56:07Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=5684</id>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27692#p27692" />
			<content type="html"><![CDATA[<p>Thanks @joe.</p><p>@itronics committed it on <a href="https://github.com/FrontAccountingERP/FA/commit/acb313fc11ab4aa40e48b46c1534d09114638f6c">2015-07-10</a>.</p><p>This now stands cross referenced. The <strong>name</strong> field / column can be backquoted in the sql.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-04-10T11:56:07Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27692#p27692</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27689#p27689" />
			<content type="html"><![CDATA[<p>I have talked with Janusz and he claims that this bug has already been fixed.<br />And this is correct. Look into the sql in the committed rep709 and you will see the correction.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2017-04-09T17:47:07Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27689#p27689</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27688#p27688" />
			<content type="html"><![CDATA[<p>In the demo data, there is no element with <strong>gl.amount = 0</strong> and hence I have not tested it out. Generally this occurs when a transaction is edited, the old one&#039;s amount becomes 0&nbsp; and the current (edited) value becomes the gl.amount in the new record.</p><p>@joe: does this merit inclusion in the base code?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-04-09T16:22:58Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27688#p27688</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=27686#p27686" />
			<content type="html"><![CDATA[<p>I found this bug 2 years ago but I cannot find the cause. Just today that I tried to fix it again and found that the SQL in report709.php seems to be unreasonable as the following.</p><div class="codebox"><pre><code>    $sql = &quot;SELECT tt.name as taxname, taxrec.*, taxrec.amount*ex_rate AS amount,
                taxrec.net_amount*ex_rate AS net_amount,
                IF(taxrec.trans_type=&quot;.ST_BANKPAYMENT.&quot; OR taxrec.trans_type=&quot;.ST_BANKDEPOSIT.&quot;, 
                    IF(gl.person_type_id&lt;&gt;&quot;.PT_MISC.&quot;, gl.memo_, gl.person_id), 
                    IF(ISNULL(supp.supp_name), debt.name, supp.supp_name)) as name,
                branch.br_name
        FROM &quot;.TB_PREF.&quot;trans_tax_details taxrec
        LEFT JOIN &quot;.TB_PREF.&quot;tax_types tt
            ON taxrec.tax_type_id=tt.id
        LEFT JOIN &quot;.TB_PREF.&quot;gl_trans gl 
            ON taxrec.trans_type=gl.type AND taxrec.trans_no=gl.type_no AND 
            (tt.purchasing_gl_code=gl.account OR tt.sales_gl_code=gl.account)
        LEFT JOIN &quot;.TB_PREF.&quot;supp_trans strans
            ON taxrec.trans_no=strans.trans_no AND taxrec.trans_type=strans.type
        LEFT JOIN &quot;.TB_PREF.&quot;suppliers as supp ON strans.supplier_id=supp.supplier_id
        LEFT JOIN &quot;.TB_PREF.&quot;debtor_trans dtrans
            ON taxrec.trans_no=dtrans.trans_no AND taxrec.trans_type=dtrans.type
        LEFT JOIN &quot;.TB_PREF.&quot;debtors_master as debt ON dtrans.debtor_no=debt.debtor_no
        LEFT JOIN &quot;.TB_PREF.&quot;cust_branch as branch ON dtrans.branch_code=branch.branch_code
        WHERE (taxrec.amount &lt;&gt; 0 OR taxrec.net_amount &lt;&gt; 0)
            AND taxrec.trans_type &lt;&gt; &quot;.ST_CUSTDELIVERY.&quot;
            AND taxrec.tran_date &gt;= &#039;$fromdate&#039;
            AND taxrec.tran_date &lt;= &#039;$todate&#039;
        ORDER BY taxrec.trans_type, taxrec.tran_date, taxrec.trans_no, taxrec.ex_rate&quot;;</code></pre></div><p>When there are 2 records in tax_trans (The amount value in one record is not 0 and the other one is 0) which linked to the same record in debtor_trans, this SQL will generate 2 records after joining.</p><p>In tax_trans, the record of amount value 0 is filtered out by WHERE parameters, and only 1 tax_tran will be activated to join. But in joining gl_trans, the record of amount 0 is not filtered out so they all will be joined with this 1 tax_tran and get 2 transactions in the report.</p><p>Solution:<br />Just add &quot; AND (gl.amount &lt;&gt; 0)&quot; into the LEFT JOIN of gl_trans. This is what I have done so far. However, I do not really know the side effect as I have never thoroughly get into the codes of FrontAccounting.</p>]]></content>
			<author>
				<name><![CDATA[zybersup]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41177</uri>
			</author>
			<updated>2017-04-09T08:19:11Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=27686#p27686</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25110#p25110" />
			<content type="html"><![CDATA[<p>We cannot reproduce the problem, I guess it is somewhat specific to tax setup on your system. <br />Please send minimal database content on which you observe the issue to our contributions mailbox, together with the problem description. This will allow us fix the issue.</p><p>Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2016-01-28T08:46:52Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25110#p25110</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25103#p25103" />
			<content type="html"><![CDATA[<p>Kindly state the Mantis Bug Number and full link for ease of access.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-01-27T19:10:54Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25103#p25103</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25090#p25090" />
			<content type="html"><![CDATA[<p>I have contacted Janusz again for a reminder.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2016-01-26T16:11:49Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25090#p25090</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25089#p25089" />
			<content type="html"><![CDATA[<p>Hi Joe,</p><p>Has this bug been corrected already ?<br />We experienced the same issue as Seahawk.</p><p>The only work around we found was to void and recreate the invoices impacted.</p><p>Thanks,<br />René</p>]]></content>
			<author>
				<name><![CDATA[renengs]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20718</uri>
			</author>
			<updated>2016-01-26T13:17:32Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25089#p25089</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=23863#p23863" />
			<content type="html"><![CDATA[<p>This bug has also been reported on <a href="http://mantis.frontaccounting.com">Mantis</a>.</p><p>I have asked Janusz to take care of this. Hopefully he will do that asap.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2015-07-10T07:47:16Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=23863#p23863</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=23862#p23862" />
			<content type="html"><![CDATA[<p><em>Subscribed.</em></p><p>MarkAndrew and seahawk, thank you for discovery and reporting this bug.</p><p>Is there a plan to fix this and what is the time frame?</p>]]></content>
			<author>
				<name><![CDATA[RandomName]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=20525</uri>
			</author>
			<updated>2015-07-10T06:46:59Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=23862#p23862</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=23816#p23816" />
			<content type="html"><![CDATA[<p>The tax report has the same problem if you do an inquiry on sales/Customer Transaction Inquiry and you open an invoice or you open a credit note, it will duplicate that as a transaction if you update anything, even if nothing has changed. </p><p>That results in the the credit note number and invoice number displaying twice doubling the amount of tax payable for the period.</p><p>I have installed the update as recommended above, but the problem still persists. It seems it was fixed only for the purchases not sales. If I did an inquiry on an invoice, it will duplicate the invoice when updated. </p><p>I agree that this have serious implications for someone who will claim double deduction or has to pay double the amount especially if they do not print the detail in the report and verify the number of invoices on Output Vat and Input vat.</p><p>Any help or fix in this regard will really be appreciated.</p>]]></content>
			<author>
				<name><![CDATA[seahawk]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=544</uri>
			</author>
			<updated>2015-07-05T07:17:50Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=23816#p23816</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=23267#p23267" />
			<content type="html"><![CDATA[<p>Thx</p>]]></content>
			<author>
				<name><![CDATA[MarkAndrew]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=17490</uri>
			</author>
			<updated>2015-04-13T17:50:21Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=23267#p23267</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=23253#p23253" />
			<content type="html"><![CDATA[<p>The issue has been fixed in the core itself and the changes have been bundled and <a href="https://frontaccounting.com/punbb/viewtopic.php?pid=23145#p23145">attached</a> to the release announcement post. Just overwrite your FA v2.3.24 files with them.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2015-04-13T07:20:30Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=23253#p23253</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=23247#p23247" />
			<content type="html"><![CDATA[<p>I followed the link to the fix but I have no idea what to do as I don&#039;t understand code.<br />is there any way this can be included in next update?</p>]]></content>
			<author>
				<name><![CDATA[MarkAndrew]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=17490</uri>
			</author>
			<updated>2015-04-13T05:24:52Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=23247#p23247</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Editing a Journal Entry results in a duplicate entry on Tax Report]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=23200#p23200" />
			<content type="html"><![CDATA[<p>thanks, your reply is really appreciated but still doesn&#039;t mean much to me - sorry.<br />main point is that there&#039;s a bug that makes the VAT report wrong if a transaction has been edited - if a transaction has been edited then it&#039;s included twice on the VAT report instead of once.<br />the VAT report is used to make the VAT return and claiming the same input VAT twice is a problem that can have serious implications with the tax authorities.<br />any change of this real fix being included in a release so that Front&#039;s VAT report is reliable?<br />it&#039;s a pretty bad bug.</p>]]></content>
			<author>
				<name><![CDATA[MarkAndrew]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=17490</uri>
			</author>
			<updated>2015-04-09T19:15:01Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=23200#p23200</id>
		</entry>
</feed>
