<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — ERROR IN MYSQL WHEN A CUSTOMER PAYMENT IS VOID]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=6302</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6302&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in ERROR IN MYSQL WHEN A CUSTOMER PAYMENT IS VOID.]]></description>
		<lastBuildDate>Fri, 17 Jun 2016 11:21:52 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: ERROR IN MYSQL WHEN A CUSTOMER PAYMENT IS VOID]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=25646#p25646</link>
			<description><![CDATA[<p>Make a separate clean install of FA v2.3.25 and take a backup of the sql schema.<br />Compare the sql with that of your pre-upgrade v2.3.22 and see if there are any settings change.<br />Compare the sql/en_US-new.sql in FA v2.3.25+ with your Singapore CoA and see what differs.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 17 Jun 2016 11:21:52 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=25646#p25646</guid>
		</item>
		<item>
			<title><![CDATA[Re: ERROR IN MYSQL WHEN A CUSTOMER PAYMENT IS VOID]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=25639#p25639</link>
			<description><![CDATA[<p>It was version 2.3.22.&nbsp; &nbsp;I upgraded to 2.3.25 and I did the same test and it just showed a blank screen. (not sure your 2.3.25&quot;+&quot; contains what patches).</p><p>The COA I&#039;m using is Singapore 4 digit.</p><p>I will re-Post this over there.</p>]]></description>
			<author><![CDATA[null@example.com (mark0300)]]></author>
			<pubDate>Fri, 17 Jun 2016 09:50:16 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=25639#p25639</guid>
		</item>
		<item>
			<title><![CDATA[Re: ERROR IN MYSQL WHEN A CUSTOMER PAYMENT IS VOID]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=25619#p25619</link>
			<description><![CDATA[<p>Which version of FA are you using?<br />The current stable one is v2.3.25+.<br />Which Chart of Account are you using?</p><p>Since it is related to another post, it is best if posted in that thread itself.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sun, 12 Jun 2016 17:50:10 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=25619#p25619</guid>
		</item>
		<item>
			<title><![CDATA[ERROR IN MYSQL WHEN A CUSTOMER PAYMENT IS VOID]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=25613#p25613</link>
			<description><![CDATA[<p>I found a problem with error message after I voided a customer payment.&nbsp; This problem has been encountered by other users:</p><p>Ref: https://frontaccounting.com/punbb/viewtopic.php?id=4892</p><p>When attempt to open a voided customer payment by clicking on the Customer Payment #, the following error message appeared:</p><p>DATABASE ERROR : no debtor trans found for given params<br />sql that failed was : SELECT trans.*,ov_amount+ov_gst+ov_freight+ov_freight_tax+ov_discount AS Total,cust.name AS DebtorName, cust.address, cust.curr_code, cust.tax_id, com.memo_,bank_act,0_bank_accounts.bank_name, 0_bank_accounts.bank_account_name, 0_bank_accounts.account_type AS BankTransType, 0_bank_accounts.bank_curr_code, 0_bank_trans.amount as bank_amount FROM 0_debtor_trans trans LEFT JOIN 0_comments com ON trans.type=com.type AND trans.trans_no=com.id LEFT JOIN 0_shippers ON 0_shippers.shipper_id=trans.ship_via, 0_debtors_master cust, 0_bank_trans, 0_bank_accounts WHERE trans.trans_no=&#039;22&#039; AND trans.type=&#039;12&#039; AND trans.debtor_no=cust.debtor_no AND 0_bank_trans.trans_no =&#039;22&#039; AND 0_bank_trans.type=12 AND 0_bank_trans.amount != 0 AND 0_bank_accounts.id=0_bank_trans.bank_act </p><p>I managed to find a line in&nbsp; <strong>sales/includes/db/cust_trans_db.inc</strong> that somehow caused the database error.</p><p>&nbsp; &nbsp; if ($trans_type == ST_CUSTPAYMENT || $trans_type == ST_BANKDEPOSIT) {<br />&nbsp; &nbsp; &nbsp; &nbsp; // it&#039;s a payment so also get the bank account<br />&nbsp; &nbsp; &nbsp; &nbsp; $sql .= &quot; AND &quot;.TB_PREF.&quot;bank_trans.trans_no =&quot;.db_escape($trans_id).&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND &quot;.TB_PREF.&quot;bank_trans.type=$trans_type<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND &quot;.TB_PREF.&quot;bank_trans.amount != 0&nbsp; <span style="color: blue"><strong>&lt;&lt;== the &quot;!=&quot; is causing the issue</strong></span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND &quot;.TB_PREF.&quot;bank_accounts.id=&quot;.TB_PREF.&quot;bank_trans.bank_act &quot;;</p><p>As stated above, this <strong>!</strong>= 0 is causing the problem.&nbsp; If I remove &quot;!&quot;, then the voided payment will appear normal.&nbsp; But the normal customer payment will have the same error.</p><p>Due to my limited php knowledge, I am not able to fix it.&nbsp; </p><p>I hope this can be fixed as soon as possible or it looks ugly when the user click on the transaction.</p><p>Thanks!</p><p>/Mark</p>]]></description>
			<author><![CDATA[null@example.com (mark0300)]]></author>
			<pubDate>Fri, 10 Jun 2016 08:11:51 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=25613#p25613</guid>
		</item>
	</channel>
</rss>
