diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 26764072956..d31e21e635b 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -149,13 +149,13 @@ if (empty($reshook)) { // Set if we used free entry or predefined product $bom_child_id = (int) GETPOST('bom_id', 'int'); - if($bom_child_id > 0){ - $bom_child = new BOM($db); - $res = $bom_child->fetch($bom_child_id); - if($res){ - $idprod = $bom_child->fk_product; - } - } else { + if ($bom_child_id > 0) { + $bom_child = new BOM($db); + $res = $bom_child->fetch($bom_child_id); + if ($res) { + $idprod = $bom_child->fk_product; + } + } else { $idprod = (int) GETPOST('idprod', 'int'); } diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 6f170fb066b..4923e9d0ca2 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1064,7 +1064,7 @@ class BOM extends CommonObject $tmpproduct->cost_price = 0; $tmpproduct->pmp = 0; - if(empty($line->fk_bom_child)){ + if (empty($line->fk_bom_child)) { $result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading if ($result < 0) { $this->error = $tmpproduct->error; @@ -1083,7 +1083,7 @@ class BOM extends CommonObject } else { $bom_child= new BOM($this->db); $res = $bom_child->fetch($line->fk_bom_child); - if($res>0){ + if ($res>0) { $bom_child->calculateCosts(); $this->total_cost += $bom_child->total_cost; } else { diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index e8550e9d6b6..4360d521036 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -85,8 +85,8 @@ $res = $tmpbom->fetch($line->fk_bom_child); if ($tmpbom->id > 0) { print '' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . ' '; print $tmpproduct->getNomUrl(1); - print ' '.$langs->trans('or').' '; - print $tmpbom->getNomUrl(1); + print ' '.$langs->trans('or').' '; + print $tmpbom->getNomUrl(1); } else { print $tmpproduct->getNomUrl(1); print ' - '.$tmpproduct->label; @@ -203,14 +203,14 @@ if ($resql) { // Product OR BOM print '