From a63d3364b4bdd72b40c0fbe5739747d4b18d2cc9 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 6 Jun 2021 22:51:27 +0200 Subject: [PATCH 1/4] Fix links in box last MO --- htdocs/core/boxes/box_mos.php | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/htdocs/core/boxes/box_mos.php b/htdocs/core/boxes/box_mos.php index 43d1cd411e4..d7f7a8f72ae 100644 --- a/htdocs/core/boxes/box_mos.php +++ b/htdocs/core/boxes/box_mos.php @@ -86,12 +86,15 @@ class box_mos extends ModeleBoxes if ($user->rights->mrp->read) { $sql = "SELECT p.ref as product_ref"; + $sql .= ", p.rowid as productid"; + $sql .= ", p.tosell"; + $sql .= ", p.tobuy"; + $sql .= ", p.tobatch"; $sql .= ", c.rowid"; $sql .= ", c.date_creation"; $sql .= ", c.tms"; $sql .= ", c.ref"; $sql .= ", c.status"; - //$sql.= ", c.fk_user_valid"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; $sql .= ", ".MAIN_DB_PREFIX."mrp_mo as c"; $sql .= " WHERE c.fk_product = p.rowid"; @@ -110,9 +113,12 @@ class box_mos extends ModeleBoxes $datem = $this->db->jdate($objp->tms); $mostatic->id = $objp->rowid; $mostatic->ref = $objp->ref; - $mostatic->id = $objp->socid; $mostatic->status = $objp->status; + $productstatic->id = $objp->productid; $productstatic->ref = $objp->product_ref; + $productstatic->status = $objp->tosell; + $productstatic->status_buy = $objp->tobuy; + $productstatic->status_batch = $objp->tobatch; $this->info_box_contents[$line][] = array( 'td' => 'class="nowraponall"', @@ -126,17 +132,6 @@ class box_mos extends ModeleBoxes 'asis' => 1, ); - if (!empty($conf->global->MRP_BOX_LAST_MOS_SHOW_VALIDATE_USER)) { - if ($objp->fk_user_valid > 0) { - $userstatic->fetch($objp->fk_user_valid); - } - $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => (($objp->fk_user_valid > 0) ? $userstatic->getNomUrl(1) : ''), - 'asis' => 1, - ); - } - $this->info_box_contents[$line][] = array( 'td' => 'class="center nowraponall"', 'text' => dol_print_date($datem, 'day', 'tzuserrel'), From 8332385bd5962eee9fbe2ad48c8d8276fa8299ad Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 27 Jun 2021 08:40:37 +0200 Subject: [PATCH 2/4] Fix links in box last BOM --- htdocs/core/boxes/box_boms.php | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/htdocs/core/boxes/box_boms.php b/htdocs/core/boxes/box_boms.php index ee248d0a083..23e525fc00b 100644 --- a/htdocs/core/boxes/box_boms.php +++ b/htdocs/core/boxes/box_boms.php @@ -85,7 +85,11 @@ class box_boms extends ModeleBoxes $this->info_box_head = array('text' => $langs->trans("BoxTitleLatestModifiedBoms", $max)); if ($user->rights->bom->read) { - $sql = "SELECT p.ref as product_ref, p.tobuy, p.tosell"; + $sql = "SELECT p.ref as product_ref"; + $sql .= ", p.rowid as productid"; + $sql .= ", p.tosell"; + $sql .= ", p.tobuy"; + $sql .= ", p.tobatch"; $sql .= ", c.rowid"; $sql .= ", c.date_creation"; $sql .= ", c.tms"; @@ -111,12 +115,13 @@ class box_boms extends ModeleBoxes $bomstatic->id = $objp->rowid; $bomstatic->ref = $objp->ref; - $bomstatic->id = $objp->socid; $bomstatic->status = $objp->status; + $productstatic->id = $objp->productid; $productstatic->ref = $objp->product_ref; - $productstatic->status = $objp->tobuy; - $productstatic->status_buy = $objp->tosell; + $productstatic->status = $objp->tosell; + $productstatic->status_buy = $objp->tobuy; + $productstatic->status_batch = $objp->tobatch; $this->info_box_contents[$line][] = array( 'td' => 'class="nowraponall"', @@ -130,17 +135,6 @@ class box_boms extends ModeleBoxes 'asis' => 1, ); - if (!empty($conf->global->BOM_BOX_LAST_BOMS_SHOW_VALIDATE_USER)) { - if ($objp->fk_user_valid > 0) { - $userstatic->fetch($objp->fk_user_valid); - } - $this->info_box_contents[$line][] = array( - 'td' => 'class="right"', - 'text' => (($objp->fk_user_valid > 0) ? $userstatic->getNomUrl(1) : ''), - 'asis' => 1, - ); - } - $this->info_box_contents[$line][] = array( 'td' => 'class="right"', 'text' => dol_print_date($datem, 'day', 'tzuserrel'), From 474df5fef29c85a7aa28204a17f1002542a8db33 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jun 2021 15:41:21 +0200 Subject: [PATCH 3/4] Update box_boms.php --- htdocs/core/boxes/box_boms.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/core/boxes/box_boms.php b/htdocs/core/boxes/box_boms.php index 23e525fc00b..fb0bdeb0625 100644 --- a/htdocs/core/boxes/box_boms.php +++ b/htdocs/core/boxes/box_boms.php @@ -135,6 +135,17 @@ class box_boms extends ModeleBoxes 'asis' => 1, ); + if (!empty($conf->global->BOM_BOX_LAST_BOMS_SHOW_VALIDATE_USER)) { + if ($objp->fk_user_valid > 0) { + $userstatic->fetch($objp->fk_user_valid); + } + $this->info_box_contents[$line][] = array( + 'td' => 'class="right"', + 'text' => (($objp->fk_user_valid > 0) ? $userstatic->getNomUrl(1) : ''), + 'asis' => 1, + ); + } + $this->info_box_contents[$line][] = array( 'td' => 'class="right"', 'text' => dol_print_date($datem, 'day', 'tzuserrel'), From ab4dbcf5aecadae3a36130a82914f0531941031b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jun 2021 15:41:48 +0200 Subject: [PATCH 4/4] Update box_mos.php --- htdocs/core/boxes/box_mos.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/htdocs/core/boxes/box_mos.php b/htdocs/core/boxes/box_mos.php index 171d129dbd3..8305bbabf32 100644 --- a/htdocs/core/boxes/box_mos.php +++ b/htdocs/core/boxes/box_mos.php @@ -132,6 +132,17 @@ class box_mos extends ModeleBoxes 'asis' => 1, ); + if (!empty($conf->global->MRP_BOX_LAST_MOS_SHOW_VALIDATE_USER)) { + if ($objp->fk_user_valid > 0) { + $userstatic->fetch($objp->fk_user_valid); + } + $this->info_box_contents[$line][] = array( + 'td' => 'class="right"', + 'text' => (($objp->fk_user_valid > 0) ? $userstatic->getNomUrl(1) : ''), + 'asis' => 1, + ); + } + $this->info_box_contents[$line][] = array( 'td' => 'class="center nowraponall"', 'text' => dol_print_date($datem, 'day', 'tzuserrel'),