Don't display collapse if no bom on bomline

This commit is contained in:
atm-lena 2022-02-17 11:05:03 +01:00
parent c519497608
commit c2bc3b20bb

View File

@ -45,10 +45,12 @@ print '<tr class="oddeven'.(empty($this->tpl['strike']) ? '' : ' strikefordisabl
print '<td>';
if ($res) {
print $tmpproduct->getNomUrl(1);
print ' '.$langs->trans("or").' ';
print $tmpbom->getNomUrl(1);
print ' <a class="collapse_bom" id="collapse-'.$line->id.'" href="#">';
print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open'));
if($tmpbom->id) {
print ' ' . $langs->trans("or") . ' ';
print $tmpbom->getNomUrl(1);
print ' <a class="collapse_bom" id="collapse-' . $line->id . '" href="#">';
print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open'));
}
print '</a>';
} else {
print $this->tpl['label'];
@ -92,6 +94,7 @@ $resql = $this->db->query($sql);
if ($resql) {
// Loop on all the sub-BOM lines if they exist
while ($obj = $this->db->fetch_object($resql)) {
$sub_bom_product = new Product($this->db);
$sub_bom_product->fetch($obj->fk_product);
$sub_bom_product->load_stock();