From 7d3033715988173e8a851519905a613422bd8553 Mon Sep 17 00:00:00 2001 From: liedekef Date: Thu, 4 Jan 2007 14:58:06 +0000 Subject: [PATCH] Fixed bug #18642 --- .../livraison/mods/pdf/pdf_sirocco.modules.php | 12 +++++++++--- .../livraison/mods/pdf/pdf_typhon.modules.php | 18 ++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/htdocs/livraison/mods/pdf/pdf_sirocco.modules.php b/htdocs/livraison/mods/pdf/pdf_sirocco.modules.php index cfc098c7358..f1916691f4a 100644 --- a/htdocs/livraison/mods/pdf/pdf_sirocco.modules.php +++ b/htdocs/livraison/mods/pdf/pdf_sirocco.modules.php @@ -307,9 +307,15 @@ class pdf_sirocco extends ModelePDFDeliveryOrder */ $pdf->SetTextColor(0,0,0); $pdf->SetFont('Arial','B',12); - $client = new Societe($this->db); - $client->fetch($delivery->socid); - $delivery->client = $client; + $client = new Societe($this->db); + /* + * if a delivery address is used, use that, else use the client address + */ + if ($commande->adresse_livraison_id>0) { + $client->fetch_adresse_livraison($commande->adresse_livraison_id); + } else { + $client->fetch($delivery->socid); + } $pdf->SetXY(102,42); $pdf->MultiCell(96,5, $delivery->client->nom); $pdf->SetFont('Arial','B',11); diff --git a/htdocs/livraison/mods/pdf/pdf_typhon.modules.php b/htdocs/livraison/mods/pdf/pdf_typhon.modules.php index e2961bc2734..487e6c9985a 100644 --- a/htdocs/livraison/mods/pdf/pdf_typhon.modules.php +++ b/htdocs/livraison/mods/pdf/pdf_typhon.modules.php @@ -729,12 +729,18 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetTextColor(0,0,0); $pdf->SetFont('Arial','',8); $pdf->SetXY(102,$posy-5); - $pdf->MultiCell(80,5, $langs->transnoentities("BillTo").":"); - // - $client = new Societe($this->db); - $client->fetch($delivery->socid); - $delivery->client = $client; - // + $pdf->MultiCell(80,5, $langs->transnoentities("DeliveryAddress").":"); + + /* + * if a delivery address is used, use that, else use the client address + */ + if ($commande->adresse_livraison_id>0) { + $client->fetch_adresse_livraison($commande->adresse_livraison_id); + } else { + $client->fetch($delivery->socid); + } + $delivery->client = $client; + // // Cadre client destinataire $pdf->rect(100, $posy, 100, $hautcadre);