diff --git a/admin/reports.inc.php b/admin/reports.inc.php index 0861e48..4f882e2 100644 --- a/admin/reports.inc.php +++ b/admin/reports.inc.php @@ -650,11 +650,13 @@ foreach($report_stock as $n=>$v) { if($n_groups > 0) { $group_change = false; - for($x=0; $x<$n_groups; $x++) { - if($last_group_data["G$x"] != $i["G$x"]) { + /* See if any of the "group" fields have changed */ + foreach($report['group'] as $x=>$g) { + $f = $g['field']; + $c = $fieldname[$f]; + if($last_group_data[$c] != $i[$c]) $group_change = true; - } - $last_group_data["G$x"] = $i["G$x"]; + $last_group_data[$c] = $i[$c]; } if($group_change) {