Fix php 8 errors

This commit is contained in:
ptibogxiv 2023-01-08 15:33:12 +01:00 committed by GitHub
parent 9877f8281f
commit 828da5f83c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'];