Fix: no stock mouvement with free line product
This commit is contained in:
parent
ec9ab24fd0
commit
b320208d3a
@ -542,6 +542,9 @@ class CommandeFournisseur extends Commande
|
|||||||
require_once(DOL_DOCUMENT_ROOT."/product/stock/mouvementstock.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/product/stock/mouvementstock.class.php");
|
||||||
|
|
||||||
for ($i = 0 ; $i < sizeof($this->lignes) ; $i++)
|
for ($i = 0 ; $i < sizeof($this->lignes) ; $i++)
|
||||||
|
{
|
||||||
|
// Product with reference
|
||||||
|
if (!empty($this->lignes[$i]->fk_product))
|
||||||
{
|
{
|
||||||
$mouvP = new MouvementStock($this->db);
|
$mouvP = new MouvementStock($this->db);
|
||||||
// We decrement stock of product (and sub-products)
|
// We decrement stock of product (and sub-products)
|
||||||
@ -550,6 +553,7 @@ class CommandeFournisseur extends Commande
|
|||||||
if ($result < 0) { $error++; }
|
if ($result < 0) { $error++; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($error == 0)
|
if ($error == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user