fixes the creation of a stock movement
This fixes the creation of a stock movement by supporting the DLC and DLUO. [see: #12883]
This commit is contained in:
parent
0ebed529e1
commit
5687d26f95
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user