diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 10ee91ad50f..58291fb75f0 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -730,6 +730,7 @@ class FormCompany extends Form if (is_object($object) && method_exists($object, 'liste_type_contact')) { $lesTypes = $object->liste_type_contact($source, $sortorder, 0, 1); + print ''; if ($showempty) print ''; foreach ($lesTypes as $key=>$value) diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index f2b96b2bea0..7899df494fc 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -591,7 +591,7 @@ class pdf_merou extends ModelePdfExpedition $pdf->SetXY($Xoff, $Yoff); $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetTextColor(0, 0, 0); - $pdf->MultiCell(0, 3, $outputlangs->transnoentities("RefSending").': '.$outputlangs->convToOutputCharset($object->ref), '', 'R'); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $Xoff, 3, $outputlangs->transnoentities("RefSending").': '.$outputlangs->convToOutputCharset($object->ref), '', 'R'); //$this->Code39($Xoff+43, $Yoff+1, $object->ref,$ext = true, $cks = false, $w = 0.4, $h = 4, $wide = true); $origin = $object->origin; @@ -627,9 +627,9 @@ class pdf_merou extends ModelePdfExpedition { $Yoff += 3; $posy = $Yoff; - $pdf->SetXY(100, $posy); + $pdf->SetXY($Xoff, $posy); $pdf->SetTextColor(0, 0, 0); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("CustomerCode")." : ".$outputlangs->transnoentities($object->thirdparty->code_client), '', 'R'); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $Xoff, 3, $outputlangs->transnoentities("CustomerCode")." : ".$outputlangs->transnoentities($object->thirdparty->code_client), '', 'R'); } // Date delivery diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index d14503a9039..b5df248b590 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -19,6 +19,8 @@ * This template needs: * $object * $withproject (if we are on task contact) + * + * $preselectedtypeofcontact may be defined or not */ // Protection to avoid direct call of template @@ -28,6 +30,9 @@ if (empty($object) || !is_object($object)) exit; } +if (empty($preselectedtypeofcontact)) { + $preselectedtypeofcontact = 0; +} require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; @@ -142,7 +147,7 @@ if ($permission) { element == 'shipping'|| $object->element == 'reception') && is_object($objectsrc)) $tmpobject=$objectsrc; - $formcompany->selectTypeContact($tmpobject, '', 'type', 'external', 'position', 0, 'minwidth100imp'); ?> + $formcompany->selectTypeContact($tmpobject, $preselectedtypeofcontact, 'type', 'external', 'position', 0, 'minwidth100imp'); ?> diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 146f4b54962..8c624f4a0fa 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -260,6 +260,7 @@ if ($id > 0 || !empty($ref)) // Contacts lines (modules that overwrite templates must declare this into descriptor) $dirtpls = array_merge($conf->modules_parts['tpl'], array('/core/tpl')); + $preselectedtypeofcontact = dol_getIdFromCode($db, 'SHIPPING', 'c_type_contact', 'code', 'rowid'); foreach ($dirtpls as $reldir) { $res = @include dol_buildpath($reldir.'/contacts.tpl.php');