Fix: affichage de la ref fournisseur

This commit is contained in:
Regis Houssin 2007-10-26 13:49:19 +00:00
parent 1fdce3b17b
commit 778b9633c9
2 changed files with 23 additions and 20 deletions

View File

@ -238,23 +238,17 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
// Si ligne associée à un code produit
if ($com->lignes[$i]->fk_product)
{
$prodser = new Product($this->db);
$prodser->fetch($com->lignes[$i]->fk_product);
if ($prodser->ref)
$libelleproduitservice=$outputlangs->transnoentities("Product")." ".$com->lignes[$i]->ref_fourn." - ".$libelleproduitservice;
// Ajoute description du produit
if ($conf->global->PRODUIT_DESC_IN_FORM && !$conf->global->PRODUIT_CHANGE_PROD_DESC)
{
if ($com->lignes[$i]->product_desc&&$com->lignes[$i]->product_desc!=$fac->lignes[$i]->libelle&&$com->lignes[$i]->product_desc!=$com->lignes[$i]->desc)
{
$libelleproduitservice=$outputlangs->transnoentities("Product")." ".$prodser->ref." - ".$libelleproduitservice;
if ($libelleproduitservice) $libelleproduitservice.="\n";
$libelleproduitservice.=$com->lignes[$i]->product_desc;
}
// Ajoute description du produit
if ($conf->global->PRODUIT_DESC_IN_FORM && !$conf->global->PRODUIT_CHANGE_PROD_DESC)
{
if ($com->lignes[$i]->product_desc&&$com->lignes[$i]->product_desc!=$fac->lignes[$i]->libelle&&$com->lignes[$i]->product_desc!=$com->lignes[$i]->desc)
{
if ($libelleproduitservice) $libelleproduitservice.="\n";
$libelleproduitservice.=$com->lignes[$i]->product_desc;
}
}
}
}
if ($com->lignes[$i]->date_start && $com->lignes[$i]->date_end)
{

View File

@ -112,9 +112,14 @@ class CommandeFournisseur extends Commande
// export pdf -----------
$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.= ' p.label, p.description as product_desc, p.ref, p.rowid as prodid';
$sql = 'SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.remise_percent, l.subprice';
$sql.= ', p.label, p.description as product_desc, p.rowid as prodid';
$sql.= ', pf.ref_fourn';
$sql.= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet as l';
//Todo: revoir le fonctionnement de la base produit fournisseurs
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur as pf ON l.fk_product = pf.fk_product AND l.ref = pf.ref_fourn';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid';
$sql.= ' WHERE l.fk_commande = '.$this->id;
$sql.= ' ORDER BY l.rowid';
@ -137,9 +142,11 @@ class CommandeFournisseur extends Commande
$ligne->remise_percent = $objp->remise_percent;
$ligne->price = $objp->price;
$ligne->fk_product = $objp->fk_product; // Id du produit
$ligne->libelle = $objp->label; // Label produit
$ligne->product_desc = $objp->product_desc; // Description produit
$ligne->ref = $objp->ref;
$ligne->ref_fourn = $objp->ref_fourn; // Reference supplier
$this->lignes[$i] = $ligne;
//dolibarr_syslog("1 ".$ligne->desc);
@ -1393,7 +1400,7 @@ class CommandeFournisseur extends Commande
*/
class CommandeFournisseurLigne extends CommandeLigne
{
// From llx_propaldet
// From llx_commandedet
var $qty;
var $tva_tx;
var $subprice;
@ -1405,7 +1412,9 @@ class CommandeFournisseurLigne extends CommandeLigne
// From llx_product
var $libelle; // Label produit
var $product_desc; // Description produit
var $ref;
// From llx_product_fournisseur
var $ref_fourn; // Référence fournisseur
function CommandeFournisseurLigne()
{