Merge pull request #956 from cbattarel/3.3

fix bug : external users should not see costprice and margin infos
This commit is contained in:
Laurent Destailleur 2013-05-20 07:39:39 -07:00
commit 416cdd2f9c
5 changed files with 9 additions and 8 deletions

View File

@ -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 *****

View File

@ -2632,7 +2632,7 @@ abstract class CommonObject
*/
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))
@ -2646,7 +2646,7 @@ abstract class CommonObject
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
@ -3044,7 +3044,8 @@ abstract class CommonObject
}
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">';

View File

@ -80,7 +80,7 @@ class modMargin extends DolibarrModules
// 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__'
);

View File

@ -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)) {?>

View File

@ -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