# The new way:
# Actually break down all subsets of the (selected) report classes.
my @subsets = FS::part_pkg_report_option->subsets(@classnums);
- warn "SUBSETS:\n".Dumper(\@subsets)."\n\n";
my @classnum_space = @classnums;
@classnums = @classnames = ();
while(@subsets) {
my $i = 0;
foreach (@$these) {
$i++ until $not_these->[$i] == $_;
- splice($not_these, $i, 1);
+ splice(@$not_these, $i, 1);
}
push @classnums, $these;
push @not_classnums, $not_these;
push @classnames, shift @subsets;
} #while subsets
- warn "COMPLEMENTS:\n".Dumper(\@not_classnums)."\n\n";
}
# else it's 'pkg', i.e. part_pkg.classnum, which is singular on pkgpart
# and much simpler
} elsif ( $cgi->param('class_agg_break') eq 'breakdown' ) {
- # if we're working with report options, @classnums here contains
- # arrays of multiple classnums
for (my $i = 0; $i < scalar @classnums; $i++) {
- my $row_classnum = join(',', @{ $classnums[$i] });
- my $row_classname = join(', ', @{ $classnames[$i] });
- my $not_row_classnum = join(',', @{ $not_classnums[$i] });
+ my $row_classnum = $classnums[$i];
+ my $row_classname = $classnames[$i];
+ my $not_row_classnum = '';
+ if ( $class_param eq 'report_optionnum' ) {
+ # if we're working with report options, @classnums here contains
+ # arrays of multiple classnums
+ $row_classnum = join(',', @$row_classnum);
+ $row_classname = join(', ', @$row_classname);
+ $not_row_classnum = join(',', @{ $not_classnums[$i] });
+ }
foreach my $component ( @components ) {
push @items, 'cust_bill_pkg';