From 6664190be9cd66628c70939a4b5c7eed691d0fe8 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 1 Aug 2005 12:22:19 +0000 Subject: [PATCH] Ajout fonction info --- htdocs/fourn/facture/paiementfourn.class.php | 87 ++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/htdocs/fourn/facture/paiementfourn.class.php b/htdocs/fourn/facture/paiementfourn.class.php index d02243f32aa..4f6668a25ab 100644 --- a/htdocs/fourn/facture/paiementfourn.class.php +++ b/htdocs/fourn/facture/paiementfourn.class.php @@ -55,6 +55,93 @@ class PaiementFourn /* * * + */ + function Fetch($id,$user) + { + /* + */ + $error = 0; + + + $sql = "SELECT fk_facture_fourn, datec, datep, amount, fk_user_author, fk_paiement, num_paiement, note"; + $sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn"; + $sql .= " WHERE rowid = ".$id.";"; + + $resql = $this->db->query($sql); + + if ($resql) + { + $num = $this->db->num_rows($resl); + if ($num > 0) + { + $obj = $this->db->fetch_object($resql); + + $this->date = $obj->datep; + $this->montant = $obj->amount; + + + } + else + { + $error = 2; + } + } + else + { + print "$sql"; + $error = 1; + } + + return $error; + + } + /* + * + */ + /* + * \brief Information sur l'objet + * \param id id du paiement dont il faut afficher les infos + */ + + function info($id) + { + $sql = "SELECT c.rowid, ".$this->db->pdate("datec")." as datec, fk_user_author"; + $sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn as c"; + $sql .= " WHERE c.rowid = $id"; + + if ($this->db->query($sql)) + { + if ($this->db->num_rows()) + { + $obj = $this->db->fetch_object(); + + $this->id = $obj->idp; + + if ($obj->fk_user_creat) { + $cuser = new User($this->db, $obj->fk_user_creat); + $cuser->fetch(); + $this->user_creation = $cuser; + } + + if ($obj->fk_user_modif) { + $muser = new User($this->db, $obj->fk_user_modif); + $muser->fetch(); + $this->user_modification = $muser; + } + + $this->date_creation = $obj->datec; + $this->date_modification = $obj->tms; + + } + $this->db->free(); + + } + else + { + dolibarr_print_error($this->db); + } + } + /* * */ function create($user)