Update mo.class.php

Use the accuracy of stock for rounding
This commit is contained in:
Laurent Destailleur 2020-04-22 12:32:20 +02:00 committed by GitHub
parent b469775718
commit 1788b1b252
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -649,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 / $bom->qty) / $line->efficiency, 8); // Calculate with Qty to produce and more presition
$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++;