Merge pull request #12681 from dvasseur/rest-update-propal

FIX: propal update
This commit is contained in:
Laurent Destailleur 2019-12-10 19:21:28 +01:00 committed by GitHub
commit 82a92b3c08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1544,6 +1544,7 @@ class Propal extends CommonObject
if (isset($this->note_public)) $this->note_public = trim($this->note_public);
if (isset($this->modelpdf)) $this->modelpdf = trim($this->modelpdf);
if (isset($this->import_key)) $this->import_key = trim($this->import_key);
if (! empty($this->duree_validite)) $this->fin_validite=$this->date + ($this->duree_validite * 24 * 3600);
// Check parameters
// Put here code to add control on parameters values
@ -1555,7 +1556,8 @@ class Propal extends CommonObject
$sql .= " ref_client=".(isset($this->ref_client) ? "'".$this->db->escape($this->ref_client)."'" : "null").",";
$sql .= " ref_ext=".(isset($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null").",";
$sql .= " fk_soc=".(isset($this->socid) ? $this->socid : "null").",";
$sql .= " datep=".(strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : 'null').",";
$sql .= " datep=".(strval($this->date) != '' ? "'".$this->db->idate($this->date)."'" : 'null').",";
if (! empty($this->fin_validite)) $sql .= " fin_validite=".(strval($this->fin_validite)!='' ? "'".$this->db->idate($this->fin_validite)."'" : 'null').",";
$sql .= " date_valid=".(strval($this->date_validation) != '' ? "'".$this->db->idate($this->date_validation)."'" : 'null').",";
$sql .= " tva=".(isset($this->total_tva) ? $this->total_tva : "null").",";
$sql .= " localtax1=".(isset($this->total_localtax1) ? $this->total_localtax1 : "null").",";