Fix links in box last BOM

This commit is contained in:
Maxime Kohlhaas 2021-06-27 08:40:37 +02:00
parent d86caa39e4
commit 8332385bd5

View File

@ -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'),