This commit is contained in:
Regis Houssin 2006-10-05 06:56:30 +00:00
parent e4b14d086c
commit e4416b40dd
2 changed files with 20 additions and 5 deletions

View File

@ -230,7 +230,7 @@ class Expedition extends CommonObject
$this->lignes = array(); $this->lignes = array();
// TODO Supprimer cette partie. L'appelant qui fetch doit // TODO Supprimer cette partie. L'appelant qui fetch doit
// en fait appeler fetch_lignes pour charges ceci. // en fait appeler fetch_lignes pour charges ceci.
$sql = "SELECT c.description, c.qty as qtycom, c.fk_product, c.label, "; $sql = "SELECT c.description, c.qty as qtycom, c.fk_product, p.label, ";
$sql.= " e.qty as qtyexp, e.fk_commande_ligne,"; $sql.= " e.qty as qtyexp, e.fk_commande_ligne,";
$sql.= " p.ref"; $sql.= " p.ref";
$sql.= " FROM ".MAIN_DB_PREFIX."expeditiondet as e"; $sql.= " FROM ".MAIN_DB_PREFIX."expeditiondet as e";
@ -281,7 +281,7 @@ class Expedition extends CommonObject
else else
{ {
$this->error=$this->db->error(); $this->error=$this->db->error();
return -1; return -2;
} }
} }

View File

@ -409,9 +409,10 @@ class Livraison extends CommonObject
$expedition = new Expedition($this->db); $expedition = new Expedition($this->db);
$result=$expedition->fetch($sending_id); $result=$expedition->fetch($sending_id);
$this->lines = array(); $this->lignes = array();
$this->date_livraison = time(); $this->date_livraison = time();
$this->expedition_id = $sending_id; $this->expedition_id = $sending_id;
for ($i = 0 ; $i < sizeof($expedition->lignes) ; $i++) for ($i = 0 ; $i < sizeof($expedition->lignes) ; $i++)
{ {
$LivraisonLigne = new LivraisonLigne($this->db); $LivraisonLigne = new LivraisonLigne($this->db);
@ -555,7 +556,7 @@ class Livraison extends CommonObject
{ {
$this->lignes = array(); $this->lignes = array();
$sql = "SELECT c.label, c.description, c.qty as qtycom, l.qty as qtyliv"; $sql = "SELECT p.label, c.description, c.qty as qtycom, l.qty as qtyliv";
$sql .= ", c.fk_product, c.price, p.ref"; $sql .= ", c.fk_product, c.price, p.ref";
$sql .= " FROM ".MAIN_DB_PREFIX."livraisondet as l"; $sql .= " FROM ".MAIN_DB_PREFIX."livraisondet as l";
$sql .= " , ".MAIN_DB_PREFIX."commandedet as c"; $sql .= " , ".MAIN_DB_PREFIX."commandedet as c";
@ -599,6 +600,20 @@ class Livraison extends CommonObject
class LivraisonLigne class LivraisonLigne
{ {
var $db;
// From llx_expeditiondet
var $qty;
var $fk_product;
var $commande_ligne_id;
var $libelle; // Label produit
var $description; // Description produit
var $ref;
function LivraisonLigne($DB)
{
$this->db=$DB;
}
} }