'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')) },
sub { my $seconds = shift->get('transaction_time');
&{ $format_seconds_sub }( $seconds );
},
+ sub { my $seconds = shift->get('support');
+ &{ $format_seconds_sub }( $seconds );
+ },
],
'links' => [
$link,
$link,
'',
'',
+ '',
],
)
%>
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>
$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.
};
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'); } ];