From: ivan Date: Tue, 15 Jun 2010 06:40:03 +0000 (+0000) Subject: ticket # and account(customer) options for time worked report X-Git-Tag: root_of_svc_elec_features~165 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=50de3921a10ae2ecc890c8661aa772dce72f0c53 ticket # and account(customer) options for time worked report --- diff --git a/httemplate/search/rt_transaction.html b/httemplate/search/rt_transaction.html index d1097c1fe..8dda4baea 100644 --- a/httemplate/search/rt_transaction.html +++ b/httemplate/search/rt_transaction.html @@ -54,8 +54,9 @@ my $transactiontime = " "; my $join = 'JOIN Tickets ON Transactions.ObjectId = Tickets.Id '. - 'JOIN Users ON Transactions.Creator = Users.Id '; - + 'JOIN Users ON Transactions.Creator = Users.Id '. + 'LEFT JOIN acct_rt_transaction '. + ' ON Transactions.Id = acct_rt_transaction.transaction_id'; my $where = " WHERE objecttype='RT::Ticket' AND ( ( Transactions.Type = 'Set' @@ -96,15 +97,13 @@ my $query = { '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. - 'LEFT JOIN acct_rt_transaction '. - ' ON Transactions.Id = acct_rt_transaction.transaction_id', + 'addl_from' => $join, 'extra_sql' => $where, 'order by' => 'ORDER BY Created', }; my $count_query = - "SELECT COUNT(*), SUM($transactiontime), SUM(support) FROM Transactions $join $where"; + "SELECT COUNT(*), SUM($transactiontime), SUM(acct_rt_transaction.support) FROM Transactions $join $where"; my $link = [ "${p}rt/Ticket/Display.html?id=", sub { shift->get('ticketid'); } ];