<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Unable to void a Sales Invoice]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=9416&amp;type=atom" />
	<updated>2021-08-14T18:33:10Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=9416</id>
		<entry>
			<title type="html"><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39863#p39863" />
			<content type="html"><![CDATA[<p>Fixed according to @Braathwaate and committed to stable repo. Thanks @Braathwaate</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2021-08-14T18:33:10Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39863#p39863</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39855#p39855" />
			<content type="html"><![CDATA[<p>@joe: can this get into the core?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2021-08-14T01:48:36Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39855#p39855</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39851#p39851" />
			<content type="html"><![CDATA[<p>The <a href="http://mantis.frontaccounting.com/view.php?id=5338">code fix</a>:<br /></p><div class="codebox"><pre><code>--- a/core/sales/includes/db/sales_invoice_db.inc
+++ b/core/sales/includes/db/sales_invoice_db.inc
@@ -249,8 +249,9 @@ function void_sales_invoice($type, $type_no)
                if ($deliveries !== 0) {
                        if ($type == ST_SALESINVOICE &amp;&amp; count($deliveries) == 1 &amp;&amp; get_reference(ST_CUSTDELIVERY, $deliveries[0]) == &quot;auto&quot;)
                        {
+                $trans = get_customer_trans($deliveries[0], ST_CUSTDELIVERY);
                                void_sales_delivery(ST_CUSTDELIVERY, $deliveries[0], false);
-                               $date_ = Today();
+                               $date_ = sql2date($trans[&#039;tran_date&#039;]);
                                add_audit_trail(ST_CUSTDELIVERY, $deliveries[0], $date_, _(&quot;Voided.&quot;));
                                add_voided_entry(ST_CUSTDELIVERY, $deliveries[0], $date_, &quot;&quot;);
                        }
diff --git a/core/sales/includes/db/sales_order_db.inc b/core/sales/includes/db/sales_order_db.inc
index 17952e3..4b4734d 100644
--- a/core/sales/includes/db/sales_order_db.inc
+++ b/core/sales/includes/db/sales_order_db.inc
@@ -89,6 +89,8 @@ function delete_sales_order($order_no, $trans_type)
        begin_transaction();
        hook_db_prevoid($trans_type, $order_no);
 
+    $order = get_sales_order_header($order_no, $trans_type);
+
        $sql = &quot;DELETE FROM &quot;.TB_PREF.&quot;sales_orders WHERE order_no=&quot; . db_escape($order_no) 
                . &quot; AND trans_type=&quot;.db_escape($trans_type);
 
@@ -98,7 +100,7 @@ function delete_sales_order($order_no, $trans_type)
                .db_escape($order_no) . &quot; AND trans_type=&quot;.db_escape($trans_type);
        db_query($sql, &quot;order Detail Delete&quot;);
 
-       add_audit_trail($trans_type, $order_no, Today(), _(&quot;Deleted.&quot;));
+       add_audit_trail($trans_type, $order_no, sql2date($order[&#039;ord_date&#039;]), _(&quot;Deleted.&quot;));
        commit_transaction();</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Braath Waate]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41493</uri>
			</author>
			<updated>2021-08-13T20:47:07Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39851#p39851</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39849#p39849" />
			<content type="html"><![CDATA[<p>Ok good to hear that you fixed the problem&nbsp; and thank you for writing the reason&nbsp; which will help future users to fix the problem if they face similar one.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2021-08-13T14:51:57Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39849#p39849</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39848#p39848" />
			<content type="html"><![CDATA[<p>If I create a new fiscal year (which we&#039;re now in), the problem goes away.</p><p>Thanks very much for your help and continuing to maintain such a brilliant piece of software.</p>]]></content>
			<author>
				<name><![CDATA[chrisf]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18225</uri>
			</author>
			<updated>2021-08-13T14:07:56Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39848#p39848</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39846#p39846" />
			<content type="html"><![CDATA[<p>Looks like I&#039;ve got a fiscal year problem.</p><p>[13-Aug-2021 15:06:47 Europe/Berlin] &lt;b&gt;DATABASE ERROR :&lt;/b&gt; Cannot update audit gl_seq&lt;br&gt;error code : 1048&lt;br&gt;error message : Column &#039;fiscal_year&#039; cannot be null&lt;br&gt;sql that failed was : UPDATE 2_audit_trail audit LEFT JOIN 2_fiscal_year year ON year.begin&lt;=&#039;2021-08-13&#039; AND year.end&gt;=&#039;2021-08-13&#039;</p><p>The invoices to be voided are in the last fiscal year that ended 2021-06-30. I have not yet created a new fiscal year.</p>]]></content>
			<author>
				<name><![CDATA[chrisf]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18225</uri>
			</author>
			<updated>2021-08-13T14:01:06Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39846#p39846</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39845#p39845" />
			<content type="html"><![CDATA[<p>@Joe,&nbsp; </p><p>Can we set a checkbox for the debugging mode. Basically some of the users are not technically strong to check it. So if we put a checkbox in the default company like the company creation page permission&nbsp; and allow them to set it from here will be more easier for them to turn it on and get the error informations on their first post itself.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2021-08-13T13:55:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39845#p39845</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39844#p39844" />
			<content type="html"><![CDATA[<p>So it looks something wrong in php&nbsp; code or in the database columns. <br />So enable debugging mode to check this issue. </p><p>And also check in error log. And if you find error information bring it to us.</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2021-08-13T13:53:12Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39844#p39844</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39843#p39843" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>kvvaradha wrote:</cite><blockquote><p>Looks like the timeout happens. We don&#039;t know howmuch records you have and server space given to work. </p><p>Probably Php time and our js time out also trouble you. Checkout the other forum&nbsp; which fixed the timeout issue.<br /> https://frontaccounting.com/punbb/viewtopic.php?pid=39832#p39832</p></blockquote></div><p>Thanks for the reply. It&#039;s definitely not hitting a 10s timeout. The spinning icon appears for less than a second.</p>]]></content>
			<author>
				<name><![CDATA[chrisf]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18225</uri>
			</author>
			<updated>2021-08-13T13:06:55Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39843#p39843</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39842#p39842" />
			<content type="html"><![CDATA[<p>Looks like the timeout happens. We don&#039;t know howmuch records you have and server space given to work. </p><p>Probably Php time and our js time out also trouble you. Checkout the other forum&nbsp; which fixed the timeout issue.<br /> https://frontaccounting.com/punbb/viewtopic.php?pid=39832#p39832</p>]]></content>
			<author>
				<name><![CDATA[kvvaradha]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19348</uri>
			</author>
			<updated>2021-08-13T12:42:01Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39842#p39842</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Unable to void a Sales Invoice]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=39840#p39840" />
			<content type="html"><![CDATA[<p>I&#039;m not sure if this is a bug or not. I&#039;ve been a very happy use for some years now. Currently using version 2.4.8. Browser is Chromium under Ubuntu and have seen the same behaviour on Firefox on the same machine.</p><p>When I go to void a Sales Invoice, I can select the invoice, enter a memo and click Void all as normal. The &#039;Are you sure ...&#039; page comes up as normal but clicking the Proceed button doesn&#039;t work. I briefly see the progress icon spinning but it never leaves the page and never voids the invoice.</p><p>Any tips would be greatly appreciated!</p>]]></content>
			<author>
				<name><![CDATA[chrisf]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18225</uri>
			</author>
			<updated>2021-08-13T08:29:00Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=39840#p39840</id>
		</entry>
</feed>
