iago
March 24, 2010, 11:36pm
1
Hi all.
Trying the new versio dolibarr 2.8 when I create a client or supplier it gives me a SQL error:
Error sql=UPDATE llx_societe SET nom = ‘Prueba’,datea = 20100325003121,address = ‘’,cp = null,ville = null,fk_departement = ‘0’,fk_pays = ‘4’,tel = null,fax = null,email = null,url = null,siren = ‘’,siret = ‘’,ape = ‘’,idprof4 = ‘’,tva_assuj = ‘1’,tva_intra = ‘’,localtax1_assuj = ‘’,localtax2_assuj = ‘’,capital = ‘0’,prefix_comm = null,fk_effectif = null,fk_typent = 0,fk_forme_juridique = null,client = 1,fournisseur = 0,gencod = null, code_client = null, code_compta = null, code_fournisseur = null, code_compta_fournisseur = null, fk_user_modif = ‘1’ WHERE rowid = ‘13’
I checked that the table llx_societe is empty in the database. I suppose that dolibarr couldn’t creat the record in llx_societe and after that the update fails but I don’t know why. Any idea?
Apache 2.2.15
PHP 5.3.2
MySql 5.1.45
Thanks in advance.
Iago.
eldy
March 27, 2010, 5:51pm
2
Don’t you have a mysql error code ? Only the Error sql… message given here ?
What about if you execute the request from a SQL tools directly ?
iago
March 29, 2010, 10:06pm
3
Hi eldy.
Thanks for your response. I don’t have a mysql error code.
I’ve searched the bugs french forum and found this post with somebody with the same error: http://www.dolibarr.fr/forum/5-bugs/20232-28-stable-nouveau-client--impossible-
He found out a possible mistake in the code. He modifies the file societe.class.php in htdocs. The lines 432 and 433:
From:
$sql .= ",localtax1_assuj = ".($this->localtax1_assuj>=0?"'".$this->localtax1_assuj."'":"null");
$sql .= ",localtax2_assuj = ".($this->localtax2_assuj>=0?"'".$this->localtax2_assuj."'":"null");
To:
$sql .= ",localtax1_assuj = ".($this->localtax1_assuj>0?"'".$this->localtax1_assuj."'":"null");
$sql .= ",localtax2_assuj = ".($this->localtax2_assuj>0?"'".$this->localtax2_assuj."'":"null");
Modifying this code it also works for me. It’s strange for me that only two people are complaining about this. Does it depend in the country code? I found some code in soc.php that references code==‘ES’ and prints then the local taxes fields. I’m from Spain.
Thanks Eldy.
Iago.
iago
March 29, 2010, 10:08pm
4
Also eldy some question.
The other user (benharvest) found out the solution in mode debug. How could I enter in mode debug?
Iago.
eldy
March 30, 2010, 11:46am
5
To switch in debug mode, you must activate the syslog module.
I can not reproduce it in any form, serves me right, with and without MAIN_FEATURES_LEVEL…
I will investigate tonight!!
My problem for reproduce it was that I don’t had the strict option of Mysql.
Eldy has solved the code problem very quickly…
iago
March 30, 2010, 9:41pm
8
Hi all.
I’ve tried the eldy modification in code and also works for me.
Thanks to all.
Iago