Fix: Regression. La description des produits s'affiche si constante FAC_ADD_PROD_DESC ou PROP_ADD_PROD_DESC définie

This commit is contained in:
Laurent Destailleur 2006-01-04 20:20:05 +00:00
parent 6ae529e9b1
commit c063482d49
2 changed files with 26 additions and 6 deletions

View File

@ -189,24 +189,34 @@ class pdf_crabe extends ModelePDFFactures
{ {
$curY = $nexY; $curY = $nexY;
// Description produit // Description de la ligne produit
$libelleproduitservice=$fac->lignes[$i]->libelle; $libelleproduitservice=$fac->lignes[$i]->libelle;
if ($fac->lignes[$i]->product_desc&&$fac->lignes[$i]->product_desc!=$fac->lignes[$i]->libelle) if ($fac->lignes[$i]->product_desc&&$fac->lignes[$i]->product_desc!=$fac->lignes[$i]->libelle)
{ {
if ($libelleproduitservice) $libelleproduitservice.="\n"; if ($libelleproduitservice) $libelleproduitservice.="\n";
$libelleproduitservice.=$fac->lignes[$i]->product_desc; $libelleproduitservice.=$fac->lignes[$i]->product_desc;
} }
// Si ligne associée à un code produit
if ($fac->lignes[$i]->produit_id) if ($fac->lignes[$i]->produit_id)
{ {
// Affiche code produit si ligne associée à un code produit
$prodser = new Product($this->db); $prodser = new Product($this->db);
$prodser->fetch($fac->lignes[$i]->produit_id); $prodser->fetch($fac->lignes[$i]->produit_id);
if ($prodser->ref) { if ($prodser->ref) {
$libelleproduitservice=$langs->trans("Product")." ".$prodser->ref." - ".$libelleproduitservice; $libelleproduitservice=$langs->trans("Product")." ".$prodser->ref." - ".$libelleproduitservice;
} }
// Ajoute description du produit
if ($conf->global->FAC_ADD_PROD_DESC)
{
if ($fac->lignes[$i]->product_desc&&$fac->lignes[$i]->product_desc!=$fac->lignes[$i]->libelle&&$fac->lignes[$i]->product_desc!=$fac->lignes[$i]->desc)
{
if ($libelleproduitservice) $libelleproduitservice.="\n";
$libelleproduitservice.=$fac->lignes[$i]->product_desc;
}
}
} }
if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end) { if ($fac->lignes[$i]->date_start && $fac->lignes[$i]->date_end) {
// Affichage durée si il y en a une // Affichage durée si il y en a une
$libelleproduitservice.="\n(".$langs->trans("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start)." ".$langs->trans("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end).")"; $libelleproduitservice.="\n(".$langs->trans("From")." ".dolibarr_print_date($fac->lignes[$i]->date_start)." ".$langs->trans("to")." ".dolibarr_print_date($fac->lignes[$i]->date_end).")";

View File

@ -26,6 +26,7 @@
\brief Fichier de la classe permettant de générer les propales au modèle Azur \brief Fichier de la classe permettant de générer les propales au modèle Azur
\author Laurent Destailleur \author Laurent Destailleur
\version $Revision$ \version $Revision$
\version $Revision$
*/ */
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php");
@ -196,17 +197,16 @@ class pdf_propale_azur extends ModelePDFPropales
{ {
$curY = $nexY; $curY = $nexY;
// Description produit // Description de la ligne produit
$libelleproduitservice=$prop->lignes[$i]->libelle; $libelleproduitservice=$prop->lignes[$i]->libelle;
if ($prop->lignes[$i]->product_desc&&$prop->lignes[$i]->product_desc!=$prop->lignes[$i]->libelle) if ($prop->lignes[$i]->product_desc&&$prop->lignes[$i]->product_desc!=$prop->lignes[$i]->libelle)
{ {
if ($libelleproduitservice) $libelleproduitservice.="\n"; if ($libelleproduitservice) $libelleproduitservice.="\n";
$libelleproduitservice.=$prop->lignes[$i]->product_desc; $libelleproduitservice.=$prop->lignes[$i]->product_desc;
} }
// Si ligne associée à un code produit
if ($prop->lignes[$i]->product_id) if ($prop->lignes[$i]->product_id)
{ {
// Affiche code produit si ligne associée à un code produit
$prodser = new Product($this->db); $prodser = new Product($this->db);
$prodser->fetch($prop->lignes[$i]->product_id); $prodser->fetch($prop->lignes[$i]->product_id);
@ -214,6 +214,16 @@ class pdf_propale_azur extends ModelePDFPropales
{ {
$libelleproduitservice=$langs->trans("Product")." ".$prodser->ref." - ".$libelleproduitservice; $libelleproduitservice=$langs->trans("Product")." ".$prodser->ref." - ".$libelleproduitservice;
} }
// Ajoute description du produit
if ($conf->global->PROP_ADD_PROD_DESC)
{
if ($prop->lignes[$i]->product_desc&&$prop->lignes[$i]->product_desc!=$fac->lignes[$i]->libelle&&$prop->lignes[$i]->product_desc!=$prop->lignes[$i]->desc)
{
if ($libelleproduitservice) $libelleproduitservice.="\n";
$libelleproduitservice.=$prop->lignes[$i]->product_desc;
}
}
} }
if ($prop->lignes[$i]->date_start && $prop->lignes[$i]->date_end) if ($prop->lignes[$i]->date_start && $prop->lignes[$i]->date_end)
{ {