diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index b921e23d64d38..a512e13aea524 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -332,8 +332,11 @@ $resql_supplier_price = $object->db->query($sql_supplier_price); if ($resql_supplier_price) { $obj = $object->db->fetch_object($resql_supplier_price); - $line_cost = $obj->min_price/$obj->qty * $sub_bom_line->qty * $line->qty; - + if (!empty($obj->qty) && !empty($sub_bom_line->qty) && !empty($line->qty)) { + $line_cost = $obj->min_price/$obj->qty * $sub_bom_line->qty * $line->qty; + } else { + $line_cost = $obj->min_price; + } print '