projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ed41f28
)
add display of total billed minutes on CDR report, RT12344
author
levinse
<levinse>
Fri, 8 Apr 2011 04:12:30 +0000
(
04:12
+0000)
committer
levinse
<levinse>
Fri, 8 Apr 2011 04:12:30 +0000
(
04:12
+0000)
httemplate/search/cdr.html
patch
|
blob
|
history
diff --git
a/httemplate/search/cdr.html
b/httemplate/search/cdr.html
index
5544ff5
..
6ee544e
100644
(file)
--- a/
httemplate/search/cdr.html
+++ b/
httemplate/search/cdr.html
@@
-8,6
+8,7
@@
'order_by' => 'ORDER BY calldate',
},
'count_query' => $count_query,
'order_by' => 'ORDER BY calldate',
},
'count_query' => $count_query,
+ 'count_addl' => [ $totalminutes_sub ],
'header' => [
'', # checkbox column
@header,
'header' => [
'', # checkbox column
@header,
@@
-45,7
+46,6
@@
'';
}
},
'';
}
},
-
)
%>
<%init>
)
%>
<%init>
@@
-55,6
+55,11
@@
die "access denied"
my $edit_data = $FS::CurrentUser::CurrentUser->access_right('Edit rating data');
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;
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 $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
my $qsearch = join(' AND ', @qsearch);
$qsearch = ( scalar(keys %$hashref) ? ' AND ' : ' WHERE ' ) . $qsearch