<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Can't void customer payment]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=10038&amp;type=atom" />
	<updated>2022-11-21T14:29:46Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=10038</id>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41762#p41762" />
			<content type="html"><![CDATA[<p>@kvvaradha</p><p>I hope you are looking at the last committed code from the core.</p><p>In the Invoice case we are first testing for $type == ST_SALESINVOICE before the return action (not voiding).</p><p>The code works smoothly. And it falls down to post_void_customer_trans with the correct $type and $type_no.</p><p>The $type and $type_no are never changed inside the function.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2022-11-21T14:29:46Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41762#p41762</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41761#p41761" />
			<content type="html"><![CDATA[<p>Just check this way. </p><p>Customerpayment fall through the invoice,&nbsp; there we are passing only the trans_no. Not type. So what happens that tries to check the same customer payment trans_no on invoice.&nbsp; If the invoice exist. It voids the invoice instead of payment. </p><p>I am sure that fall through idea is not good here. So you need to have separate post_void_customer_trans.&nbsp; Hope you got me explanation. If not let me explain with an example</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2022-11-21T13:15:52Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41761#p41761</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41760#p41760" />
			<content type="html"><![CDATA[<p>@kvvaradha</p><p>There are no missing breaks. I will explain.</p><p>The Customer Payment and the Sales Invoice must fall thru down to post_void_customer_trans($type, $type_no) on line 63 (inside ST_CUSTCREDIT and ST_CUSTDELIVERY.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2022-11-21T07:58:43Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41760#p41760</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41758#p41758" />
			<content type="html"><![CDATA[<p>@joe did you check the break missing on voiding_db.inc</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2022-11-21T07:23:24Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41758#p41758</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41749#p41749" />
			<content type="html"><![CDATA[<p>Shouldn&#039;t the return statements obviate the need for break statements.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2022-11-17T16:11:53Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41749#p41749</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41738#p41738" />
			<content type="html"><![CDATA[<p>@joe</p><p>Break is missing for&nbsp; payment and invoice&nbsp; cases.&nbsp; Can we try this. ?</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2022-11-12T11:51:48Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41738#p41738</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41728#p41728" />
			<content type="html"><![CDATA[<p>@doug86</p><p>Did you download the new file /admin/db/voiding_db.inc and replaced it after the new install from sourceforge.net?<br />This install file is not updated yet. This file is only updated after a new release.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2022-11-11T14:51:43Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41728#p41728</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41726#p41726" />
			<content type="html"><![CDATA[<p>Sorry! False alarm. Should check things myself.</p><p>Still getting the same error with 2.4.14 from source forge.</p><p>Let me know if I can help narrow it down.</p><p>Dx</p>]]></content>
			<author>
				<name><![CDATA[doug86]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=44349</uri>
			</author>
			<updated>2022-11-11T14:11:58Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41726#p41726</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41722#p41722" />
			<content type="html"><![CDATA[<p>Thanks Everyone, works as expected!</p><p>Dx</p>]]></content>
			<author>
				<name><![CDATA[doug86]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=44349</uri>
			</author>
			<updated>2022-11-10T13:41:02Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41722#p41722</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41694#p41694" />
			<content type="html"><![CDATA[<p>Oops, will make a rerun.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2022-11-02T12:18:05Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41694#p41694</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41693#p41693" />
			<content type="html"><![CDATA[<p>Sorry, I meant to say ST_SALESINVOICE instead of ST_SALES_INVOICE.</p><p>Line 48 should read:<br />if ($type == ST_SALESINVOICE &amp;&amp; is_cust_invoice_credited($type_no))</p><p>That way, the call to is_cust_invoice_credited is not called unless the type is an invoice.</p>]]></content>
			<author>
				<name><![CDATA[Braath Waate]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41493</uri>
			</author>
			<updated>2022-11-02T11:09:21Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41693#p41693</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41691#p41691" />
			<content type="html"><![CDATA[<p>Thanks @Braath Waate.</p><p>This has been fixed in the core and committed to stable repo.</p><p>The fixed file can be downloaded <a href="https://sourceforge.net/p/frontaccounting/git/ci/master/tree/admin/db/voiding_db.inc">here</a>.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2022-11-02T09:24:10Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41691#p41691</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41684#p41684" />
			<content type="html"><![CDATA[<p>The reason you are encountering this problem is because you won the lottery: you happen to have an invoice with the same transaction number that cannot be voided.</p><p>The code is indeed broken.&nbsp; A void of a customer payment shouldn&#039;t fall through the case statement and check for an invoice using the same transaction number (is_cust_invoice_credited).</p><p>This should be an easy fix.&nbsp; You can condition the call to cust_invoice_credited with &amp;&amp; $type == ST_SALES_INVOICE</p>]]></content>
			<author>
				<name><![CDATA[Braath Waate]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41493</uri>
			</author>
			<updated>2022-11-01T19:23:39Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41684#p41684</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41671#p41671" />
			<content type="html"><![CDATA[<p>I replaced my admin/db/voiding_db.inc with the file linked above however the files were the exact same size and the problem remains.</p><p>Doing a diff on the two files shows they are the same.</p><p>Happy to cary out any experiments that might be useful!</p><p>Dx</p><br /><p>This invoice cannot be voided because it was already credited.<br />/PATH/frontaccounting/includes/ui/ui_msgs.inc:14:&nbsp; &nbsp; trigger_error(&#039;This invoice cannot be voided because it was already credited.&#039;,&#039;256&#039;)<br />/PATH/frontaccounting/admin/void_transaction.php:320:&nbsp; &nbsp; display_error(&#039;This invoice cannot be voided because it was already credited.&#039;)<br />/PATH/frontaccounting/admin/void_transaction.php:345:&nbsp; &nbsp; handle_void_transaction()</p>]]></content>
			<author>
				<name><![CDATA[doug86]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=44349</uri>
			</author>
			<updated>2022-11-01T16:06:38Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41671#p41671</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Can't void customer payment]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=41669#p41669" />
			<content type="html"><![CDATA[<p>Not yet traced this problem again. <br />But my above solution worked.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2022-11-01T14:36:36Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=41669#p41669</id>
		</entry>
</feed>
