diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php
index 65396126585..749bfc1c7ef 100644
--- a/htdocs/core/modules/modMargin.class.php
+++ b/htdocs/core/modules/modMargin.class.php
@@ -81,7 +81,7 @@ class modMargin extends DolibarrModules
// New pages on tabs
$this->tabs = array(
'product:+margin:Margins:margins:$user->rights->margins->liretous:/margin/tabs/productMargins.php?id=__ID__',
- 'thirdparty:+margin:Margins:margins:empty($user->societe_id) && $user->rights->margins->liretous && ($societe->client > 0):/margin/tabs/thirdpartyMargins.php?socid=__ID__'
+ 'thirdparty:+margin:Margins:margins:empty($user->societe_id) && $user->rights->margins->liretous && ($object->client > 0):/margin/tabs/thirdpartyMargins.php?socid=__ID__'
);
diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php
index d5c86016862..bd2730edda0 100644
--- a/htdocs/margin/tabs/thirdpartyMargins.php
+++ b/htdocs/margin/tabs/thirdpartyMargins.php
@@ -62,14 +62,14 @@ llxHeader('',$langs->trans("ThirdParty").' - '.$langs->trans("Margins"),$help_ur
if ($socid > 0)
{
- $societe = new Societe($db);
- $societe->fetch($socid);
+ $object = new Societe($db);
+ $object->fetch($socid);
/*
* Affichage onglets
*/
- $head = societe_prepare_head($societe);
+ $head = societe_prepare_head($object);
dol_fiche_head($head, 'margin', $langs->trans("ThirdParty"),0,'company');
@@ -77,29 +77,29 @@ if ($socid > 0)
print '
| '.$langs->trans('ThirdPartyName').' | ';
print '';
- print $form->showrefnav($societe,'socid','',($user->societe_id?0:1),'rowid','nom');
+ print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print ' |
';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
- print '| '.$langs->trans('Prefix').' | '.$societe->prefix_comm.' |
';
+ print '| '.$langs->trans('Prefix').' | '.$object->prefix_comm.' |
';
}
- if ($societe->client)
+ if ($object->client)
{
print '| ';
print $langs->trans('CustomerCode').' | ';
- print $societe->code_client;
- if ($societe->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')';
+ print $object->code_client;
+ if ($object->check_codeclient() <> 0) print ' ('.$langs->trans("WrongCustomerCode").')';
print ' |
';
}
- if ($societe->fournisseur)
+ if ($object->fournisseur)
{
print '| ';
print $langs->trans('SupplierCode').' | ';
- print $societe->code_fournisseur;
- if ($societe->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')';
+ print $object->code_fournisseur;
+ if ($object->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')';
print ' |
';
}
@@ -153,7 +153,7 @@ if ($socid > 0)
{
$num = $db->num_rows($result);
- print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&socid=".$societe->id,$sortfield,$sortorder,'',0,0,'');
+ print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&socid=".$object->id,$sortfield,$sortorder,'',0,0,'');
$i = 0;
print "";
@@ -246,7 +246,7 @@ if ($socid > 0)
}
else
{
- dol_print_error();
+ dol_print_error('', 'Parameter socid not defined');
}