<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Database Error - Voided Customer Payment]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=4892</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=4892&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Database Error - Voided Customer Payment.]]></description>
		<lastBuildDate>Thu, 15 Sep 2016 10:04:52 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Database Error - Voided Customer Payment]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26373#p26373</link>
			<description><![CDATA[<p>I will ask Janusz to look at this.</p><p>Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Thu, 15 Sep 2016 10:04:52 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26373#p26373</guid>
		</item>
		<item>
			<title><![CDATA[Re: Database Error - Voided Customer Payment]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=26372#p26372</link>
			<description><![CDATA[<div class="quotebox"><cite>mark0300 wrote:</cite><blockquote><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></blockquote></div><p>======================<br />Hi @apmuthu,</p><p>I am novice in programming and I encountered the same problem in version 2.3.25.</p><p>When the said line mentioned by Mark0300 is removed, the error disappeared.&nbsp; But I couldn&#039;t figure out why that line would cause the error as it is just a “if” condition.</p><p>/KH</p>]]></description>
			<author><![CDATA[null@example.com (khkoh)]]></author>
			<pubDate>Thu, 15 Sep 2016 08:05:50 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=26372#p26372</guid>
		</item>
		<item>
			<title><![CDATA[Re: Database Error - Voided Customer Payment]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=25658#p25658</link>
			<description><![CDATA[<p>@apmuthu,</p><p>Thanks for your quick reply.&nbsp; When I void a payment, the corresponding invoice became outstanding.&nbsp; And I verified and confirmed this.&nbsp; &nbsp;I did not void an invoice prior to the payment.&nbsp; That is, I voided the payment first.&nbsp; Even though I did not void the invoice, this error will still appear.</p><p>I checked the ledger, when the customer payment is voided, it disappeared from the GL entry.</p><p>/Mark</p>]]></description>
			<author><![CDATA[null@example.com (mark0300)]]></author>
			<pubDate>Mon, 20 Jun 2016 09:31:41 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=25658#p25658</guid>
		</item>
		<item>
			<title><![CDATA[Re: Database Error - Voided Customer Payment]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=25656#p25656</link>
			<description><![CDATA[<p>When a direct invoice has been voided what policy do you expect for any payments received for that invoice till then?</p><p>Actually any payments received from the customer for that invoice should be either voided or re-assigned to be advances received on account before voiding any associated direct invoice.</p><p>Check the customer ledger account to see if the customer payment is still there and void it there if necessary.</p><p>@joe: What is the policy on treating customer payments received on voiding associated direct invoice?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Mon, 20 Jun 2016 06:38:54 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=25656#p25656</guid>
		</item>
		<item>
			<title><![CDATA[Re: Database Error - Voided Customer Payment]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=25653#p25653</link>
			<description><![CDATA[<p>This is the error in the log file after I clicked on the voided payment #:</p><p>[19-Jun-2016 22:22:28 Asia/Singapore] &lt;b&gt;DATABASE ERROR :&lt;/b&gt; no debtor trans found for given params&lt;br&gt;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,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0_bank_accounts.account_type AS BankTransType,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0_bank_accounts.bank_curr_code,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0_bank_trans.amount as bank_amount FROM 0_debtor_trans trans<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LEFT JOIN 0_comments com ON trans.type=com.type AND trans.trans_no=com.id<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LEFT JOIN 0_shippers ON 0_shippers.shipper_id=trans.ship_via, <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0_debtors_master cust, 0_bank_trans, 0_bank_accounts WHERE trans.trans_no=&#039;3&#039;<br />&nbsp; &nbsp; &nbsp; &nbsp; AND trans.type=&#039;12&#039;<br />&nbsp; &nbsp; &nbsp; &nbsp; AND trans.debtor_no=cust.debtor_no AND 0_bank_trans.trans_no =&#039;3&#039;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND 0_bank_trans.type=12<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND 0_bank_trans.amount != 0<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND 0_bank_accounts.id=0_bank_trans.bank_act &lt;br&gt;&lt;br&gt;&lt;br&gt;</p><br /><br /><p>/Mark</p>]]></description>
			<author><![CDATA[null@example.com (mark0300)]]></author>
			<pubDate>Sun, 19 Jun 2016 14:29:23 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=25653#p25653</guid>
		</item>
		<item>
			<title><![CDATA[Re: Database Error - Voided Customer Payment]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=25651#p25651</link>
			<description><![CDATA[<p>Anything in the error logs?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 18 Jun 2016 11:09:57 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=25651#p25651</guid>
		</item>
		<item>
			<title><![CDATA[Re: Database Error - Voided Customer Payment]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=25650#p25650</link>
			<description><![CDATA[<p>The one that I encountered with the error message was version 2.3.22.&nbsp; And I have made a clean installation of version 2.3.25.&nbsp; </p><p>I created a direct invoice and enter the customer payment transaction for this invoice.&nbsp; Then I void this payment transaction. I went back to list Customer Transactions, and click on the number (#) of this voided payment transaction:</p><p>1.&nbsp; On version 2.3.22:&nbsp; I got the error as mentioned in my previous post.<br />2.&nbsp; On version 2.3.25:&nbsp; I got a new browser windows totally blank. (If there is no issue, I would expect to see the transaction and with the void note below)</p><p>I found the &quot;!&quot; in the file &quot;cust_trans_db.inc&quot; causing this issue as mentioned in my previous post.</p><p>I hope that this can be duplicated by other users and it can be rectified.&nbsp; Otherwise, either a blank screen or error message made it look a little unappealing although I did not see this error caused other issues to the other transactions.</p><p>Thank you.</p><p>/Mark</p>]]></description>
			<author><![CDATA[null@example.com (mark0300)]]></author>
			<pubDate>Sat, 18 Jun 2016 10:14:07 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=25650#p25650</guid>
		</item>
		<item>
			<title><![CDATA[Re: Database Error - Voided Customer Payment]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=25642#p25642</link>
			<description><![CDATA[<p>Is there anyone facing this issue? </p><p>If there is a customer payment or bank deposit involved the amount should not be 0 (!=0). So where is the problem?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 17 Jun 2016 10:48:41 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=25642#p25642</guid>
		</item>
		<item>
			<title><![CDATA[Re: Database Error - Voided Customer Payment]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=25640#p25640</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, 17 Jun 2016 09:51:16 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=25640#p25640</guid>
		</item>
		<item>
			<title><![CDATA[Re: Database Error - Voided Customer Payment]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=19746#p19746</link>
			<description><![CDATA[<p>This sql comes from <strong><em>function</em> get_customer_trans()</strong> in <strong>sales/includes/db/cust_trans_db.inc</strong>.</p><p>This issue is fixed in:<br />https://frontaccounting.com/punbb/viewtopic.php?id=4528</p><p>Upgrade to FA v2.3.20 and apply the fixes. See posts:<br />https://frontaccounting.com/punbb/viewtopic.php?pid=19496#p19496<br />and<br />https://frontaccounting.com/punbb/viewtopic.php?pid=19720#p19720</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Thu, 17 Apr 2014 01:58:25 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=19746#p19746</guid>
		</item>
		<item>
			<title><![CDATA[Database Error - Voided Customer Payment]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=19728#p19728</link>
			<description><![CDATA[<p>I am using version 2.3.19 on a Ubuntu 64 bit machine. When attempting to open a voided customer payment, I get the following:</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,1_bank_accounts.bank_name, 1_bank_accounts.bank_account_name, 1_bank_accounts.account_type AS BankTransType, 1_bank_accounts.bank_curr_code, 1_bank_trans.amount as bank_amount FROM 1_debtor_trans trans LEFT JOIN 1_comments com ON trans.type=com.type AND trans.trans_no=com.id LEFT JOIN 1_shippers ON 1_shippers.shipper_id=trans.ship_via, 1_debtors_master cust, 1_bank_trans, 1_bank_accounts WHERE trans.trans_no=&#039;11&#039; AND trans.type=&#039;12&#039; AND trans.debtor_no=cust.debtor_no AND 1_bank_trans.trans_no =&#039;11&#039; AND 1_bank_trans.type=12 AND 1_bank_trans.amount != 0 AND 1_bank_accounts.id=1_bank_trans.bank_act </p><p>I voided this payment after voiding a sales invoice sucessfully. I was able to void the referenced customer payment and it now shows Debit of 0.00. It is just that if I try to look at the transaction that I get the DATABASE ERROR message. I am able to open the voided Sales Invoice and associated Delivery Note just fine. </p><p>Ray</p>]]></description>
			<author><![CDATA[null@example.com (Rayson)]]></author>
			<pubDate>Mon, 14 Apr 2014 07:27:45 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=19728#p19728</guid>
		</item>
	</channel>
</rss>
