From b666ec2142109cb383865337a7c59318d2595dd4 Mon Sep 17 00:00:00 2001 From: Ilias Patsiaouras Date: Fri, 18 Mar 2022 13:46:40 +0100 Subject: [PATCH] removing dead code free and bom lines are MO lines --- htdocs/mrp/mo_production.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 6a5c41b77c5..0be343dbf6d 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -808,7 +808,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $tmpproduct->fetch($line->fk_product); $linecost = price2num($tmpproduct->pmp, 'MT'); - if ($line->origin_type == 'free' && $object->qty > 0) { + if ($object->qty > 0) { // add free consume line cost to bomcost $costprice = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp); if (empty($costprice)) { @@ -822,12 +822,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } $linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT'); $bomcost += $linecost; - } elseif ($line->origin_id > 0 && $line->origin_type == 'bom' && $object->qty > 0) { - foreach ($bom->lines as $bomline) { - if ($bomline->id == $line->origin_id) { - $linecost = price2num(($line->qty * $bomline->unit_cost) / $object->qty, 'MT'); - } - } } $bomcost = price2num($bomcost, 'MU');