in grouped payment search, only show tabs when there's more than one group, #71364
[freeside.git] / httemplate / search / elements / grouped-search / core
index fe47fb7..3d38a8c 100644 (file)
@@ -130,6 +130,17 @@ for my $i (0 .. scalar(@groups) - 1) {
   push @queries, $detail_query;
 }
 
+if ( $opt{show_combined} ) {
+  if ( @groups > 1 ) {
+    # set up group 0 as a combined view
+    unshift @groups, $totals;
+    unshift @group_labels, 'All ' . PL($opt{name_singular}) .
+                           ' (' . $totals->num_rows . ')';
+    unshift @group_footers, []; # the total footer will suffice
+    unshift @queries, $base_query->clone;
+  }
+}
+
 my @total_footer;
 if ($opt{'total_row'}) {
   for( my $col = 0;