custnum}++, @cust_main)
) {
@@ -370,6 +397,50 @@ END
END
}
+ foreach my $addl_col ( @addl_cols ) {
+ print "";
+ if ( $addl_col eq 'tickets' ) {
+ if ( @custom_priorities ) {
+ print &itable('', 0);
+ foreach my $priority ( @custom_priorities, '' ) {
+
+ my $num =
+ FS::TicketSystem->num_customer_tickets($custnum,$priority);
+ my $ahref = '';
+ $ahref= ''
+ if $num;
+
+ print ''.
+ " $ahref$num | ".
+ "$ahref".
+ ( $priority || '(none)' ).
+ " | ";
+
+ }
+ print ' | '.
+ '';
+ }
+
+ my $ahref = '';
+ $ahref = ''
+ if $cust_main->get($addl_col);
+
+ print $ahref. $cust_main->get($addl_col). '';
+ print " | ".
+ "${ahref}Total".
+ " | "
+ if @custom_priorities;
+
+ } else {
+ print $cust_main->get($addl_col);
+ }
+ print " | ";
+ }
+
my($n1)='';
foreach ( @{$all_pkgs{$custnum}} ) {
my $pkgnum = $_->pkgnum;
@@ -424,6 +495,10 @@ sub custnum_sort {
$a->getfield('custnum') <=> $b->getfield('custnum');
}
+sub tickets_sort {
+ $b->getfield('tickets') <=> $a->getfield('tickets');
+}
+
sub custnumsearch {
my $custnum = $cgi->param('custnum_text');