diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php
index ddf30b290be..58b445c8ce7 100644
--- a/htdocs/commande/info.php
+++ b/htdocs/commande/info.php
@@ -58,9 +58,6 @@ llxHeader('',$langs->trans('Order'),'EN:Customers_Orders|FR:Commandes_Clients|ES
$object->fetch_thirdparty();
$object->info($object->id);
-$soc = new Societe($db);
-$soc->fetch($object->thirdparty->id);
-
$head = commande_prepare_head($object);
dol_fiche_head($head, 'info', $langs->trans("CustomerOrder"), 0, 'order');
@@ -68,13 +65,12 @@ dol_fiche_head($head, 'info', $langs->trans("CustomerOrder"), 0, 'order');
$linkback = '' . $langs->trans("BackToList") . '';
-
$morehtmlref='
';
// Ref customer
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
// Thirdparty
-$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
+$morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php
index 9a4b58a26c6..4d53d8e8d50 100644
--- a/htdocs/commande/note.php
+++ b/htdocs/commande/note.php
@@ -71,11 +71,10 @@ $form = new Form($db);
if ($id > 0 || ! empty($ref))
{
- $soc = new Societe($db);
- $soc->fetch($object->socid);
-
+ $object->fetch_thirdparty();
+
$head = commande_prepare_head($object);
-
+
dol_fiche_head($head, 'note', $langs->trans("CustomerOrder"), 0, 'order');
// Order card
@@ -88,7 +87,7 @@ if ($id > 0 || ! empty($ref))
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
// Thirdparty
- $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
+ $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
{
diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php
index 17c718cfb42..6862ea0e4bf 100644
--- a/htdocs/contact/note.php
+++ b/htdocs/contact/note.php
@@ -74,11 +74,6 @@ if ($id > 0)
$head = contact_prepare_head($object);
dol_fiche_head($head, 'note', $title,0,'contact');
-
-
- print '