récupération de l'id de la commande

This commit is contained in:
Regis Houssin 2006-05-31 08:09:02 +00:00
parent 8eb8984c1c
commit 61e231b2c9

View File

@ -959,7 +959,7 @@ class Commande
function fetch_lignes($only_product=0) function fetch_lignes($only_product=0)
{ {
$this->lignes = array(); $this->lignes = array();
$sql = 'SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice'; $sql = 'SELECT l.fk_product, l.fk_commande, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice';
if ($only_product==1) if ($only_product==1)
{ {
$sql .= ' FROM '.MAIN_DB_PREFIX.'commandedet as l'; $sql .= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
@ -984,6 +984,7 @@ class Commande
$ligne = new CommandeLigne(); $ligne = new CommandeLigne();
$objp = $this->db->fetch_object($result); $objp = $this->db->fetch_object($result);
$ligne->id = $objp->rowid; $ligne->id = $objp->rowid;
$ligne->commande_id = $objp->fk_commande;
$ligne->qty = $objp->qty; $ligne->qty = $objp->qty;
$ligne->price = $objp->price; $ligne->price = $objp->price;
$ligne->tva_tx = $objp->tva_tx; $ligne->tva_tx = $objp->tva_tx;