Fix: Not mandatory field must not be not null

Fix: field to store amount must be double(24,8)
This commit is contained in:
Laurent Destailleur 2014-03-16 20:37:43 +01:00
parent 58add21719
commit eb5e891cf9
4 changed files with 11 additions and 10 deletions

View File

@ -1063,9 +1063,9 @@ CREATE TABLE llx_payment_salary (
)ENGINE=innodb; )ENGINE=innodb;
--New 1074 : Stock mouvement link to origin --New 1074 : Stock mouvement link to origin
ALTER TABLE llx_stock_mouvement ADD fk_origin INT NOT NULL ; ALTER TABLE llx_stock_mouvement ADD fk_origin integer;
ALTER TABLE llx_stock_mouvement ADD origintype VARCHAR( 32 ) NOT NULL ; ALTER TABLE llx_stock_mouvement ADD origintype VARCHAR(32);
--NEw 1300 : Add THM on user --New 1300 : Add THM on user
ALTER TABLE llx_user ADD thm FLOAT NOT NULL ; ALTER TABLE llx_user ADD thm double(24,8);
ALTER TABLE llx_projet_task_time ADD thm FLOAT NOT NULL ; ALTER TABLE llx_projet_task_time ADD thm double(24,8);

View File

@ -23,5 +23,6 @@ create table llx_projet_task_time
task_date date, task_date date,
task_duration double, task_duration double,
fk_user integer, fk_user integer,
thm double(24,8),
note text note text
)ENGINE=innodb; )ENGINE=innodb;

View File

@ -54,6 +54,7 @@ create table llx_user
fk_socpeople integer, fk_socpeople integer,
fk_member integer, fk_member integer,
fk_user integer, -- Hierarchic parent fk_user integer, -- Hierarchic parent
thm double(24,8),
note text DEFAULT NULL, note text DEFAULT NULL,
datelastlogin datetime, datelastlogin datetime,
datepreviouslogin datetime, datepreviouslogin datetime,

View File

@ -1138,7 +1138,6 @@ class User extends CommonObject
$this->zip = empty($this->zip)?'':$this->zip; $this->zip = empty($this->zip)?'':$this->zip;
$this->town = empty($this->town)?'':$this->town; $this->town = empty($this->town)?'':$this->town;
$this->accountancy_code = trim($this->accountancy_code); $this->accountancy_code = trim($this->accountancy_code);
$this->thm = price2num($this->thm);
// Check parameters // Check parameters
if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email)) if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email))
@ -1169,7 +1168,7 @@ class User extends CommonObject
$sql.= ", job = '".$this->db->escape($this->job)."'"; $sql.= ", job = '".$this->db->escape($this->job)."'";
$sql.= ", signature = '".$this->db->escape($this->signature)."'"; $sql.= ", signature = '".$this->db->escape($this->signature)."'";
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; $sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
$sql.= ", thm = ".$this->thm; $sql.= ", thm = ".(isset($this->thm)?$this->thm:"null"); // If not set, we use null
$sql.= ", note = '".$this->db->escape($this->note)."'"; $sql.= ", note = '".$this->db->escape($this->note)."'";
$sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null"); $sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null"); $sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");