From d84ca1ea8b22437c9e153a34faadbcb759dfaa7c Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 31 Jan 2005 16:30:02 +0000 Subject: [PATCH] Ajout gestion du mode de reglement --- htdocs/facture.class.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index d8b6315a2cb..c04990b8f6c 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -148,6 +148,9 @@ class Facture $remise = 0 ; } + if (strlen($this->mode_reglement)==0) $this->mode_reglement = 0; + + if (! $this->projetid) { $this->projetid = "NULL"; @@ -157,8 +160,14 @@ class Facture $tva = tva($totalht); $total = $totalht + $tva; - $sql = "INSERT INTO $this->db_table (facnumber, fk_soc, datec, amount, remise, remise_percent, datef, note, fk_user_author,fk_projet, fk_cond_reglement, date_lim_reglement) "; - $sql .= " VALUES ('$number','$socid', now(), '$totalht', '$remise','$this->remise_percent', ".$this->db->idate($this->date).",'".addslashes($this->note)."',$user->id, $this->projetid, $this->cond_reglement,".$this->db->idate($datelim).")"; + $sql = "INSERT INTO $this->db_table (facnumber, fk_soc, datec, amount, remise, remise_percent"; + $sql .= ", datef, note, fk_user_author,fk_projet"; + $sql .= ", fk_cond_reglement, fk_mode_reglement, date_lim_reglement) "; + + $sql .= " VALUES ('$number','$socid', now(), '$totalht', '$remise'"; + $sql .= ",'$this->remise_percent', ".$this->db->idate($this->date); + $sql .= ",'".addslashes($this->note)."',$user->id, $this->projetid"; + $sql .= ",".$this->cond_reglement.",".$this->mode_reglement.",".$this->db->idate($datelim).")"; if ( $this->db->query($sql) ) { $this->id = $this->db->last_insert_id();