Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into 12.0

This commit is contained in:
Laurent Destailleur 2021-07-02 16:05:59 +02:00
commit d03cbd88ae
2 changed files with 2 additions and 2 deletions

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 = price2num(($line->qty / $bom->qty) * $this->qty / $line->efficiency, 'MS'); // Calculate with Qty to produce and more presition
$moline->qty = price2num(($line->qty / ( ! empty($bom->qty) ? $bom->qty : 1 ) ) * $this->qty / ( ! empty($line->efficiency) ? $line->efficiency : 1 ), 'MS'); // Calculate with Qty to produce and more presition
}
if ($moline->qty <= 0) {
$error++;

View File

@ -25,7 +25,7 @@ if (empty($conf) || !is_object($conf))
if (!is_object($form)) $form = new Form($db);
$qtytoconsumeforline = $this->tpl['qty'] / $this->tpl['efficiency'];
$qtytoconsumeforline = $this->tpl['qty'] / ( ! empty($this->tpl['efficiency']) ? $this->tpl['efficiency'] : 1 );
/*if ((empty($this->tpl['qty_frozen']) && $this->tpl['qty_bom'] > 1)) {
$qtytoconsumeforline = $qtytoconsumeforline / $this->tpl['qty_bom'];
}*/