From 4f25d34901fb6a358af5b5009608c5162e745042 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 15 Jun 2010 06:06:54 +0000 Subject: [PATCH] ticket # and account(customer) options for time worked report --- httemplate/search/report_rt_transaction.html | 32 ++++++++++++++++++++++++++++ httemplate/search/rt_transaction.html | 4 ++++ 2 files changed, 36 insertions(+) diff --git a/httemplate/search/report_rt_transaction.html b/httemplate/search/report_rt_transaction.html index 9b7b7cbbb..61445bd1e 100644 --- a/httemplate/search/report_rt_transaction.html +++ b/httemplate/search/report_rt_transaction.html @@ -8,6 +8,24 @@ <% include ( '/elements/tr-select-otaker.html' ) %> + <% include ( '/elements/tr-input-text.html', + 'label' => 'Ticket #', + 'field' => 'ticketid', + ) + %> + + + Account + + + + +
@@ -21,4 +39,18 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('List rating data'); +my $conf = new FS::Conf; + +my @pkgparts = $conf->config('support_packages'); + +my @svc_acct = (); +if ( @pkgparts ) { + @svc_acct = qsearch({ + 'table' => 'svc_acct', + 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '. + ' LEFT JOIN cust_pkg USING ( pkgnum ) ', + 'extra_sql' => 'WHERE pkgpart IN ('. join(',', @pkgparts). ')', + }); +} + diff --git a/httemplate/search/rt_transaction.html b/httemplate/search/rt_transaction.html index 67048cf35..34fb733a3 100644 --- a/httemplate/search/rt_transaction.html +++ b/httemplate/search/rt_transaction.html @@ -77,6 +77,10 @@ if ( $cgi->param('otaker') && $cgi->param('otaker') =~ /^([\w\.\-]+)$/ ) { $where .= " AND Users.name = '$1' "; } +if ( $cgi->param('ticketid') =~ /^\s*(\d+)\s*$/ ) { + $where .= " AND Tickets.ID = $1"; +} + my $query = { 'select' => "Transactions.*, Tickets.Id AS ticketid, Tickets.Subject, Users.name as otaker, $transactiontime AS transaction_time", #'table' => 'Transactions', -- 2.11.0