diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 9329b3b83a5..c99577f5919 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -689,7 +689,7 @@ class Propal $sql.= " ".MAIN_DB_PREFIX."c_propalst as c"; $sql.= " WHERE fk_statut = c.id"; $sql.= " AND rowid='".$rowid."';"; - + $resql=$this->db->query($sql); if ($resql) @@ -1796,13 +1796,12 @@ class Propal // Insertion dans la base $sql = "INSERT INTO ".MAIN_DB_PREFIX."propal (fk_soc, fk_soc_contact, price, remise, remise_percent, remise_absolue,"; $sql.= " tva, total, datep, datec, ref, fk_user_author, note, note_public, model_pdf, fin_validite, fk_cond_reglement, fk_mode_reglement, date_livraison, fk_adresse_livraison) "; - $sql.= " VALUES ($this->socidp, $this->contactid, 0, $this->remise, $this->remise_percent, $this->remise_absolue,"; - $sql.= " 0,0,".$this->db->idate($this->datep).", now(), '$this->ref', $this->author,"; + $sql.= " VALUES ('$this->socidp', '$this->contactid', '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, '".$this->date_livraison."', '$this->adresse_livraison_id')"; - + $sql.= "'$this->modelpdf','".$this->db->idate($this->fin_validite)."',"; + $sql.= " '$this->cond_reglement_id', '$this->mode_reglement_id', '".$this->date_livraison."', '$this->adresse_livraison_id')"; $resql=$this->db->query($sql); if ($resql) { @@ -1850,7 +1849,7 @@ class Propal else { $this->error=$this->db->error(); - dolibarr_syslog("Propal::Create -2 ".$this->error); + dolibarr_syslog("Propal::Create_from -2 ".$this->error); $this->db->rollback(); return -2; }