From 48262f2d411658211f3a1b7bfbb5ed6a00970820 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 29 Jul 2010 16:43:40 +0000 Subject: [PATCH] Fix: Customer code was not visible --- .../livraison/pdf/pdf_sirocco.modules.php | 14 ++++++++++--- .../livraison/pdf/pdf_typhon.modules.php | 21 +++++++++++++------ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php index 2691fa149dc..5e61c218cb8 100644 --- a/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php +++ b/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php @@ -110,6 +110,8 @@ class pdf_sirocco extends ModelePDFDeliveryOrder } } + $object->fetch_client(); + $nblignes = sizeof($object->lignes); $objectref = dol_sanitizeFileName($object->ref); @@ -380,8 +382,6 @@ class pdf_sirocco extends ModelePDFDeliveryOrder * Adresse Client */ - $object->fetch_client(); - // If SHIPPING contact defined on invoice, we use it $usecontact=false; $arrayidcontact=$object->commande->getIdContact('external','SHIPPING'); @@ -419,9 +419,17 @@ class pdf_sirocco extends ModelePDFDeliveryOrder $pdf->SetTextColor(200,0,0); $pdf->SetFont('Arial','B',12); - $pdf->Text(11, 88, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_valid,"day",false,$outputlangs,true)); + $pdf->Text(11, 88, $outputlangs->transnoentities("Date")." : " . dol_print_date(($object->date_delivery?$object->date_delivery:$date->valid),"day",false,$outputlangs,true)); $pdf->Text(11, 94, $outputlangs->transnoentities("DeliveryOrder")." ".$outputlangs->convToOutputCharset($object->ref)); + if ($object->client->code_client) + { + $posy+=7; + $pdf->SetXY(102,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(96, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R'); + } + $pdf->SetFont('Arial','B',9); // Add list of linked orders diff --git a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php index 96020de34a9..5aaf3ae7494 100644 --- a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php @@ -132,6 +132,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder } } + $object->fetch_client(); + $nblignes = sizeof($object->lignes); $objectref = dol_sanitizeFileName($object->ref); @@ -509,7 +511,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder { if (is_readable($logo)) { - $pdf->Image($logo, $this->marge_gauche, $posy, 0, 24); + $pdf->Image($logo, $this->marge_gauche, $posy, 0, 22); } else { @@ -521,18 +523,19 @@ class pdf_typhon extends ModelePDFDeliveryOrder } else $pdf->MultiCell(100, 4, $this->emetteur->nom, 0, 'L'); - $pdf->SetFont('Arial','B',13); + $pdf->SetFont('Arial','B',12); $pdf->SetXY(100,$posy); $pdf->SetTextColor(0,0,60); $pdf->MultiCell(100, 4, $outputlangs->transnoentities("DeliveryOrder")." ".$outputlangs->convToOutputCharset($object->ref), '' , 'R'); + $pdf->SetFont('Arial','',12); - $posy+=6; + $posy+=5; $pdf->SetXY(100,$posy); $pdf->SetTextColor(0,0,60); if ($object->date_valid) { - $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_valid,"%d %b %Y",false,$outputlangs,true), '', 'R'); + $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : " . dol_print_date(($object->date_delivery?$object->date_delivery:$date->valid),"%d %b %Y",false,$outputlangs,true), '', 'R'); } else { @@ -541,6 +544,14 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetTextColor(0,0,60); } + if ($object->client->code_client) + { + $posy+=5; + $pdf->SetXY(100,$posy); + $pdf->SetTextColor(0,0,60); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : " . $outputlangs->transnoentities($object->client->code_client), '', 'R'); + } + $pdf->SetTextColor(0,0,60); // Add list of linked orders @@ -612,8 +623,6 @@ class pdf_typhon extends ModelePDFDeliveryOrder // Cadre client destinataire $pdf->rect(100, $posy, 100, $hautcadre); - $object->fetch_client(); - // If SHIPPING contact defined on invoice, we use it $usecontact=false; $arrayidcontact=$object->commande->getIdContact('external','SHIPPING');