diff options
author | levinse <levinse> | 2011-04-08 04:12:31 +0000 |
---|---|---|
committer | levinse <levinse> | 2011-04-08 04:12:31 +0000 |
commit | 250899217a580f801451de4c3c02713accd1178a (patch) | |
tree | 437677200767b20ab363af901db93c78fc04c682 | |
parent | 06b84123d7a9db0d4c4472c208bf2d96f080e0d4 (diff) |
add display of total billed minutes on CDR report, RT12344
-rw-r--r-- | httemplate/search/cdr.html | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/httemplate/search/cdr.html b/httemplate/search/cdr.html index 5544ff58c..6ee544e0e 100644 --- a/httemplate/search/cdr.html +++ b/httemplate/search/cdr.html @@ -8,6 +8,7 @@ 'order_by' => 'ORDER BY calldate', }, 'count_query' => $count_query, + 'count_addl' => [ $totalminutes_sub ], 'header' => [ '', # checkbox column @header, @@ -45,7 +46,6 @@ ''; } }, - ) %> <%init> @@ -55,6 +55,11 @@ die "access denied" my $edit_data = $FS::CurrentUser::CurrentUser->access_right('Edit rating data'); +my $totalminutes_sub = sub { + my $billsec = shift; + sprintf("%.2f",$billsec/60) . ' total minutes'; +}; + my $conf = new FS::Conf; my $areboxes = 0; @@ -257,7 +262,7 @@ if ( $cgi->param('acctid') =~ /\d/ ) { my $search = join(' AND ', @search); $search = "WHERE $search" if $search; -my $count_query = "SELECT COUNT(*) FROM cdr $search"; +my $count_query = "SELECT COUNT(*), sum(billsec) FROM cdr $search"; my $qsearch = join(' AND ', @qsearch); $qsearch = ( scalar(keys %$hashref) ? ' AND ' : ' WHERE ' ) . $qsearch |