<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[FrontAccounting forum — Unable to void a Sales Invoice]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=9416</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=9416&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Unable to void a Sales Invoice.]]></description>
		<lastBuildDate>Sat, 14 Aug 2021 18:33:10 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39863#p39863</link>
			<description><![CDATA[<p>Fixed according to @Braathwaate and committed to stable repo. Thanks @Braathwaate</p><p>Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Sat, 14 Aug 2021 18:33:10 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39863#p39863</guid>
		</item>
		<item>
			<title><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39855#p39855</link>
			<description><![CDATA[<p>@joe: can this get into the core?</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 14 Aug 2021 01:48:36 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39855#p39855</guid>
		</item>
		<item>
			<title><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39851#p39851</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (Braath Waate)]]></author>
			<pubDate>Fri, 13 Aug 2021 20:47:07 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39851#p39851</guid>
		</item>
		<item>
			<title><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39849#p39849</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Fri, 13 Aug 2021 14:51:57 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39849#p39849</guid>
		</item>
		<item>
			<title><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39848#p39848</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (chrisf)]]></author>
			<pubDate>Fri, 13 Aug 2021 14:07:56 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39848#p39848</guid>
		</item>
		<item>
			<title><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39846#p39846</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (chrisf)]]></author>
			<pubDate>Fri, 13 Aug 2021 14:01:06 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39846#p39846</guid>
		</item>
		<item>
			<title><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39845#p39845</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Fri, 13 Aug 2021 13:55:42 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39845#p39845</guid>
		</item>
		<item>
			<title><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39844#p39844</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Fri, 13 Aug 2021 13:53:12 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39844#p39844</guid>
		</item>
		<item>
			<title><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39843#p39843</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (chrisf)]]></author>
			<pubDate>Fri, 13 Aug 2021 13:06:55 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39843#p39843</guid>
		</item>
		<item>
			<title><![CDATA[Re: Unable to void a Sales Invoice]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39842#p39842</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (kvvaradha)]]></author>
			<pubDate>Fri, 13 Aug 2021 12:42:01 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39842#p39842</guid>
		</item>
		<item>
			<title><![CDATA[Unable to void a Sales Invoice]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=39840#p39840</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (chrisf)]]></author>
			<pubDate>Fri, 13 Aug 2021 08:29:00 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=39840#p39840</guid>
		</item>
	</channel>
</rss>
