diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 41cdd5caf5c..26229561472 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -903,7 +903,7 @@ class ActionComm extends CommonObject dol_syslog(get_class($this)."::delete", LOG_DEBUG); $res=$this->db->query($sql); - if ($res < 0) { + if (!$res) { $this->error=$this->db->lasterror(); $error++; } @@ -914,7 +914,7 @@ class ActionComm extends CommonObject dol_syslog(get_class($this)."::delete", LOG_DEBUG); $res=$this->db->query($sql); - if ($res < 0) { + if (!$res) { $this->error=$this->db->lasterror(); $error++; } diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 7093a3b7a2f..5bb50d825fc 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -239,6 +239,7 @@ if ($modecompta == 'CREANCES-DETTES') } $sql.= " WHERE l.fk_facture = f.rowid"; $sql.= " AND f.fk_statut in (1,2)"; + $sql.= " AND l.product_type in (0,1)"; if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) { $sql.= " AND f.type IN (0,1,2,5)"; } else {