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;
--New 1074 : Stock mouvement link to origin
ALTER TABLE llx_stock_mouvement ADD fk_origin INT NOT NULL ;
ALTER TABLE llx_stock_mouvement ADD origintype VARCHAR( 32 ) NOT NULL ;
ALTER TABLE llx_stock_mouvement ADD fk_origin integer;
ALTER TABLE llx_stock_mouvement ADD origintype VARCHAR(32);
--NEw 1300 : Add THM on user
ALTER TABLE llx_user ADD thm FLOAT NOT NULL ;
ALTER TABLE llx_projet_task_time ADD thm FLOAT NOT NULL ;
--New 1300 : Add THM on user
ALTER TABLE llx_user ADD thm double(24,8);
ALTER TABLE llx_projet_task_time ADD thm double(24,8);

View File

@ -19,9 +19,10 @@
create table llx_projet_task_time
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_task integer NOT NULL,
fk_task integer NOT NULL,
task_date date,
task_duration double,
fk_user integer,
thm double(24,8),
note text
)ENGINE=innodb;

View File

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

View File

@ -207,7 +207,7 @@ class User extends CommonObject
$this->office_fax = $obj->office_fax;
$this->user_mobile = $obj->user_mobile;
$this->email = $obj->email;
$this->skype = $obj->skype;
$this->skype = $obj->skype;
$this->job = $obj->job;
$this->signature = $obj->signature;
$this->admin = $obj->admin;
@ -218,7 +218,7 @@ class User extends CommonObject
$this->lang = $obj->lang;
$this->entity = $obj->entity;
$this->accountancy_code = $obj->accountancy_code;
$this->thm = $obj->thm;
$this->thm = $obj->thm;
$this->datec = $this->db->jdate($obj->datec);
$this->datem = $this->db->jdate($obj->datem);
@ -1138,7 +1138,6 @@ class User extends CommonObject
$this->zip = empty($this->zip)?'':$this->zip;
$this->town = empty($this->town)?'':$this->town;
$this->accountancy_code = trim($this->accountancy_code);
$this->thm = price2num($this->thm);
// Check parameters
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.= ", signature = '".$this->db->escape($this->signature)."'";
$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.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");