Skip to content

Commit

Permalink
Merge pull request #1783 from defrance69/patch-4
Browse files Browse the repository at this point in the history
Update consumption.php
  • Loading branch information
eldy committed Jul 30, 2014
2 parents c9d2738 + fb4e64f commit 1b16f87
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions htdocs/societe/consumption.php
Expand Up @@ -67,7 +67,12 @@
}
// Customer or supplier selected in drop box
$thirdTypeSelect = GETPOST("third_select_id");
$type_element = GETPOST('type_element')?GETPOST('type_element'):'invoice';
if ($conf->facture->enabled && $user->rights->facture->lire)
$type_element = 'invoice';
elseif ($conf->commande->enabled && $user->rights->commande->lire)
$type_element = 'order';
$type_element = GETPOST('type_element')?GETPOST('type_element'):$type_element;


$langs->load("companies");
$langs->load("bills");
Expand Down Expand Up @@ -126,8 +131,8 @@
$obj = $db->fetch_object($resql);
$nbFactsClient = $obj->nb;
$thirdTypeArray['customer']=$langs->trans("customer");
if ($conf->facture->enabled) $elementTypeArray['invoice']=$langs->trans('Invoices');
if ($conf->commande->enabled) $elementTypeArray['order']=$langs->trans('Orders');
if($conf->facture->enabled && $user->rights->facture->lire) $elementTypeArray['invoice']=$langs->trans('Invoices');
if ($conf->commande->enabled && $user->rights->commande->lire) $elementTypeArray['order']=$langs->trans('Orders');
}

if ($object->fournisseur)
Expand All @@ -144,8 +149,8 @@
$obj = $db->fetch_object($resql);
$nbCmdsFourn = $obj->nb;
$thirdTypeArray['supplier']=$langs->trans("supplier");
if ($conf->fournisseur->enabled) $elementTypeArray['supplier_invoice']=$langs->trans('SuppliersInvoices');
if ($conf->fournisseur->enabled) $elementTypeArray['supplier_order']=$langs->trans('SuppliersOrders');
if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) $elementTypeArray['supplier_invoice']=$langs->trans('SuppliersInvoices');
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) $elementTypeArray['supplier_order']=$langs->trans('SuppliersOrders');
}
print '</table>';

Expand Down

0 comments on commit 1b16f87

Please sign in to comment.