Don't display collapse if no bom on bomline
This commit is contained in:
parent
c519497608
commit
c2bc3b20bb
@ -45,10 +45,12 @@ print '<tr class="oddeven'.(empty($this->tpl['strike']) ? '' : ' strikefordisabl
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
if ($res) {
|
if ($res) {
|
||||||
print $tmpproduct->getNomUrl(1);
|
print $tmpproduct->getNomUrl(1);
|
||||||
print ' '.$langs->trans("or").' ';
|
if($tmpbom->id) {
|
||||||
print $tmpbom->getNomUrl(1);
|
print ' ' . $langs->trans("or") . ' ';
|
||||||
print ' <a class="collapse_bom" id="collapse-'.$line->id.'" href="#">';
|
print $tmpbom->getNomUrl(1);
|
||||||
print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open'));
|
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>';
|
print '</a>';
|
||||||
} else {
|
} else {
|
||||||
print $this->tpl['label'];
|
print $this->tpl['label'];
|
||||||
@ -92,6 +94,7 @@ $resql = $this->db->query($sql);
|
|||||||
if ($resql) {
|
if ($resql) {
|
||||||
// Loop on all the sub-BOM lines if they exist
|
// Loop on all the sub-BOM lines if they exist
|
||||||
while ($obj = $this->db->fetch_object($resql)) {
|
while ($obj = $this->db->fetch_object($resql)) {
|
||||||
|
|
||||||
$sub_bom_product = new Product($this->db);
|
$sub_bom_product = new Product($this->db);
|
||||||
$sub_bom_product->fetch($obj->fk_product);
|
$sub_bom_product->fetch($obj->fk_product);
|
||||||
$sub_bom_product->load_stock();
|
$sub_bom_product->load_stock();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user