diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 1fd60907763..65ba9597b8a 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2020 Lenin Rivas * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify @@ -590,7 +591,7 @@ class Mo extends CommonObject } /** - * Erase and update the line to produce. + * Erase and update the line to consume and to produce. * * @param User $user User that modifies * @param bool $notrigger false=launch triggers after, true=disable triggers @@ -648,7 +649,7 @@ class Mo extends CommonObject if ($line->qty_frozen) { $moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce } else { - $moline->qty = round($line->qty * $this->qty / $line->efficiency, 2); + $moline->qty = price2num(($line->qty / $bom->qty) * $this->qty / $line->efficiency, 'MS'); // Calculate with Qty to produce and more presition } if ($moline->qty <= 0) { $error++;