From d1c3a18cb172bdc79edbd7d1695c11550524734d Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sat, 1 Feb 2003 21:13:19 +0000 Subject: [PATCH] ajout edition des lignes de factures --- htdocs/facture.class.php3 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/facture.class.php3 b/htdocs/facture.class.php3 index 4f5c09632c6..d512a37ccaf 100644 --- a/htdocs/facture.class.php3 +++ b/htdocs/facture.class.php3 @@ -41,7 +41,7 @@ class Facture { * */ - Function Facture($DB, $soc_idp="") { + Function Facture($DB, $soc_idp="", $facid="") { $this->db = $DB ; $this->socidp = $soc_idp; $this->products = array(); @@ -51,6 +51,7 @@ class Facture { $this->tva = 0; $this->total = 0; $this->propalid = 0; + $this->id = $facid; } /* * @@ -230,8 +231,6 @@ class Facture { */ Function addline($facid, $desc, $pu, $qty) { - global $conf; - $sql = "INSERT INTO llx_facturedet (fk_facture,description,price,qty) VALUES ($facid, '$desc', $pu, $qty) ;"; $result = $this->db->query( $sql); @@ -241,6 +240,17 @@ class Facture { * * */ + Function updateline($rowid, $desc, $pu, $qty) + { + $sql = "UPDATE llx_facturedet set description='$desc',price=$pu,qty=$qty WHERE rowid = $rowid ;"; + $result = $this->db->query( $sql); + + $this->updateprice($this->id); + } + /* + * + * + */ Function deleteline($rowid) { $sql = "DELETE FROM llx_facturedet WHERE rowid = $rowid;";