diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index d065378fd32..1e152331aff 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3874,6 +3874,7 @@ class Societe extends CommonObject */ $sql = "SELECT rowid, total_ttc FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " WHERE fk_soc = ". $this->id; + $sql .= " AND entity IN (".getEntity('invoice').")"; $sql .= " AND paye = 0"; $sql .= " AND fk_statut <> 0"; // Not a draft //$sql .= " AND (fk_statut <> 3 OR close_code <> 'abandon')"; // Not abandonned for undefined reason