<?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 working with Sales Quotation]]></title>
		<link>https://frontaccounting.com/punbb/viewtopic.php?id=4846</link>
		<atom:link href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=4846&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Error working with Sales Quotation.]]></description>
		<lastBuildDate>Sat, 05 Apr 2014 02:52:25 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Error working with Sales Quotation]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=19648#p19648</link>
			<description><![CDATA[<p>Thanks for the quick fix Joe. Hope there are no more such instances of session dependencies.</p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Sat, 05 Apr 2014 02:52:25 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=19648#p19648</guid>
		</item>
		<item>
			<title><![CDATA[Re: Error working with Sales Quotation]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=19645#p19645</link>
			<description><![CDATA[<p>This bug has now been fixed, and the HG repository will be updated in a while.</p><p>You can download the file /sales/sales_order_entry.php1. Rename it to sales_order_entry.php and replace the file in the /sales folder.</p><p>/Joe</p><p><strong>ATTN.<br />If you downloaded the previous sales_order_entry.php1 file, then please re-download this one.<br />AN error in the confirm (cancel) was not performed correctly.</strong></p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Fri, 04 Apr 2014 21:45:45 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=19645#p19645</guid>
		</item>
		<item>
			<title><![CDATA[Re: Error working with Sales Quotation]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=19643#p19643</link>
			<description><![CDATA[<p>Ah, now I understand what is going on.</p><p>Your version of MySql has detected a bug. When a quotation is not yet saved (not completed), FA should not try to delete the quotatin as well as update the audit trail when the quotation is not completed.</p><p>I will fix this later tonight. There are other forms needing to be fixEd as well.</p><p>In older versions of MySql it was no problems running these sql scripts.</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Fri, 04 Apr 2014 19:36:18 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=19643#p19643</guid>
		</item>
		<item>
			<title><![CDATA[Re: Error working with Sales Quotation]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=19641#p19641</link>
			<description><![CDATA[<p>I can reproduce this error at will by going to Sales Quotation then hitting Cancel, but if I just hit back it exits out with no problem.</p>]]></description>
			<author><![CDATA[null@example.com (crspencer@sol-tech.co)]]></author>
			<pubDate>Fri, 04 Apr 2014 17:27:48 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=19641#p19641</guid>
		</item>
		<item>
			<title><![CDATA[Re: Error working with Sales Quotation]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=19639#p19639</link>
			<description><![CDATA[<p>I cannot reproduce this error.</p><p>The error is thrown in the file /sales/includes/db/sales_order_db.inc</p><div class="codebox"><pre><code>function delete_sales_order($order_no, $trans_type)
{
    begin_transaction();
    hook_db_prevoid($trans_type, $order_no);

    $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);

    db_query($sql, &quot;order Header Delete&quot;);

    $sql = &quot;DELETE FROM &quot;.TB_PREF.&quot;sales_order_details WHERE order_no =&quot; 
        .db_escape($order_no) . &quot; AND trans_type=&quot;.db_escape($trans_type);
    db_query($sql, &quot;order Detail Delete&quot;);

    delete_reference($trans_type, $order_no);

    add_audit_trail($trans_type, $order_no, Today(), _(&quot;Deleted.&quot;));
    commit_transaction();
}</code></pre></div><p>If the $order_no is empty, the error should have been trown in one of the prior database calls.</p><p>The file /includes/db/audit_trail_db.inc shows the </p><div class="codebox"><pre><code>function add_audit_trail($trans_type, $trans_no, $trans_date, $descr=&#039;&#039;)
{
    $sql = &quot;INSERT INTO &quot;.TB_PREF.&quot;audit_trail&quot;
        . &quot; (type, trans_no, user, fiscal_year, gl_date, description, gl_seq)
            VALUES(&quot;.db_escape($trans_type).&quot;, &quot;.db_escape($trans_no).&quot;,&quot;
            . $_SESSION[&quot;wa_current_user&quot;]-&gt;user. &quot;,&quot;
            . get_company_pref(&#039;f_year&#039;) .&quot;,&quot;
            . &quot;&#039;&quot;. date2sql($trans_date) .&quot;&#039;,&quot;
            . db_escape($descr). &quot;, 0)&quot;;

    db_query($sql, &quot;Cannot add audit info&quot;);
    
    // all audit records beside latest one should have gl_seq set to NULL
    // to avoid need for subqueries (not existing in MySQL 3) all over the code
    $sql = &quot;UPDATE &quot;.TB_PREF.&quot;audit_trail SET gl_seq = NULL&quot;
        . &quot; WHERE type=&quot;.db_escape($trans_type).&quot; AND trans_no=&quot;
        .db_escape($trans_no).&quot; AND id!=&quot;.db_insert_id();

    db_query($sql, &quot;Cannot update audit gl_seq&quot;);
}</code></pre></div><p>The sql sentence INSERT INTO ... throws the empty result. This is strange</p><p>Please can somebody help me to track this, if possible?</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Fri, 04 Apr 2014 06:27:53 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=19639#p19639</guid>
		</item>
		<item>
			<title><![CDATA[Re: Error working with Sales Quotation]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=19638#p19638</link>
			<description><![CDATA[<p>This has something to do with <strong>$order_no</strong> being absent in one of the three calls to the <strong>add-audit_trail()</strong> function in <strong>sales/includes/db/sales_order_db.inc</strong></p>]]></description>
			<author><![CDATA[null@example.com (apmuthu)]]></author>
			<pubDate>Fri, 04 Apr 2014 04:30:36 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=19638#p19638</guid>
		</item>
		<item>
			<title><![CDATA[Re: Error working with Sales Quotation]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=19636#p19636</link>
			<description><![CDATA[<p>I just wonder how this is possible. The Sales Quotation must at leat have a number of 1.</p><p>Can you please add some information to this?</p><p>/Joe</p>]]></description>
			<author><![CDATA[null@example.com (joe)]]></author>
			<pubDate>Thu, 03 Apr 2014 22:45:32 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=19636#p19636</guid>
		</item>
		<item>
			<title><![CDATA[Error working with Sales Quotation]]></title>
			<link>https://frontaccounting.com/punbb/viewtopic.php?pid=19634#p19634</link>
			<description><![CDATA[<p>I tried to Cancel/Void a Sales Quotation and received a big red box with the following error:</p><p>DATABASE ERROR : Cannot add audit info<br />error code : 1366<br />error message : Incorrect integer value: &#039;&#039; for column &#039;trans_no&#039; at row 1<br />sql that failed was : INSERT INTO 9_audit_trail (type, trans_no, user, fiscal_year, gl_date, description, gl_seq) VALUES(&#039;32&#039;, &#039;&#039;,2,7,&#039;2014-04-03&#039;,&#039;Deleted.&#039;, 0)</p><br /><p>Any help would be appreciated!!</p><p>Version 2.3.19</p>]]></description>
			<author><![CDATA[null@example.com (crspencer@sol-tech.co)]]></author>
			<pubDate>Thu, 03 Apr 2014 17:27:24 +0000</pubDate>
			<guid>https://frontaccounting.com/punbb/viewtopic.php?pid=19634#p19634</guid>
		</item>
	</channel>
</rss>
