From 529d4447efaff3334ba64815bd800ad8d151ea0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 17 Feb 2015 00:04:31 +0100 Subject: [PATCH] Fix: [ bug #1652 ] Margin tab should not be shown for thirds not clients --- htdocs/core/modules/modMargin.class.php | 3 ++- htdocs/margin/tabs/thirdpartyMargins.php | 9 --------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index 19100576a83..0a0d33789b6 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2015 Marcos GarcĂ­a * * 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 @@ -80,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:/margin/tabs/thirdpartyMargins.php?socid=__ID__' + 'thirdparty:+margin:Margins:margins:empty($user->societe_id) && $user->rights->margins->liretous && ($societe->client > 0):/margin/tabs/thirdpartyMargins.php?socid=__ID__' ); diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 457d55e81f0..5782b72c356 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -94,15 +94,6 @@ if ($socid > 0) print ''; } - if ($societe->fournisseur) - { - print ''; - print $langs->trans('SupplierCode').''; - print $societe->code_fournisseur; - if ($societe->check_codefournisseur() <> 0) print ' ('.$langs->trans("WrongSupplierCode").')'; - print ''; - } - // Total Margin print ''.$langs->trans("TotalMargin").''; print ''; // set by jquery (see below)