Update commonobject.class.php

This commit is contained in:
Laurent Destailleur 2022-06-03 11:12:55 +02:00 committed by GitHub
parent 2fe29627e6
commit b2e6f9fc68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2649,8 +2649,9 @@ abstract class CommonObject
$sql = 'UPDATE '.$this->db->prefix().$this->table_element;
$sql .= " SET ".$fieldname." = ".(($id > 0 || $id == '0') ? ((int) $id) : 'NULL');
if (in_array($this->table_element, array('propal', 'commande')))
$sql .= " , deposit_percent = " . (! empty($deposit_percent) ? "'".$this->db->escape($deposit_percent)."'" : 'NULL');
if (in_array($this->table_element, array('propal', 'commande'))) {
$sql .= " , deposit_percent = " . (empty($deposit_percent) ? 'NULL' : "'".$this->db->escape($deposit_percent)."'");
}
$sql .= ' WHERE rowid='.((int) $this->id);
if ($this->db->query($sql)) {