Fix calculator to consume with to produce
i.e. to produce 100 then Order can be produce 135.
This commit is contained in:
parent
fd63e3b21a
commit
f3ebc33d1e
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* Copyright (C) 2020 Lenin Rivas <lenin@leninrivas.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -648,7 +648,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 = round($line->qty * ($this->qty / $bom->qty) / $line->efficiency, 4); // Calculate with Qty to produce and more presition
|
||||
}
|
||||
if ($moline->qty <= 0) {
|
||||
$error++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user