# Error creating an invoice from a shipment

**URL:** <https://www.dolibarr.org/forum/t/error-creating-an-invoice-from-a-shipment/15601>\
**Category:** Using my Dolibarr\
**Created:** [May 20, 2017, 8:42am UTC](https://www.dolibarr.org/forum/t/error-creating-an-invoice-from-a-shipment/15601 "2017-05-20T08:42:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bernardo](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/bernardo/32/442_2.png) [@Bernardo](https://www.dolibarr.org/forum/u/Bernardo)\
**Post date:** [May 20, 2017, 8:42am UTC](https://www.dolibarr.org/forum/t/error-creating-an-invoice-from-a-shipment/15601/1 "2017-05-20T08:42:33Z")

</div>

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.

* * *

 ![error-creating-invoice-form-shipment.jpg](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/8/80d43d134c4f50374570ecffeac27dc998a971d5.jpeg)

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](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

---

<div class="post-metadata">

**Author:** ![LordVan](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/lordvan/32/426_2.png) [@LordVan](https://www.dolibarr.org/forum/u/LordVan)\
**Post date:** [May 24, 2017, 9:40am UTC](https://www.dolibarr.org/forum/t/error-creating-an-invoice-from-a-shipment/15601/2 "2017-05-24T09:40:14Z")

</div>

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](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](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]

---

<div class="post-metadata">

**Author:** ![LordVan](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/lordvan/32/426_2.png) [@LordVan](https://www.dolibarr.org/forum/u/LordVan)\
**Post date:** [May 24, 2017, 9:45am UTC](https://www.dolibarr.org/forum/t/error-creating-an-invoice-from-a-shipment/15601/3 "2017-05-24T09:45:32Z")

</div>

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 .

---

<div class="post-metadata">

**Author:** ![LordVan](https://www.dolibarr.org/forum/user_avatar/www.dolibarr.org/lordvan/32/426_2.png) [@LordVan](https://www.dolibarr.org/forum/u/LordVan)\
**Post date:** [May 24, 2017, 11:27am UTC](https://www.dolibarr.org/forum/t/error-creating-an-invoice-from-a-shipment/15601/4 "2017-05-24T11:27:43Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![roberthpchao](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@roberthpchao](https://www.dolibarr.org/forum/u/roberthpchao)\
**Post date:** [July 19, 2017, 10:23pm UTC](https://www.dolibarr.org/forum/t/error-creating-an-invoice-from-a-shipment/15601/5 "2017-07-19T22:23:03Z")

</div>

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

 ![createdraftinvoice.jpg](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/b/bfb568612f2173ab0d21879b37e199c95bb2393f.jpeg)  
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.
