summaryrefslogtreecommitdiff
path: root/httemplate/search/cdr.html
diff options
context:
space:
mode:
authorlevinse <levinse>2011-04-08 04:12:30 +0000
committerlevinse <levinse>2011-04-08 04:12:30 +0000
commita159f40f23d783913f4ba4312f1775f23916a0af (patch)
tree83f6529cc3d440d090fd27f383134067acc3deb5 /httemplate/search/cdr.html
parented41f28bf167b0028f939f1a365120985fed8980 (diff)
add display of total billed minutes on CDR report, RT12344
Diffstat (limited to 'httemplate/search/cdr.html')
-rw-r--r--httemplate/search/cdr.html9
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