From 37a142d332ccbd51378fca0d1620cc46e13ab83b Mon Sep 17 00:00:00 2001 From: Regis Houssin <regis@dolibarr.fr> Date: Sat, 27 May 2006 13:04:10 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20la=20date=20de=20livraison=20n'=E9tait?= =?UTF-8?q?=20pas=20r=E9cup=E9r=E9e=20sur=20la=20commande?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/commande/commande.class.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 5c634efe1d3..dd4332c1845 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -303,14 +303,26 @@ class Commande // On positionne en mode brouillon la commande $this->brouillon = 1; + if (! $remise) { $remise = 0 ; } + if (! $this->projetid) { $this->projetid = 0; } + + // On ne formate pas une date de livraison qui vient d'une propale + if ($this->propale_id) + { + $date_livraison = $this->date_livraison; + } + else + { + $date_livraison = $this->date_livraison?$this->db->idate($this->date_livraison):'null'; + } $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'commande ('; $sql.= 'fk_soc, date_creation, fk_user_author, fk_projet, date_commande, source, note, ref_client,'; @@ -321,7 +333,7 @@ class Commande $sql.= ' '.$this->source.', '; $sql.= " '".addslashes($this->note)."', "; $sql.= " '".$this->ref_client."', '".$this->modelpdf.'\', \''.$this->cond_reglement_id.'\', \''.$this->mode_reglement_id.'\','; - $sql.= " '".($this->date_livraison?$this->db->idate($this->date_livraison):'null').'\','; + $sql.= " '".$date_livraison.'\','; $sql.= " '".$this->adresse_livraison_id."',"; $sql.= " '".$this->remise_absolue."',"; $sql.= " '".$this->remise_percent."')"; -- GitLab