Fix multicompany

This commit is contained in:
Laurent Destailleur 2018-12-14 16:20:23 +01:00
parent 78cd503872
commit 98b8113a39

View File

@ -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);