commit
f98d5ea699
@ -49,6 +49,11 @@ $pagenext = $page + 1;
|
||||
if (!$sortorder) {
|
||||
$sortorder = "ASC";
|
||||
}
|
||||
if ($user->rights->margins->read->all) {
|
||||
$agentid = GETPOST('agentid', 'int');
|
||||
} else {
|
||||
$agentid = $user->id;
|
||||
}
|
||||
if (!$sortfield) {
|
||||
if ($agentid > 0) {
|
||||
$sortfield = "s.nom";
|
||||
@ -74,11 +79,6 @@ if (!empty($enddatemonth)) {
|
||||
}
|
||||
|
||||
// Security check
|
||||
if ($user->rights->margins->read->all) {
|
||||
$agentid = GETPOST('agentid', 'int');
|
||||
} else {
|
||||
$agentid = $user->id;
|
||||
}
|
||||
$result = restrictedArea($user, 'margins');
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
@ -317,7 +317,8 @@ if ($result) {
|
||||
$sortfield = 'name';
|
||||
}
|
||||
$group_list = dol_sort_array($group_list, $sortfield, $sortorder);
|
||||
|
||||
$cumul_achat = 0;
|
||||
$cumul_vente = 0;
|
||||
foreach ($group_list as $group_id => $group_array) {
|
||||
$pa = $group_array['buying_price'];
|
||||
$pv = $group_array['selling_price'];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user