diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index 47c1b42e63b..4e8d3ec41d8 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -428,7 +428,7 @@ function getInvoicesForThirdParty($authentication,$idthirdparty) $sql ='SELECT f.rowid as facid, ref as ref, ref_ext, type, fk_statut as status, total_ttc, total, tva'; $sql.=' FROM '.MAIN_DB_PREFIX.'facture as f'; - $sql.=" WHERE f.entity = ".$conf->entity; + $sql.=" WHERE f.entity IN (".getEntity('invoice').")"; if ($idthirdparty != 'all' ) $sql.=" AND f.fk_soc = ".$db->escape($idthirdparty); $resql=$db->query($sql);