diff --git a/htdocs/contact.class.php b/htdocs/contact.class.php index 29e8bfb0b7e..1881b5a0086 100644 --- a/htdocs/contact.class.php +++ b/htdocs/contact.class.php @@ -511,14 +511,15 @@ class Contact } - $sql = "SELECT count(*) "; + $sql = "SELECT count(*) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."contact_facture"; $sql .= " WHERE fk_contact = ". $id; $resql=$this->db->query($sql); if ($resql) { - if ($this->db->num_rows($resql)) + $obj=$this->db->fetch_object($resql); + if ($obj->nb) { $this->facturation = 1; } diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index e45456f79fa..985de580acb 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -413,7 +413,7 @@ else print ''; print ''.$langs->trans("BillingContact").''; - print $langs->trans($yesno[$contact->facturation]); + print yn($contact->facturation); print ''; print "";