From 293b67a693bb543f37756a03b84cd1fc777f8158 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 23 Jun 2021 13:08:05 +0200 Subject: [PATCH] Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop Conflicts: htdocs/compta/cashcontrol/report.php --- .../inventory/class/inventory.class.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 47b902d70cc..1adc9189892 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -643,25 +643,27 @@ class Inventory extends CommonObject if ($result) { if ($this->db->num_rows($result)) { $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; - if ($obj->fk_user_creat) { + + if ($obj->fk_user_creat > 0) { $cuser = new User($this->db); $cuser->fetch($obj->fk_user_creat); $this->user_creation = $cuser; } - if ($obj->fk_user_valid) { + if ($obj->fk_user_modif > 0) { + $muser = new User($this->db); + $muser->fetch($obj->fk_user_modif); + $this->user_creation = $muser; + } + + if ($obj->fk_user_valid > 0) { $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->date_creation = $this->db->jdate($obj->datec); $this->date_modification = $this->db->jdate($obj->datem); $this->date_validation = $this->db->jdate($obj->datev);