This commit is contained in:
Regis Houssin 2006-05-30 19:04:30 +00:00
parent 27c019bece
commit 949df6831e
2 changed files with 32 additions and 35 deletions

View File

@ -555,29 +555,26 @@ class Expedition
$resql = $this->db->query($sql);
if ($resql)
{
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$ligne = new ExpeditionLigne();
$obj = $this->db->fetch_object($resql);
$ligne->product_id = $obj->fk_product;
$ligne->qty_commande = $obj->qtycom;
$ligne->qty_expedition = $obj->qtyexp;
$ligne->description = stripslashes($obj->description);
$this->lignes[$i] = $ligne;
$i++;
}
$this->db->free($resql);
{
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$ligne = new ExpeditionLigne();
$obj = $this->db->fetch_object($resql);
$ligne->product_id = $obj->fk_product;
$ligne->qty_commande = $obj->qtycom;
$ligne->qty_expedition = $obj->qtyexp;
$ligne->description = stripslashes($obj->description);
$this->lignes[$i] = $ligne;
$i++;
}
$this->db->free($resql);
}
return $this->lignes;
}
}

View File

@ -172,29 +172,29 @@ class Livraison
function create_line($transaction, $commande_ligne_id, $qty)
{
$error = 0;
$idprod = 0;
$j = 0;
while (($j < sizeof($this->commande->lignes)) && idprod == 0)
{
if ($this->commande->lignes[$j]->id == $commande_ligne_id)
{
$idprod = $this->commande->lignes[$j]->product_id;
}
$j++;
if ($this->commande->lignes[$j]->id == $commande_ligne_id)
{
$idprod = $this->commande->lignes[$j]->product_id;
}
$j++;
}
$sql = "INSERT INTO ".MAIN_DB_PREFIX."livraisondet (fk_livraison, fk_commande_ligne, qty)";
$sql .= " VALUES ($this->id,".$commande_ligne_id.",".$qty.")";
if (! $this->db->query($sql) )
$sql = "INSERT INTO ".MAIN_DB_PREFIX."livraisondet (fk_livraison, fk_commande_ligne, qty)";
$sql .= " VALUES ($this->id,".$commande_ligne_id.",".$qty.")";
if (! $this->db->query($sql) )
{
$error++;
$error++;
}
if ($error == 0 )
if ($error == 0 )
{
return 1;
return 1;
}
}