ajout de la rfrence interne du produit et de la rfrence fournisseur dans la liste droulante ainsi que dans la fiche.
La rfrence fournisseur est entre parenthese.
This commit is contained in:
Regis Houssin 2007-04-24 11:09:55 +00:00
parent 27cf70f71a
commit 9992a2fa5d
6 changed files with 32 additions and 22 deletions

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005 Regis Houssin <regis.houssin@cap-networks.com>
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@cap-networks.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -610,8 +610,10 @@ else
$sql = "SELECT l.ref, l.fk_product, l.description, l.price, l.qty";
$sql.= ", l.rowid, l.tva_tx, l.remise_percent, l.subprice";
$sql.= ", p.label";
$sql.= ", pf.ref_fourn";
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseurdet as l";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON l.fk_product = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur as pf ON l.fk_product = pf.fk_product";
$sql.= " WHERE l.fk_commande = ".$commande->id;
$sql.= " ORDER BY l.rowid";
@ -639,7 +641,7 @@ else
print "<tr $bc[$var]>";
print '<td>';
print '<a href="'.DOL_URL_ROOT.'/product/fournisseurs.php?id='.$objp->fk_product.'">'.img_object($langs->trans("ShowProduct"),'product').' '.$objp->ref.'</a>';
print ' - '.$objp->label;
print ' ('.$objp->ref_fourn.') - '.$objp->label;
if ($objp->description) print '<br>'.nl2br($objp->description);
print "</td>";
print '<td align="center">'.$objp->tva_tx.'%</td>';

View File

@ -735,8 +735,8 @@ else
{
$productstatic->id=$fac->lignes[$i]->fk_product;
$productstatic->type=1;
$productstatic->ref=$fac->lignes[$i]->libelle;
print $productstatic->getNomUrl(1);
$productstatic->ref=$fac->lignes[$i]->ref;
print $productstatic->getNomUrl(1).' ('.$fac->lignes[$i]->ref_fourn.') - '.$fac->lignes[$i]->libelle;
}
else
{

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@cap-networks.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -210,9 +211,11 @@ class FactureFournisseur extends Facture
*/
$sql = 'SELECT f.rowid, f.description, f.pu_ht, f.qty, f.tva_taux, f.tva,';
$sql.= ' f.total_ht, f.tva as total_tva, f.total_ttc, f.fk_product,';
$sql.= ' p.label as label, p.description as product_desc';
$sql.= ' p.ref, p.label as label, p.description as product_desc,';
$sql.= ' pf.ref_fourn';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det as f';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON f.fk_product = p.rowid';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_fournisseur as pf ON f.fk_product = pf.fk_product';
$sql.= ' WHERE fk_facture_fourn='.$this->id;
dolibarr_syslog("FactureFourn::Fetch search lines sql=".$sql, LOG_DEBUG);
@ -226,18 +229,20 @@ class FactureFournisseur extends Facture
while ($i < $num_rows)
{
$obj = $this->db->fetch_object($resql_rows);
$this->lignes[$i]->rowid = $obj->rowid;
$this->lignes[$i]->description = $obj->description;
$this->lignes[$i]->libelle = $obj->label; // Label produit
$this->lignes[$i]->product_desc = $obj->product_desc; // Description produit
$this->lignes[$i]->pu_ht = $obj->pu_ht;
$this->lignes[$i]->tva_taux = $obj->tva_taux;
$this->lignes[$i]->qty = $obj->qty;
$this->lignes[$i]->tva = $obj->tva;
$this->lignes[$i]->total_ht = $obj->total_ht;
$this->lignes[$i]->total_tva = $obj->total_tva;
$this->lignes[$i]->total_ttc = $obj->total_ttc;
$this->lignes[$i]->fk_product = $obj->fk_product;
$this->lignes[$i]->rowid = $obj->rowid;
$this->lignes[$i]->description = $obj->description;
$this->lignes[$i]->ref = $obj->ref; // Reference interne du produit
$this->lignes[$i]->ref_fourn = $obj->ref_fourn; // Reference fournisseur du produit
$this->lignes[$i]->libelle = $obj->label; // Label du produit
$this->lignes[$i]->product_desc = $obj->product_desc; // Description du produit
$this->lignes[$i]->pu_ht = $obj->pu_ht;
$this->lignes[$i]->tva_taux = $obj->tva_taux;
$this->lignes[$i]->qty = $obj->qty;
$this->lignes[$i]->tva = $obj->tva;
$this->lignes[$i]->total_ht = $obj->total_ht;
$this->lignes[$i]->total_tva = $obj->total_tva;
$this->lignes[$i]->total_ttc = $obj->total_ttc;
$this->lignes[$i]->fk_product = $obj->fk_product;
$i++;
}
}

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@cap-networks.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@ -929,11 +929,14 @@ class Form
{
global $langs,$conf;
$sql = "SELECT p.rowid, p.label, p.ref, p.price, pf.price as fprice, pf.quantity, p.duration";
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,";
$sql.= " pf.ref_fourn,";
$sql.= " pfp.price as fprice, pfp.quantity";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pf ON p.rowid = pf.fk_product";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur as pf ON p.rowid = pf.fk_product";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
$sql.= " WHERE p.envente = 1";
if ($socid) $sql.= " AND pf.fk_soc = ".$socid;
if ($socid) $sql.= " AND pfp.fk_soc = ".$socid;
if ($filtretype && $filtretype != '') $sql.=" AND p.fk_product_type=".$filtretype;
if ($filtre) $sql.="$filtre";
$sql.= " ORDER BY p.ref DESC";
@ -955,7 +958,7 @@ class Form
$opt = '<option value="'.$objp->rowid.'"';
if ($selected == $objp->rowid) $opt.= ' selected="true"';
$opt.= '>'.$objp->ref.' - ';
$opt.= '>'.$objp->ref.' ('.$objp->ref_fourn.') - ';
$opt.= dolibarr_trunc($objp->label,24).' - ';
$opt.= $objp->fprice.$langs->trans("Currency".$conf->monnaie)."/".$objp->quantity.$langs->trans("Units");
if ($objp->quantity > 1)