diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 8e6970f754d..06635189ce6 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -2732,9 +2732,9 @@ abstract class CommonObject
else
print '
'.$langs->trans('CostPrice').' | ';
- if (! empty($conf->global->DISPLAY_MARGIN_RATES))
+ if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous)
print ''.$langs->trans('MarginRate').' | ';
- if (! empty($conf->global->DISPLAY_MARK_RATES))
+ if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous)
print ''.$langs->trans('MarkRate').' | ';
}
@@ -3170,6 +3170,8 @@ abstract class CommonObject
global $langs, $conf, $user;
if (! empty($user->societe_id)) return;
+
+ if (! $user->rights->margins->liretous) return;
$marginInfo = $this->getMarginInfos($force_price);
diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php
index 3e6f4dc9a49..681b37f3890 100644
--- a/htdocs/core/tpl/objectline_view.tpl.php
+++ b/htdocs/core/tpl/objectline_view.tpl.php
@@ -123,11 +123,11 @@
if (! empty($conf->margin->enabled) && empty($user->societe_id)) {
?>
pa_ht); ?> |
- global->DISPLAY_MARGIN_RATES)) {?>
+ global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) {?>
pa_ht == 0)?'n/a':price($line->marge_tx).'%'); ?> |
global->DISPLAY_MARK_RATES)) {?>
+ if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?>
marque_tx).'%'; ?> |