From: levinse Date: Fri, 8 Apr 2011 04:12:30 +0000 (+0000) Subject: add display of total billed minutes on CDR report, RT12344 X-Git-Tag: freeside_2_3_0~436 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=a159f40f23d783913f4ba4312f1775f23916a0af;p=freeside.git add display of total billed minutes on CDR report, RT12344 --- 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