manage user permissions for margin display
This commit is contained in:
parent
06b8e939bd
commit
4c7741f5f0
@ -2732,9 +2732,9 @@ abstract class CommonObject
|
||||
else
|
||||
print '<td align="right" width="80">'.$langs->trans('CostPrice').'</td>';
|
||||
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES))
|
||||
if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous)
|
||||
print '<td align="right" width="50">'.$langs->trans('MarginRate').'</td>';
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES))
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous)
|
||||
print '<td align="right" width="50">'.$langs->trans('MarkRate').'</td>';
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -123,11 +123,11 @@
|
||||
if (! empty($conf->margin->enabled) && empty($user->societe_id)) {
|
||||
?>
|
||||
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo price($line->pa_ht); ?></td>
|
||||
<?php if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {?>
|
||||
<?php if (! empty($conf->global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) {?>
|
||||
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo (($line->pa_ht == 0)?'n/a':price($line->marge_tx).'%'); ?></td>
|
||||
<?php
|
||||
}
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES)) {?>
|
||||
if (! empty($conf->global->DISPLAY_MARK_RATES) && $user->rights->margins->liretous) {?>
|
||||
<td align="right" class="nowrap"><?php $coldisplay++; ?><?php echo price($line->marque_tx).'%'; ?></td>
|
||||
<?php } } ?>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user