diff --git a/htdocs/contrat/contrat.class.php b/htdocs/contrat/contrat.class.php index e0e988dfca2..782a6e85e1d 100644 --- a/htdocs/contrat/contrat.class.php +++ b/htdocs/contrat/contrat.class.php @@ -98,6 +98,18 @@ class Contrat $result = $this->db->query($sql) ; } + /* + * + * + */ + Function annule($user) + { + $sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET enservice = 0"; + $sql .= " , date_cloture = now(), fk_user_cloture = ".$user->id; + $sql .= " WHERE rowid = ".$this->id . " AND enservice = 1"; + + $result = $this->db->query($sql) ; + } /* * * @@ -127,6 +139,7 @@ class Contrat $this->user_cloture->id = $result["fk_user_cloture"]; $this->product->fetch($result["fk_product"]); + $this->societe->fetch($result["fk_soc"]); $this->db->free();