Fix: Can use decimal value in trip and expenses module

This commit is contained in:
Laurent Destailleur 2008-11-11 20:23:44 +00:00
parent b0c644d636
commit a67fc0933b

View File

@ -111,6 +111,9 @@ class Deplacement extends CommonObject
{ {
global $langs; global $langs;
// Clean parameters
$this->km=price2num($this->km);
// Check parameters // Check parameters
if (! is_numeric($this->km)) $this->km = 0; if (! is_numeric($this->km)) $this->km = 0;
if (empty($this->type) || $this->type < 0) if (empty($this->type) || $this->type < 0)
@ -125,7 +128,7 @@ class Deplacement extends CommonObject
} }
$sql = "UPDATE ".MAIN_DB_PREFIX."deplacement "; $sql = "UPDATE ".MAIN_DB_PREFIX."deplacement ";
$sql .= " SET km = ".$this->km; $sql .= " SET km = ".$this->km; // This is a distance or amount
$sql .= " , dated = '".$this->db->idate($this->date)."'"; $sql .= " , dated = '".$this->db->idate($this->date)."'";
$sql .= " , type = '".$this->type."'"; $sql .= " , type = '".$this->type."'";
$sql .= " , fk_user = ".$this->fk_user; $sql .= " , fk_user = ".$this->fk_user;