From e2fca2285a5b17e809fb1c690cb242d985586926 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 26 May 2011 16:28:54 +0000 Subject: [PATCH] New: add shipping method with tracking number and url --- .../pdf/pdf_expedition_merou.modules.php | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/htdocs/includes/modules/expedition/pdf/pdf_expedition_merou.modules.php b/htdocs/includes/modules/expedition/pdf/pdf_expedition_merou.modules.php index 652e792297d..3fa31ae73f7 100644 --- a/htdocs/includes/modules/expedition/pdf/pdf_expedition_merou.modules.php +++ b/htdocs/includes/modules/expedition/pdf/pdf_expedition_merou.modules.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2009 Laurent Destailleur - * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2005-2011 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -452,7 +452,30 @@ Class pdf_expedition_merou extends ModelePdfExpedition $pdf->SetXY($blSocX-80,$blSocY+23); $pdf->SetFont('','', $default_font_size - 2); $pdf->SetTextColor(0,0,0); - $pdf->MultiCell(50, 8, $outputlangs->transnoentities("Deliverer")." ".$outputlangs->convToOutputCharset($this->livreur->getFullName($outputlangs)), '' , 'L'); + + if (! empty($object->tracking_number)) + { + $object->GetUrlTrackingStatus($object->tracking_number); + if (! empty($object->tracking_url)) + { + if ($object->expedition_method_id > 0) + { + // Get code using getLabelFromKey + $code=$outputlangs->getLabelFromKey($this->db,$object->expedition_method_id,'c_shipment_mode','rowid','code'); + $label=$outputlangs->trans("SendingMethod".strtoupper($code))." :"; + } + else + { + $label=$outputlangs->transnoentities("Deliverer"); + } + + $pdf->writeHTMLCell(50, 8, '', '', $label." ".$object->tracking_url, '' , 'L'); + } + } + else + { + $pdf->MultiCell(50, 8, $outputlangs->transnoentities("Deliverer")." ".$outputlangs->convToOutputCharset($this->livreur->getFullName($outputlangs)), '' , 'L'); + } /**********************************/