<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — SQL Database Error on Direct Invoice Entry]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=485&amp;type=atom" />
	<updated>2009-03-30T01:15:16Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=485</id>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2133#p2133" />
			<content type="html"><![CDATA[<p>I am having this problem too. to reproduce the error:</p><p>1. install version 2.0.x (i m using 2.0.4 and 2.0.7 to be exact).<br />2. upgrade to 2.1<br />3. follow the upgrade procedure here: https://frontaccounting.com/wbt/pages/download/update-guide.php<br />4. login to frontaccouting as admin<br />5. click on &quot;Direct Invoice&quot;</p><p>------------------------- Error Message ----------------------------------------------------------<br />DATABASE ERROR : could not get POS definition<br />error code : 1064<br />error message : You have an error in your SQL syntax near &#039;AND pos.pos_location=loc.loc_code AND pos.pos_account=acc.id&#039; at line 1<br />sql that failed was : SELECT pos.*, loc.location_name, acc.bank_account_name, acc.account_code FROM 0_sales_pos as pos,0_locations as loc,0_bank_accounts as acc WHERE pos.id= AND pos.pos_location=loc.loc_code AND pos.pos_account=acc.id<br />------------------------- Error Message ----------------------------------------------------------</p><p>Hope can help. </p><p>TQ</p>]]></content>
			<author>
				<name><![CDATA[zeroone2020]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=337</uri>
			</author>
			<updated>2009-03-30T01:15:16Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2133#p2133</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2130#p2130" />
			<content type="html"><![CDATA[<p>In post 19, item 4, you must also change all other pos to other locations (da)&nbsp; do this before you go and delete locations,</p><p>I think this is were the problem was, but works now... on my local that is,&nbsp; I still get the error no my hosted, same db file, same scripts?</p><p>May there is some server side cache or something, I will try later... ok, maybe some browser cache, but all is good, I think this error is gone for good.</p><p>Alvin <img src="https://frontaccounting.com/punbb/img/smilies/smile.png" width="15" height="15" alt="smile" /> and <img src="https://frontaccounting.com/punbb/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[alvin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=176</uri>
			</author>
			<updated>2009-03-29T19:52:43Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2130#p2130</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2125#p2125" />
			<content type="html"><![CDATA[<p>Well, I&#039;m lost. I have checked procedure from post 19 together with manual setting described in post 21 using sql data file you&#039;ve send me, and all works right now. I can entry Direct Invoices and read all sales orders without errors.</p><p>In post 19 point 3 is obsolete, as voided SO are also in inquiry result and without fixing from_stk_loc are read with errors. So change form post 21 is also necessary.</p><p>Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2009-03-29T09:15:16Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2125#p2125</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2123#p2123" />
			<content type="html"><![CDATA[<p>There are no sales orders in the the system,&nbsp; &nbsp;`0_sales_orders`MySQL returned an empty result set (i.e. zero rows).</p>]]></content>
			<author>
				<name><![CDATA[alvin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=176</uri>
			</author>
			<updated>2009-03-29T01:18:55Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2123#p2123</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2117#p2117" />
			<content type="html"><![CDATA[<p>Well, in fact broken sales orders still can be not readable. I guess the records are also unusable, as they are simply artifacts of failed Direct Invoice entry. If you want get rid with them - do it in phpmyadmin. If you prefer to keep them for some reason change all empty from_stk_loc to some real location.loc_code value from your database.<br />Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2009-03-28T21:10:53Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2117#p2117</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2112#p2112" />
			<content type="html"><![CDATA[<p>no, that did not do it, still got the error</p>]]></content>
			<author>
				<name><![CDATA[alvin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=176</uri>
			</author>
			<updated>2009-03-28T16:45:10Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2112#p2112</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2106#p2106" />
			<content type="html"><![CDATA[<p>1. update source to latest main CVS version - Default POS will be visible<br />2. enter all defined users, set right POS and update them<br />3. void broken sales orders<br />4. delete Default location and POS if you don&#039;t want to use them.<br />Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2009-03-28T13:41:00Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2106#p2106</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2097#p2097" />
			<content type="html"><![CDATA[<p>So how can I delete default location and not get this error?</p>]]></content>
			<author>
				<name><![CDATA[alvin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=176</uri>
			</author>
			<updated>2009-03-27T19:06:32Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2097#p2097</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2079#p2079" />
			<content type="html"><![CDATA[<p>Hello,<br />This ugly upgrade bug has been finally localized and fixed. Main CVS branch updated.</p><p>Thanks Alvin for your kindly help.</p><p>Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2009-03-26T16:03:31Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2079#p2079</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2063#p2063" />
			<content type="html"><![CDATA[<p>You can send my the db files by email, but once again the date of broken records entry in relation to version upgrade date is important</p><p>You have found that the source of error is empty sales_orders.stock_from_loc in some records. Can you find whether those records were added to database BEFORE upgrade, or AFTER? You certainly have db dump made before version upgrade, so it should be easy to find. </p><p>When the empty stock_from_loc were in original database, we should deal with bad data during upgrade. Otherwise we have some bug in new code resulting with incorrect sales_order records.</p><p>Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2009-03-25T08:30:33Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2063#p2063</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2061#p2061" />
			<content type="html"><![CDATA[<p>I am not sure, the file producing the error is a new file. I have a db file that produces the error (new) and one the does not (old), I did a text diff on them </p><p>this is non error diff</p><p>for table `0_chart_master`<br />`tax_code` int(11) NOT NULL default &#039;0&#039;,</p><p>for table `0_company`<br />`custom0_name` varchar(60) NOT NULL default &#039;&#039;,<br />&nbsp; `custom0_value` varchar(100) NOT NULL default &#039;&#039;,</p><p>I tried to get the non error file to produce the error, but could not.&nbsp; I tried to get the error file to not produce the error but could not.</p><p>I tried everything I could, the results are the same using script 2.1 and 2.2</p><p>Maybe I could send you the db files and you could play with them?</p><p>Let me know, thanks</p><p>AM</p>]]></content>
			<author>
				<name><![CDATA[alvin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=176</uri>
			</author>
			<updated>2009-03-25T03:45:29Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2061#p2061</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2055#p2055" />
			<content type="html"><![CDATA[<p>Were the fatal records with empty from_stk_loc added after upgrade, or before? Anyway it is not good, but we should know this to decide how to deal with this problem.</p><p>Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2009-03-24T21:27:22Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2055#p2055</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2053#p2053" />
			<content type="html"><![CDATA[<p>Janusz, </p><p>The error: (MySQL returned an empty result set (i.e. zero rows)) is coming from statement (AND 0_locations.loc_code = 0_sales_orders.from_stk_loc) in looking at the tables, even thou enters are being made in 0_sales_orders, there are no enters in column (from_stk_loc)</p><p>What you think?</p><p>Alvin</p>]]></content>
			<author>
				<name><![CDATA[alvin]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=176</uri>
			</author>
			<updated>2009-03-24T15:08:34Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2053#p2053</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2010#p2010" />
			<content type="html"><![CDATA[<p>Could you explain me how have you fixed the problem? I still cannot find the source of the trouble nor reproduce it. </p><p>Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2009-03-19T22:03:49Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2010#p2010</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: SQL Database Error on Direct Invoice Entry]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=2009#p2009" />
			<content type="html"><![CDATA[<p>The error in the first post. It was a database error. I&#039;ve exported all the important info and recreated the database. I&#039;ve noticed that some of the functions like Cash/Delayed in Direct Invoice didn&#039;t show up until I fixed the DB.</p>]]></content>
			<author>
				<name><![CDATA[ScorpKing]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=319</uri>
			</author>
			<updated>2009-03-19T21:40:42Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=2009#p2009</id>
		</entry>
</feed>
