diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index 9da9868a765..6bf315fb0b1 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * @@ -132,8 +132,9 @@ class pdf_propale_azur extends ModelePDFPropales $propale = new Propal($this->db,"",$id); $ret=$propale->fetch($id); } + $propale->fetch_client(); $deja_regle = ""; - + // Définition de $dir et $file if ($propale->specimen) { @@ -811,6 +812,14 @@ class pdf_propale_azur extends ModelePDFPropales $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : " . dol_print_date($object->fin_validite,"day",false,$outputlangs,true), '', 'R'); + if ($object->client->code_client) + { + $posy+=5; + $pdf->SetXY(100,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $object->client->code_client, '', 'R'); + } + if ($showadress) { // Emetteur @@ -865,7 +874,6 @@ class pdf_propale_azur extends ModelePDFPropales $pdf->SetFont('Arial','',8); $pdf->SetXY(102,$posy-5); $pdf->MultiCell(80,4, $outputlangs->transnoentities("BillTo").":"); - $object->fetch_client(); // Cadre client destinataire $pdf->rect(100, $posy, 100, $hautcadre); diff --git a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php index d3dc6fa5fc3..2cb63e5e5a0 100644 --- a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php @@ -116,7 +116,9 @@ class pdf_propale_jaune extends ModelePDFPropales $propale = new Propal($this->db,"",$id); $ret=$propale->fetch($id); } - + $propale->fetch_client(); + $deja_regle = ""; + // Definition de $dir et $file if ($propale->specimen) { @@ -199,7 +201,7 @@ class pdf_propale_jaune extends ModelePDFPropales $pdf->writeHTMLCell(102, 4, 30, $curY, $outputlangs->convToOutputCharset($libelleproduitservice), 0, 1); - $pdf->SetFont('Arial','', 9); // On repositionne la police par défaut + $pdf->SetFont('Arial','', 9); // On repositionne la police par d�faut $nexY = $pdf->GetY(); $ref=dol_htmlentitiesbr($propale->lignes[$i]->ref); @@ -421,11 +423,22 @@ class pdf_propale_jaune extends ModelePDFPropales $pdf->SetXY(110,90); $pdf->MultiCell(100, 10, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date,'day',false,$outputlangs,true)); + $posy=20; + $posy+=5; + $pdf->SetXY(100,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("DateEndPropal")." : " . dol_print_date($object->fin_validite,"day",false,$outputlangs,true), '', 'R'); + if ($object->client->code_client) + { + $posy+=5; + $pdf->SetXY(100,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $object->client->code_client, '', 'R'); + } + $posy=39; - $object->fetch_client(); - // If BILLING contact defined, we use it $pdf->SetTextColor(0,0,0); @@ -449,7 +462,7 @@ class pdf_propale_jaune extends ModelePDFPropales // Nom client $carac_client = "\n".$object->contact->getFullName($outputlangs,1,1); - // Caractéristiques client + // Caract�ristiques client $carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->address); $carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->cp) . " " . $outputlangs->convToOutputCharset($object->contact->ville)."\n"; if ($object->contact->pays_code != $this->emetteur->pays_code) $carac_client.=$outputlangs->trans("Country".$object->contact->pays_code)."\n"; @@ -461,24 +474,24 @@ class pdf_propale_jaune extends ModelePDFPropales $pdf->SetFont('Arial','B',11); $pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L'); - // Nom du contact suivi propal si c'est une société + // Nom du contact suivi propal si c'est une soci�t� $arrayidcontact = $object->getIdContact('external','CUSTOMER'); if (sizeof($arrayidcontact) > 0) { $object->fetch_contact($arrayidcontact[0]); - // On vérifie si c'est une société ou un particulier + // On v�rifie si c'est une soci�t� ou un particulier if( !preg_match('#'.$object->contact->getFullName($outputlangs,1).'#isU',$object->client->nom) ) { $carac_client .= "\n".$object->contact->getFullName($outputlangs,1,1); } } - // Caractéristiques client + // Caract�ristiques client $carac_client.="\n".$outputlangs->convToOutputCharset($object->client->adresse); $carac_client.="\n".$outputlangs->convToOutputCharset($object->client->cp) . " " . $outputlangs->convToOutputCharset($object->client->ville)."\n"; if ($object->client->pays_code != $this->emetteur->pays_code) $carac_client.=$outputlangs->trans("Country".$object->client->pays_code)."\n"; } - // Numéro TVA intracom + // Num�ro TVA intracom if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra; $pdf->SetFont('Arial','',9); $posy=$pdf->GetY()-9; //Auto Y coord readjust for multiline name