From 6bd36d8b25d4aa0e901201547e004c72157b72c6 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 6 May 2004 11:08:53 +0000 Subject: [PATCH] Ajout possibilite d'annuler un contrat --- htdocs/contrat/contrat.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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();