Skip to content
Snippets Groups Projects
Commit 5229690a authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

New: Ajoute code produit sur propal azur si parametre PROPALE_CODEPRODUITSERVICE defini.

parent 35e9b880
Branches
No related tags found
No related merge requests found
...@@ -42,7 +42,7 @@ class pdf_propale_azur extends ModelePDFPropales ...@@ -42,7 +42,7 @@ class pdf_propale_azur extends ModelePDFPropales
\brief Constructeur \brief Constructeur
\param db Handler accs base de donne \param db Handler accs base de donne
*/ */
function pdf_propale_azur($db=0) function pdf_propale_azur($db)
{ {
global $langs; global $langs;
...@@ -158,29 +158,35 @@ class pdf_propale_azur extends ModelePDFPropales ...@@ -158,29 +158,35 @@ class pdf_propale_azur extends ModelePDFPropales
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
$nblignes = sizeof($prop->lignes); $nblignes = sizeof($prop->lignes);
// Boucle sur les lignes de propales // Boucle sur les lignes
for ($i = 0 ; $i < $nblignes ; $i++) for ($i = 0 ; $i < $nblignes ; $i++)
{ {
$curY = $nexY; $curY = $nexY;
// Description produit // Description produit
$codeproduitservice=""; $libelleproduitservice=$prop->lignes[$i]->libelle;
if ($prop->lignes[$i]->desc&&$prop->lignes[$i]->desc!=$prop->lignes[$i]->libelle)
{
if ($libelleproduitservice) $libelleproduitservice.="\n";
$libelleproduitservice.=$prop->lignes[$i]->desc;
}
$pdf->SetXY (11, $curY ); $pdf->SetXY (11, $curY );
if (defined("PROPALE_CODEPRODUITSERVICE") && PROPALE_CODEPRODUITSERVICE) {
// Affiche code produit si ligne associe un code produit
if ($conf->global->PROPALE_CODEPRODUITSERVICE && $fac->lignes[$i]->produit_id)
{
// Affiche code produit si ligne associe un code produit
$prodser = new Product($this->db); $prodser = new Product($this->db);
$prodser->fetch($prop->lignes[$i]->produit_id); $prodser->fetch($prop->lignes[$i]->produit_id);
if ($prodser->ref) { if ($prodser->ref) {
$codeproduitservice=" - ".$langs->trans("ProductCode")." ".$prodser->ref; $libelleproduitservice=$langs->trans("ProductCode")." ".$prodser->ref." - ".$libelleproduitservice;
} }
} }
if ($prop->lignes[$i]->date_start && $prop->lignes[$i]->date_end) { if ($prop->lignes[$i]->date_start && $prop->lignes[$i]->date_end) {
// Affichage dure si il y en a une // Affichage dure si il y en a une
$codeproduitservice.=" (".$langs->trans("From")." ".dolibarr_print_date($prop->lignes[$i]->date_start)." ".$langs->trans("to")." ".dolibarr_print_date($prop->lignes[$i]->date_end).")"; $libelleproduitservice.="\n(".$langs->trans("From")." ".dolibarr_print_date($prop->lignes[$i]->date_start)." ".$langs->trans("to")." ".dolibarr_print_date($prop->lignes[$i]->date_end).")";
} }
$pdf->MultiCell(108, 5, $prop->lignes[$i]->desc."$codeproduitservice", 0, 'J'); $pdf->MultiCell(108, 5, $libelleproduitservice, 0, 'J');
$nexY = $pdf->GetY(); $nexY = $pdf->GetY();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment