Fix: no stock mouvement with free line product

This commit is contained in:
Regis Houssin 2009-11-05 20:25:10 +00:00
parent ec9ab24fd0
commit b320208d3a

View File

@ -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)
{ {