Error creating an invoice from a shipment

Hello,
There is an error that happens when I create an invoice from a shipment. It happens on 3 different installation of Dolibarr 5.0.1. Could it be a bug?
Does anybody knows how to avoid the error?

I got the error on my installation on a remote server and now, also on the copy thata I installed on my localhost (Xampp).
It follows the Dolibarr’s error message. I attach also the screen shot with XDebug’s result.
Thanks for any help.


Dolibarr has detected a technical error.
This information can be useful for diagnostic purposes:
Date: 20170520102102
Dolibarr: 5.0.1
Level of features: 0
PHP: 7.0.13
Server: Apache/2.4.23 (Win32) OpenSSL/1.0.2h PHP/7.0.13
OS: Windows NT LAPTOP-APC37IFU 10.0 build 14393 (Windows 10) i586
UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0

Requested URL: /eclipse/dolibarr/htdocs/compta/facture.php
Referer: http://localhost/eclipse/dolibarr/htdocs/compta/facture.php?action=create&origin=shipping&originid=1&socid=1
Menu manager: eldy_menu.php

XDebug informations:
File: C:\xampp\htdocs\eclipse\dolibarr\htdocs\compta\facture\class\facture.class.php
Line: 507
Function: create

I have the same problem (or at least a similar one):
it gives me an error in red: FailedToUpdatePrice - - twice
And this longer error: (sorry for the german)

[code]
Das System hat einen technischen Fehler festgestellt.
Diese Informationen können für die Fehlersuche hilfreich sein:
Datum: 20170524112520
Dolibarr: 5.0.1
Funktionslevel: 0
PHP: 5.6.27-pl0-gentoo
Server: Apache
OS: Linux tkserver1 3.12.6-hardened-r4 #5 SMP Fri Jan 17 22:42:55 CET 2014 x86_64
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

Angefragte URL: /dolibarr/compta/facture.php
Referer: https://intranet.internal.raschbacher-schlosserei.at/dolibarr/compta/facture.php?action=create&origin=shipping&originid=4&socid=3819
Menüverwaltung: eldy_menu.php

Das System hat einen technischen Fehler festgestellt.
Diese Informationen können für die Fehlersuche hilfreich sein:
Datum: 20170524112520
Dolibarr: 5.0.1
Funktionslevel: 0
PHP: 5.6.27-pl0-gentoo
Server: Apache
OS: Linux tkserver1 3.12.6-hardened-r4 #5 SMP Fri Jan 17 22:42:55 CET 2014 x86_64
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36

Angefragte URL: /dolibarr/compta/facture.php
Referer: https://intranet.internal.raschbacher-schlosserei.at/dolibarr/compta/facture.php?action=create&origin=shipping&originid=4&socid=3819
Menüverwaltung: eldy_menu.php

Datenbank Type Manager: pgsql
Letzter Fehlerhafter Datenbankzugriff: SELECT ctc.code, ctc.source, ec.fk_socpeople FROM llx_element_contact as ec, llx_c_type_contact as ctc WHERE element_id = AND ec.fk_c_type_contact = ctc.rowid AND ctc.element = ‘commande’
Rückgabewert des letzten fehlerhaften Datenbankzugriff: DB_ERROR_SYNTAX
Information zum letzten fehlerhaften Datenbankzugriff: ERROR: 42601: syntax error at or near “AND” LINE 1: …ec, llx_c_type_contact as ctc WHERE element_id = AND ec.fk_… ^ LOCATION: scanner_yyerror, scan.l:1053

Message: Bad request in update_price[/code]

after reading this a bit clloser i noticed that the query itself is simply wrong … this part:

.. WHERE element_id = AND ... there is no element_id there .

This seems to be created in facture.class.php Linke 489 … i am not exactly sue what this is supposed to do. can someone shed light on it?

I have the same problem. I am using 5.0.4. Below is the error message.

Requested URL: /dolibarr/compta/facture.php
Referer: http://########.net/dolibarr/compta/facture.php?action=create&origin=shipping&originid=10&socid=3
Menu manager: eldy_menu.php

When I click browser back button. It went back and also showing “Warning, one or more invoice already exit”.
Please see screen shot attached. the address showing exactly the same as above error message. shipping&originid=10&socid=3


I check the list of invoice. That draft invoice has been created. I can validate and enter payment with no problem.
It seems working, but we shouldn’t see that error message.
Eldy can you fix that please.
Thank you.