From b210d7a00fc73a5af7bd3c2d56dd5517aabbf71c Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Sun, 18 May 2014 14:59:20 +0200 Subject: [PATCH 1/5] Update commonobject.class.php Hide the margintable if click at the top of it (usefull when customer are just in front of you), reappear when you click again --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 0a44be050e796..fe77c21d158da 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3235,8 +3235,8 @@ function displayMarginInfos($force_price=false) $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); $marginInfo = $this->getMarginInfos($force_price); - - print ''; + print "
 
"; + print '
'; print ''; print ''; print ''; From c8067931e317a0cbdc8945d8ea28512a38db8d40 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Mon, 19 May 2014 09:32:42 +0200 Subject: [PATCH 2/5] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index fe77c21d158da..2d7ff70aaa95c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3235,8 +3235,8 @@ function displayMarginInfos($force_price=false) $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); $marginInfo = $this->getMarginInfos($force_price); - print "
 
"; - print '
'.$langs->trans('Margins').''.$langs->trans('SellingPrice').'
'; + print "
 
"; + print '
'; print ''; print ''; print ''; From 86e0d377f84d8650b7b1e5fbabd6aab26f1957de Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Mon, 19 May 2014 09:40:06 +0200 Subject: [PATCH 3/5] Update objectline_view.tpl.php --- htdocs/core/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 948a61bae2c3f..ce87aa5e81596 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -123,7 +123,7 @@ if (! empty($conf->margin->enabled) && empty($user->societe_id)) { $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); ?> - + global->DISPLAY_MARGIN_RATES) && $user->rights->margins->liretous) {?> Date: Sat, 24 May 2014 19:51:05 +0200 Subject: [PATCH 4/5] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2d7ff70aaa95c..655d474aef388 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3235,7 +3235,7 @@ function displayMarginInfos($force_price=false) $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); $marginInfo = $this->getMarginInfos($force_price); - print "
 
"; + print ""; print '
'.$langs->trans('Margins').''.$langs->trans('SellingPrice').'pa_ht); ?>
pa_ht); ?>
pa_ht == 0)?'n/a':price($line->marge_tx, null, null, null, null, $rounding).'%'); ?>
'; print ''; print ''; From 8acd702cd13c9c7086e4394b792f4ed8f8556cc5 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Thu, 26 Jun 2014 22:34:40 +0200 Subject: [PATCH 5/5] Using hidden constant to use the feature MARGININFO_HIDE_SHOW = 0 feature not used MARGININFO_HIDE_SHOW = 1 feature used, displayed on open MARGININFO_HIDE_SHOW = 2 feature used, not displayed on open --- htdocs/core/class/commonobject.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 655d474aef388..e55766c377e32 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3232,10 +3232,14 @@ function displayMarginInfos($force_price=false) if (! $user->rights->margins->liretous) return; - $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); + $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); $marginInfo = $this->getMarginInfos($force_price); - print ""; + if ($conf->global->MARGININFO_HIDE_SHOW > 0) + print ""; + if ($conf->global->MARGININFO_HIDE_SHOW == 2) // hide by default + print ''; + print '
'.$langs->trans('Margins').'
'; print ''; print '';
'.$langs->trans('Margins').'