2
0
forked from Wavyzz/dolibarr

Fix warning

This commit is contained in:
Laurent Destailleur
2024-04-03 02:59:58 +02:00
parent 50f99a51bb
commit 20e0417f3b

View File

@@ -63,7 +63,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
$totalarray['nbfield']++;
}
if ($extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key]) {
if (!empty($extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key])) {
if (!$i) {
// we keep position for the first line
$totalarray['totalizable'][$key]['pos'] = $totalarray['nbfield'];
@@ -75,7 +75,7 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
$totalarray['totalizable'][$key]['total'] += $obj->$tmpkey;
}
}
// key 'totalizable' if in extrafields same as 'isameasure' into ->$fields
// The key 'totalizable' on extrafields, is the same as 'isameasure' into ->fields
if (!empty($extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key]) && $extrafields->attributes[$extrafieldsobjectkey]['totalizable'][$key] == 1) {
if (!$i) {
$totalarray['pos'][$totalarray['nbfield']] = $extrafieldsobjectprefix.$tmpkey;
@@ -83,6 +83,10 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
if (!isset($totalarray['val'])) {
$totalarray['val'] = array();
}
if (!isset($totalarray['val'][$extrafieldsobjectprefix.$tmpkey])) {
$totalarray['val'][$extrafieldsobjectprefix.$tmpkey] = 0;
}
if (isset($obj->$tmpkey) && is_numeric($obj->$tmpkey)) {
if (!isset($totalarray['val'][$extrafieldsobjectprefix.$tmpkey])) {
$totalarray['val'][$extrafieldsobjectprefix.$tmpkey] = 0;
}
@@ -92,3 +96,4 @@ if (!empty($extrafieldsobjectkey) && !empty($extrafields->attributes[$extrafield
}
}
}
}