X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fsvc_acct.cgi;h=58764f8818dcd9f3ab0e56369f5bd8a041caae76;hb=4d7a5f06cbab1f4f9614d9915641557f4edad1cf;hp=12d5991ea828d27ea7735f9e1b5d51f0509c3a30;hpb=16c3fc46b67dc42c0404fc93aa54ce61be5f08f9;p=freeside.git diff --git a/httemplate/search/svc_acct.cgi b/httemplate/search/svc_acct.cgi index 12d5991ea..58764f881 100755 --- a/httemplate/search/svc_acct.cgi +++ b/httemplate/search/svc_acct.cgi @@ -1,4 +1,4 @@ -<& elements/search.html, +<& elements/svc_Common.html, 'title' => emt('Account Search Results'), 'name' => emt('accounts'), 'query' => $sql_query, @@ -11,6 +11,10 @@ 'color' => \@color, 'style' => \@style, 'footer' => \@footer, + 'html_init' => include('/elements/email-link.html', + 'search_hash' => \%search_hash, + 'table' => 'svc_acct' + ), &> <%once> @@ -119,6 +123,10 @@ for (qw( domain domsvc agentnum custnum popnum svcpart cust_fields )) { $search_hash{$_} = $cgi->param($_) if length($cgi->param($_)); } +for (qw( towernum sectornum )) { + $search_hash{$_} = [ $cgi->param($_) ] if $cgi->param($_); +} + my $timepermonth = ''; my $orderby = 'ORDER BY svcnum'; @@ -140,10 +148,34 @@ if ( $cgi->param('magic') =~ /^(all|unlinked)$/ ) { if ( $sortby eq 'seconds' ) { my $tot_time = 0; push @header, emt('Time'); - push @fields, sub { my $svc_acct = shift; - $tot_time += $svc_acct->seconds; - format_time($svc_acct->seconds); - }; + + if ( $conf->exists('svc_acct-display_paid_time_remaining') ) { + push @fields, sub { my $svc_acct = shift; + my $seconds = $svc_acct->seconds; + my $cust_pkg = $svc_acct->cust_svc->cust_pkg; + my $part_pkg = $cust_pkg->part_pkg; + + $tot_time += $svc_acct->seconds; + + $timepermonth = $part_pkg->option('seconds'); + $timepermonth = $timepermonth / $part_pkg->freq + if $part_pkg->freq =~ /^\d+$/ && $part_pkg->freq != 0; + my $recur = $part_pkg->base_recur($cust_pkg); + + return format_time($seconds) + unless $timepermonth && $recur; + + format_time($seconds). + sprintf(' (%.2fx monthly)', $seconds / $timepermonth ); + + }; + } else { + push @fields, sub { my $svc_acct = shift; + $tot_time += $svc_acct->seconds; + format_time($svc_acct->seconds); + }; + } + push @links, ''; $align .= 'r'; push @color, '';