diff --git a/ChangeLog b/ChangeLog
index bc94a498d33..9ed9538ae20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -49,6 +49,8 @@ For users:
- New : Add pdf link into supplier invoice list and supplier order list
- New : Genrate auto the PDF for supplier invoice
- New : Add category into filter webservice thirdparty method getListOfThirdParties
+- New : Allow to define margin or mark rate during quoting, ordering, invoicing
+- New : User permissions on margin module
For translators:
- Qual: Normalized sort order of all languages files with english reference files.
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 48663a65b59..06635189ce6 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -2609,6 +2609,7 @@ abstract class CommonObject
{
global $conf,$langs,$object,$hookmanager;
global $form,$bcnd,$var;
+ global $user;
//Line extrafield
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafieldsline = new ExtraFields($this->db);
@@ -2633,6 +2634,7 @@ abstract class CommonObject
{
global $conf,$langs,$object,$hookmanager;
global $form,$bcnd,$var;
+ global $user;
//Line extrafield
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
@@ -2658,6 +2660,7 @@ abstract class CommonObject
{
global $conf,$user,$langs,$object,$hookmanager;
global $form,$bcnd,$var;
+ global $user;
//Line extrafield
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
@@ -2729,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 '