From 85a5ef98331f82dce2d99f7dfa09bc52fee14d21 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 10 Oct 2007 13:10:15 +0000 Subject: [PATCH] Fix: erreur mysql si on n'utilise pas la date de livraison dans une propale --- htdocs/propal.class.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 5b332ad3edf..e4fb9432bd6 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -495,14 +495,17 @@ class Propal extends CommonObject // Insertion dans la base $sql = "INSERT INTO ".MAIN_DB_PREFIX."propal (fk_soc, price, remise, remise_percent, remise_absolue,"; $sql.= " tva, total, datep, datec, ref, fk_user_author, note, note_public, model_pdf, fin_validite,"; - $sql.= " fk_cond_reglement, fk_mode_reglement, date_livraison, ref_client) "; - $sql.= " VALUES ($this->socid, 0, $this->remise, $this->remise_percent, $this->remise_absolue,"; + $sql.= " fk_cond_reglement, fk_mode_reglement, ref_client"; + if ($conf->global->PROPALE_ADD_SHIPPING_DATE) $sql.= ", date_livraison"; + $sql.= ") "; + $sql.= " VALUES (".$this->socid.", 0, ".$this->remise.", ".$this->remise_percent.", ".$this->remise_absolue.","; $sql.= " 0,0,".$this->db->idate($this->datep).", now(), '".$this->ref."', ".$this->author.","; $sql.= "'".addslashes($this->note)."',"; $sql.= "'".addslashes($this->note_public)."',"; - $sql.= "'$this->modelpdf',".$this->db->idate($this->fin_validite).","; - $sql.= " $this->cond_reglement_id, $this->mode_reglement_id,"; - $sql.= " ".$this->db->idate($this->date_livraison).",'".addslashes($this->ref_client)."')"; + $sql.= "'".$this->modelpdf."',".$this->db->idate($this->fin_validite).","; + $sql.= " ".$this->cond_reglement_id.", ".$this->mode_reglement_id.","; + if ($conf->global->PROPALE_ADD_SHIPPING_DATE) $sql.= " ".$this->db->idate($this->date_livraison).","; + $sql.= "'".addslashes($this->ref_client)."')"; $resql=$this->db->query($sql); if ($resql)