From 5687d26f955156a0d54586ca9d169c0725120f73 Mon Sep 17 00:00:00 2001 From: Laurent De Coninck Date: Fri, 17 Jan 2020 17:21:14 +0100 Subject: [PATCH] fixes the creation of a stock movement This fixes the creation of a stock movement by supporting the DLC and DLUO. [see: #12883] --- htdocs/product/stock/class/api_stockmovements.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/api_stockmovements.class.php b/htdocs/product/stock/class/api_stockmovements.class.php index cfa901bce30..c199bfdf676 100644 --- a/htdocs/product/stock/class/api_stockmovements.class.php +++ b/htdocs/product/stock/class/api_stockmovements.class.php @@ -192,13 +192,15 @@ class StockMovements extends DolibarrApi if ($field == 'movementcode') $movementcode = $value; if ($field == 'movementlabel') $movementlabel = $value; if ($field == 'price') $price = $value; + if ($field == 'dlc') $dlc = $value; + if ($field == 'dluo') $dluo = $value; } // Type increase or decrease if ($qty >= 0) $type = 3; else $type = 2; - if($this->stockmovement->_create(DolibarrApiAccess::$user, $product_id, $warehouse_id, $qty, $type, $price, $movementlabel, $movementcode, '', '', '', $lot) <= 0) { + if($this->stockmovement->_create(DolibarrApiAccess::$user, $product_id, $warehouse_id, $qty, $type, $price, $movementlabel, $movementcode, '', $dlc, $dluo, $lot) <= 0) { throw new RestException(503, 'Error when create stock movement : '.$this->stockmovement->error); }