Fix nb mailling message receive according toher status than error or not

send
This commit is contained in:
FHenry 2012-07-24 14:33:27 +02:00
parent 8f2efa4879
commit a2b6abcb85

View File

@ -805,8 +805,12 @@ class Contact extends CommonObject
$sql = "SELECT count(mc.email) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
$sql.= " WHERE mc.email = '".$this->db->escape($this->email)."'";
$sql.= " AND mc.statut=1"; // -1 erreur, 0 non envoye, 1 envoye avec succes
$sql.= " AND mc.statut NOT IN (-1,0)"; // -1 erreur, 0 non envoye, 1 envoye avec succes
dol_syslog(get_class($this)."::getNbOfEMailings sql=".$sql, LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
$obj = $this->db->fetch_object($resql);