[freeside-commits] freeside/httemplate/search rt_transaction.html, 1.4, 1.5
Ivan,,,
ivan at wavetail.420.am
Mon Jun 14 23:35:50 PDT 2010
Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv27498
Modified Files:
rt_transaction.html
Log Message:
ticket # and account(customer) options for time worked report
Index: rt_transaction.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/rt_transaction.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -d -r1.4 -r1.5
--- rt_transaction.html 15 Jun 2010 06:06:54 -0000 1.4
+++ rt_transaction.html 15 Jun 2010 06:35:47 -0000 1.5
@@ -3,11 +3,12 @@
'name_singular' => 'transaction',
'query' => $query,
'count_query' => $count_query,
- 'count_addl' => [ $format_seconds_sub, ],
+ 'count_addl' => [ $format_seconds_sub, $format_seconds_sub, ],
'header' => [ 'Ticket #',
'Ticket',
'Date',
'Time',
+ 'Applied',
],
'fields' => [ 'ticketid',
sub { encode_entities(shift->get('subject')) },
@@ -15,12 +16,16 @@
sub { my $seconds = shift->get('transaction_time');
&{ $format_seconds_sub }( $seconds );
},
+ sub { my $seconds = shift->get('support');
+ &{ $format_seconds_sub }( $seconds );
+ },
],
'links' => [
$link,
$link,
'',
'',
+ '',
],
)
%>
@@ -28,7 +33,9 @@
my $format_seconds_sub = sub {
my $seconds = shift;
- (($seconds < 0) ? '-' : '') . concise(duration($seconds));
+ #(($seconds < 0) ? '-' : '') . concise(duration($seconds));
+ (($seconds < 0) ? '-' : '' ). int(abs($seconds)/3600)."h".sprintf("%02d",(abs(
+$seconds)%3600)/60)."m";
};
</%once>
@@ -81,8 +88,12 @@
$where .= " AND Tickets.ID = $1";
}
+if ( $cgi->param('svcnum') =~ /^\s*(\d+)\s*$/ ) {
+ $where .= " AND acct_rt_transaction.svcnum = $1";
+}
+
my $query = {
- 'select' => "Transactions.*, Tickets.Id AS ticketid, Tickets.Subject, Users.name as otaker, $transactiontime AS transaction_time",
+ 'select' => "Transactions.*, Tickets.Id AS ticketid, Tickets.Subject, Users.name as otaker, $transactiontime AS transaction_time, acct_rt_transaction.support",
#'table' => 'Transactions',
'table' => 'transactions',
'addl_from' => $join.
@@ -93,7 +104,7 @@
};
my $count_query =
- "SELECT COUNT(*), SUM($transactiontime) FROM Transactions $join $where";
+ "SELECT COUNT(*), SUM($transactiontime), SUM(support) FROM Transactions $join $where";
my $link = [ "${p}rt/Ticket/Display.html?id=", sub { shift->get('ticketid'); } ];
More information about the freeside-commits
mailing list