diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 1109c93fad9..eebd5a35c4f 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5129,6 +5129,13 @@ class Product extends CommonObject include_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; + if ($nbpiece < 0) { + if (!$movement) { + $movement = 1; + } + $nbpiece *= -1; + } + $op[0] = "+".trim($nbpiece); $op[1] = "-".trim($nbpiece); @@ -5176,6 +5183,13 @@ class Product extends CommonObject include_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; + if ($nbpiece < 0) { + if (!$movement) { + $movement = 1; + } + $nbpiece *= -1; + } + $op[0] = "+".trim($nbpiece); $op[1] = "-".trim($nbpiece);