Merge pull request #18070 from altairisfr/fixof
FIX : division by zero on of create
This commit is contained in:
commit
cc54ba1866
@ -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++;
|
||||
|
||||
@ -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'];
|
||||
}*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user