X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_svc.cgi;h=ef0de13cccd3c1d8bfd61d4100409eaff25dbf5a;hp=3fece29257dcf64ac819c1c277e0ab2b897c3abb;hb=ecf4288cc6d98a4916128c5e45d515e0fbea09fd;hpb=58d44fbe5eb9ab32e6d87063a4a3b22ddba9a828 diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi index 3fece2925..ef0de13cc 100755 --- a/httemplate/browse/part_svc.cgi +++ b/httemplate/browse/part_svc.cgi @@ -13,6 +13,20 @@ my @part_svc = qsearch('part_svc', \%search ); my $total = scalar(@part_svc); +my %num_active_cust_svc = (); +if ( $cgi->param('active') ) { + my $active_sth = dbh->prepare( + 'SELECT COUNT(*) FROM cust_svc WHERE svcpart = ?' + ) or die dbh->errstr; + foreach my $part_svc ( @part_svc ) { + $active_sth->execute($part_svc->svcpart) or die $active_sth->errstr; + $num_active_cust_svc{$part_svc->svcpart} = + $active_sth->fetchrow_arrayref->[0]; + } + @part_svc = sort { $num_active_cust_svc{$b->svcpart} <=> + $num_active_cust_svc{$a->svcpart} } @part_svc; +} + %> <%= header('Service Definition Listing', menubar( 'Main Menu' => $p) ) %> @@ -45,6 +59,9 @@ function part_export_areyousure(href) { param('showdisabled') ? 2 : 3 %>>Service Table +<% if ( $cgi->param('active') ) { %> + Customer
Services
+<% } %> Export Field Modifier @@ -75,6 +92,11 @@ function part_export_areyousure(href) { <%= $hashref->{svc} %> > <%= $hashref->{svcdb} %> +<% if ( $cgi->param('active') ) { %> + > + <%= $num_active_cust_svc{$hashref->{svcpart}} %> active + +<% } %> ><%= itable() %> <% # my @part_export =