Merge pull request #23453 from ptibogxiv/patch-74

Fix php 8 errors
This commit is contained in:
Laurent Destailleur 2023-01-11 21:09:01 +01:00 committed by GitHub
commit f98d5ea699
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'];