Skip to content

Commit

Permalink
Merge pull request #956 from cbattarel/3.3
Browse files Browse the repository at this point in the history
fix bug : external users should not see costprice and margin infos
  • Loading branch information
eldy committed May 20, 2013
2 parents e2f2ad3 + f8ca842 commit 416cdd2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ChangeLog
Expand Up @@ -32,7 +32,7 @@ English Dolibarr ChangeLog
- Fix: [ bug #865 ] Dolibarr navigation array in project/task do not work
- Fix: [ bug #866 ] Standing order from an invoice suggests invoice total amount instead of remaining to pay
- Fix: [ bug #788 ] Date of linked interventions are not shown

- Fix: external users should not see costprice and margin infos

***** ChangeLog for 3.3.1 compared to 3.3 *****

Expand Down
7 changes: 4 additions & 3 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -2632,7 +2632,7 @@ function formAddObjectLine($dateSelector,$seller,$buyer,$hookmanager=false)
*/
function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0, $hookmanager=false)
{
global $conf,$langs;
global $conf,$langs,$user;

print '<tr class="liste_titre nodrag nodrop">';
if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
Expand All @@ -2646,7 +2646,7 @@ function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0
print '<td align="right" width="80">&nbsp;</td>';
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
if (! empty($conf->margin->enabled)) {
if (! empty($conf->margin->enabled) && empty($user->societe_id)) {
if ($conf->global->MARGIN_TYPE == "1")
print '<td align="right" width="80">'.$langs->trans('BuyingPrice').'</td>';
else
Expand Down Expand Up @@ -3044,7 +3044,8 @@ function getMarginInfos($force_price=false) {
}

function displayMarginInfos($force_price=false) {
global $langs, $conf;
global $langs, $conf,$user;
if (! empty($user->societe_id)) return;
$marginInfo = $this->getMarginInfos($force_price);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/modules/modMargin.class.php
Expand Up @@ -80,7 +80,7 @@ function __construct($db)
// New pages on tabs
$this->tabs = array(
'product:+margin:Margins:margins:$conf->margin->enabled:/margin/tabs/productMargins.php?id=__ID__',
'thirdparty:+margin:Margins:margins:$conf->margin->enabled:/margin/tabs/thirdpartyMargins.php?socid=__ID__'
'thirdparty:+margin:Margins:margins:$conf->margin->enabled && empty($user->societe_id):/margin/tabs/thirdpartyMargins.php?socid=__ID__'
);


Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/tpl/objectline_view.tpl.php
Expand Up @@ -117,7 +117,7 @@
<td>&nbsp;</td>
<?php }

if (! empty($conf->margin->enabled)) {
if (! empty($conf->margin->enabled) && empty($user->societe_id)) {
?>
<td align="right" nowrap="nowrap"><?php echo price($line->pa_ht); ?></td>
<?php if (! empty($conf->global->DISPLAY_MARGIN_RATES)) {?>
Expand Down
4 changes: 2 additions & 2 deletions htdocs/langs/fr_FR/margins.lang
Expand Up @@ -45,8 +45,8 @@ MargeBrute=Marge brute
MargeNette=Marge nette
MARGIN_TYPE_DETAILS=Marge brute : Prix de vente HT - Prix d'achat HT<br/>Marge nette : Prix de vente HT - Coût de revient

CostPrice=Prix ​​d'achat
BuyingCost=Coût de revient
BuyingPrice=Prix ​​d'achat
CostPrice=Prix de revient
UnitCharges=Charge unitaire
Charges=Charges

Expand Down

0 comments on commit 416cdd2

Please sign in to comment.