FIX #20733 Inventory: Do not use batch qty even if present if batch module is disabled.
This commit is contained in:
parent
134113db64
commit
f0e65e8bdd
@ -306,9 +306,14 @@ class Inventory extends CommonObject
|
|||||||
$inventoryline->fk_warehouse = $obj->fk_warehouse;
|
$inventoryline->fk_warehouse = $obj->fk_warehouse;
|
||||||
$inventoryline->fk_product = $obj->fk_product;
|
$inventoryline->fk_product = $obj->fk_product;
|
||||||
$inventoryline->batch = $obj->batch;
|
$inventoryline->batch = $obj->batch;
|
||||||
$inventoryline->qty_stock = ($obj->batch ? $obj->qty : $obj->reel); // If there is batch detail, we take qty for batch, else global qty
|
|
||||||
$inventoryline->datec = dol_now();
|
$inventoryline->datec = dol_now();
|
||||||
|
|
||||||
|
if ($conf->productbatch->enabled) {
|
||||||
|
$inventoryline->qty_stock = ($obj->batch ? $obj->qty : $obj->reel); // If there is batch detail, we take qty for batch, else global qty
|
||||||
|
}else{
|
||||||
|
$inventoryline->qty_stock = $obj->reel;
|
||||||
|
}
|
||||||
|
|
||||||
$resultline = $inventoryline->create($user);
|
$resultline = $inventoryline->create($user);
|
||||||
if ($resultline <= 0) {
|
if ($resultline <= 0) {
|
||||||
$this->error = $inventoryline->error;
|
$this->error = $inventoryline->error;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user