diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index f8431d7130d..c5a1379668e 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -668,7 +668,7 @@ class Don extends CommonObject */ public function fetch($id, $ref = '') { - $sql = "SELECT d.rowid, d.datec, d.date_valid, d.tms as datem, d.datedon,"; + $sql = "SELECT d.rowid, d.entity, d.datec, d.date_valid, d.tms as datem, d.datedon,"; $sql .= " d.fk_soc as socid, d.firstname, d.lastname, d.societe, d.amount, d.fk_statut as status, d.address, d.zip, d.town, "; $sql .= " d.fk_country, d.public, d.amount, d.fk_payment, d.paid, d.note_private, d.note_public, d.email, d.phone, "; $sql .= " d.phone_mobile, d.fk_projet as fk_project, d.model_pdf,"; @@ -692,7 +692,8 @@ class Don extends CommonObject if ($this->db->num_rows($resql)) { $obj = $this->db->fetch_object($resql); - $this->id = $obj->rowid; + $this->id = $obj->rowid; + $this->entity = $obj->entity; $this->ref = $obj->rowid; $this->date_creation = $this->db->jdate($obj->datec); $this->datec = $this->db->jdate($obj->datec);