|
@@ -909,27 +909,11 @@ class BOM extends CommonObject
|
|
|
if ($this->db->num_rows($result)) {
|
|
|
$obj = $this->db->fetch_object($result);
|
|
|
$this->id = $obj->rowid;
|
|
|
- if (!empty($obj->fk_user_author)) {
|
|
|
- $cuser = new User($this->db);
|
|
|
- $cuser->fetch($obj->fk_user_author);
|
|
|
- $this->user_creation = $cuser;
|
|
|
- }
|
|
|
-
|
|
|
- if (!empty($obj->fk_user_valid)) {
|
|
|
- $vuser = new User($this->db);
|
|
|
- $vuser->fetch($obj->fk_user_valid);
|
|
|
- $this->user_validation = $vuser;
|
|
|
- }
|
|
|
-
|
|
|
- if (!empty($obj->fk_user_cloture)) {
|
|
|
- $cluser = new User($this->db);
|
|
|
- $cluser->fetch($obj->fk_user_cloture);
|
|
|
- $this->user_cloture = $cluser;
|
|
|
- }
|
|
|
|
|
|
+ $this->user_creation_id = $obj->fk_user_creat;
|
|
|
+ $this->user_modification_id = $obj->fk_user_modif;
|
|
|
$this->date_creation = $this->db->jdate($obj->datec);
|
|
|
- $this->date_modification = !empty($obj->datem) ? $this->db->jdate($obj->datem) : "";
|
|
|
- $this->date_validation = !empty($obj->datev) ? $this->db->jdate($obj->datev) : "";
|
|
|
+ $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
|
|
|
}
|
|
|
|
|
|
$this->db->free($result);
|
|
@@ -1581,29 +1565,11 @@ class BOMLine extends CommonObjectLine
|
|
|
if ($this->db->num_rows($result)) {
|
|
|
$obj = $this->db->fetch_object($result);
|
|
|
$this->id = $obj->rowid;
|
|
|
- if ($obj->fk_user_author) {
|
|
|
- $cuser = new User($this->db);
|
|
|
- $cuser->fetch($obj->fk_user_author);
|
|
|
- $this->user_creation = $cuser;
|
|
|
- }
|
|
|
-
|
|
|
- if ($obj->fk_user_valid) {
|
|
|
- $vuser = new User($this->db);
|
|
|
- $vuser->fetch($obj->fk_user_valid);
|
|
|
- $this->user_validation = $vuser;
|
|
|
- }
|
|
|
-
|
|
|
- if ($obj->fk_user_cloture) {
|
|
|
- $cluser = new User($this->db);
|
|
|
- $cluser->fetch($obj->fk_user_cloture);
|
|
|
- $this->user_cloture = $cluser;
|
|
|
- }
|
|
|
-
|
|
|
+ $this->user_creation_id = $obj->fk_user_creat;
|
|
|
+ $this->user_modification_id = $obj->fk_user_modif;
|
|
|
$this->date_creation = $this->db->jdate($obj->datec);
|
|
|
- $this->date_modification = $this->db->jdate($obj->datem);
|
|
|
- $this->date_validation = $this->db->jdate($obj->datev);
|
|
|
+ $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem);
|
|
|
}
|
|
|
-
|
|
|
$this->db->free($result);
|
|
|
} else {
|
|
|
dol_print_error($this->db);
|