<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Error working with Sales Quotation]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=4846&amp;type=atom" />
	<updated>2014-04-05T02:52:25Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=4846</id>
		<entry>
			<title type="html"><![CDATA[Re: Error working with Sales Quotation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=19648#p19648" />
			<content type="html"><![CDATA[<p>Thanks for the quick fix Joe. Hope there are no more such instances of session dependencies.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-04-05T02:52:25Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=19648#p19648</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Error working with Sales Quotation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=19645#p19645" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2014-04-04T21:45:45Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=19645#p19645</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Error working with Sales Quotation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=19643#p19643" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2014-04-04T19:36:18Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=19643#p19643</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Error working with Sales Quotation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=19641#p19641" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[crspencer@sol-tech.co]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18469</uri>
			</author>
			<updated>2014-04-04T17:27:48Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=19641#p19641</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Error working with Sales Quotation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=19639#p19639" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2014-04-04T06:27:53Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=19639#p19639</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Error working with Sales Quotation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=19638#p19638" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2014-04-04T04:30:36Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=19638#p19638</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Error working with Sales Quotation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=19636#p19636" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2014-04-03T22:45:32Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=19636#p19636</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Error working with Sales Quotation]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=19634#p19634" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[crspencer@sol-tech.co]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18469</uri>
			</author>
			<updated>2014-04-03T17:27:24Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=19634#p19634</id>
		</entry>
</feed>
