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();
// TODO Supprimer cette partie. L'appelant qui fetch doit
// 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.= " p.ref";
$sql.= " FROM ".MAIN_DB_PREFIX."expeditiondet as e";
@ -239,7 +239,7 @@ class Expedition extends CommonObject
$sql.= " WHERE e.fk_expedition = ".$this->id;
$sql.= " AND e.fk_commande_ligne = c.rowid";
$sql.= " AND c.fk_product = p.rowid";
$resultp = $this->db->query($sql);
if ($resultp)
@ -281,7 +281,7 @@ class Expedition extends CommonObject
else
{
$this->error=$this->db->error();
return -1;
return -2;
}
}

View File

@ -409,9 +409,10 @@ class Livraison extends CommonObject
$expedition = new Expedition($this->db);
$result=$expedition->fetch($sending_id);
$this->lines = array();
$this->lignes = array();
$this->date_livraison = time();
$this->expedition_id = $sending_id;
for ($i = 0 ; $i < sizeof($expedition->lignes) ; $i++)
{
$LivraisonLigne = new LivraisonLigne($this->db);
@ -555,7 +556,7 @@ class Livraison extends CommonObject
{
$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 .= " FROM ".MAIN_DB_PREFIX."livraisondet as l";
$sql .= " , ".MAIN_DB_PREFIX."commandedet as c";
@ -599,6 +600,20 @@ class Livraison extends CommonObject
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;
}
}