From 8c0b136132e02a1044bea232f8b1cc513132f2aa Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sun, 13 Apr 2003 14:49:17 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20d'une=20fonction=20pour=20r=E9cup=E9rer?= =?UTF-8?q?=20les=20factures=20impay=E9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/societe.class.php3 | 45 +++++++++++++++++++++++++++++++++------ 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/htdocs/societe.class.php3 b/htdocs/societe.class.php3 index 636594bf49e..b3fe1e59643 100644 --- a/htdocs/societe.class.php3 +++ b/htdocs/societe.class.php3 @@ -97,6 +97,38 @@ class Societe { * * */ + Function factures_impayes() + { + $facimp = array(); + /* + * Lignes + */ + $sql = "SELECT f.rowid"; + $sql .= " FROM llx_facture as f WHERE f.fk_soc = ".$this->id; + $sql .= " AND f.fk_statut = 1 AND f.paye = 0"; + + if ($this->db->query($sql)) + { + $num = $this->db->num_rows(); + $i = 0; + + while ($i < $num) + { + $objp = $this->db->fetch_object($i); + $array_push($facimp, $objp->rowid); + $i++; + print $i; + } + + $this->db->free(); + } + return $facimp; + } + + /* + * + * + */ Function fetch($socid) { $this->id = $socid; @@ -114,15 +146,14 @@ class Societe { if ($this->db->num_rows()) { $obj = $this->db->fetch_object(0); - $this->nom = $obj->nom; - - $this->tel = $obj->tel; - $this->fax = $obj->fax; + $this->nom = stripslashes($obj->nom); + $this->adresse = stripslashes($obj->address); + $this->cp = $obj->cp; + $this->ville = stripslashes($obj->ville); $this->url = $obj->url; - $this->adresse = $obj->address; - $this->cp = $obj->cp; - $this->ville = $obj->ville; + $this->tel = $obj->tel; + $this->fax = $obj->fax; $this->siren = $obj->siren;