[freeside-commits] freeside/httemplate/search cdr.html, 1.24, 1.24.2.1
Erik Levinson
levinse at wavetail.420.am
Thu Apr 7 21:12:33 PDT 2011
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv7254/httemplate/search
Modified Files:
Tag: FREESIDE_2_1_BRANCH
cdr.html
Log Message:
add display of total billed minutes on CDR report, RT12344
Index: cdr.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cdr.html,v
retrieving revision 1.24
retrieving revision 1.24.2.1
diff -u -w -d -r1.24 -r1.24.2.1
--- cdr.html 25 Oct 2010 00:28:41 -0000 1.24
+++ cdr.html 8 Apr 2011 04:12:31 -0000 1.24.2.1
@@ -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 @@
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 @@
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
More information about the freeside-commits
mailing list