AW: [rt-users] billing/invoicing out of RT

rt-users rt-users at lists.netways.de
Thu Nov 21 13:41:01 EST 2002


Hi,

you could use keywords, to set the division worked for. Then you can report on keywords in a given time frame. 

This is a very rough keyword report, you could use. Things may not work as expected!!

Julian




REPORT:

%if ($type ne "excel") {
 <& /Elements/Header, Title => 'Reports/Keywords/Keywords Ticketstatus' &>
 <& /Reports/Elements/KeywordTabs &>

 <form method="POST" name="TicketUpdate">
 <& /Elements/TitleBoxStart, title=>'Report options' &>
 <& /Reports/Elements/SelectDates, BeginDate=>$Begin_Date, EndDate=>$End_Date &>
 <& /Elements/TitleBoxEnd &>
 <BR>
<& /Elements/TitleBoxStart, title=> "tickets from ".$BeginDate->ISO." until ".$EndDate->ISO &>
% } 

<table border="1">
<tr>
  <th>Queue</th>
  <th>Select</th>
  <th>Keyword</th>
  <th>new</th>
  <th>open</th>
  <th>stalled</th>
  <th>resolved</th>
</tr>
% while ( my $Queue = $Queues->Next) { 
    <tr><td colspan="7"><% $Queue->Name %></td></tr>
%     my $KeywordSelects = $Queue->KeywordSelects();
%     while (my $KeywordSelect = $KeywordSelects->Next) {
        <tr><td> </td><td colspan="6"><% $KeywordSelect->Name %></td></tr>
%       my $Descendents = $KeywordSelect->KeywordObj->Descendents;
%   if ( $KeywordSelect->Single) {
%      $Descendents->{null} = "no Keyword";
%   }
%       foreach my $kid ( keys %{$Descendents} ) {
        <tr><td colspan="2"> </td><td><% $Descendents->{$kid} %></td>
%       for my $Status (@Stati) {
%         my $numberof = 0;
%         my $Tickets = new RT::Tickets($session{'CurrentUser'});
%         $Tickets->LimitQueue(VALUE=>$Queue->id);
%         my $quote="1";
%         my $oper="=";
%         if ($kid eq "null") {
%           $quote="0";
%           $oper="IS";
%         }
%         $Tickets->LimitKeyword(KEYWORDSELECT=>$KeywordSelect->id, OPERATOR=>$oper, QUOTEVALUE=>$quote, KEYWORD=>$kid);

%         if ($Status eq "new") {
%           $Tickets->LimitStatus(VALUE=>"new");
%           $Tickets->LimitLastUpdated(VALUE => $BeginDate->ISO, OPERATOR => ">=");
%           $Tickets->LimitLastUpdated(VALUE => $EndDate->ISO, OPERATOR => "<=");
%           $numberof = $Tickets->Count();
%         }

%         if ($Status eq "open") {
%           $Tickets->LimitStatus(VALUE=>"open");
%           $Tickets->LimitLastUpdated(VALUE => $BeginDate->ISO, OPERATOR => ">=");
%           $Tickets->LimitLastUpdated(VALUE => $EndDate->ISO, OPERATOR => "<=");
%           $numberof = $Tickets->Count();
%         }

%         if ($Status eq "stalled") {
%           $Tickets->LimitStatus(VALUE=>"stalled");
%           $Tickets->LimitLastUpdated(VALUE => $BeginDate->ISO, OPERATOR => ">=");
%           $Tickets->LimitLastUpdated(VALUE => $EndDate->ISO, OPERATOR => "<=");
%           $numberof = $Tickets->Count();
%         }

%         if ($Status eq "resolved") {
%           $Tickets->LimitStatus(VALUE=>"resolved");
%           $Tickets->LimitLastUpdated(VALUE => $BeginDate->ISO, OPERATOR => ">=");
%           $Tickets->LimitLastUpdated(VALUE => $EndDate->ISO, OPERATOR => "<=");
%           $numberof = $Tickets->Count();
%         }

        <td><% ($numberof || "0") %></td>
%     }
%   }
% }
</tr>
% }
</table>
% if ($type ne "excel") {
<& /Elements/TitleBoxEnd &>
% }

<%ARGS>
$Begin_Date => undef
$End_Date => undef
$type => undef
</%ARGS>

<%INIT>
# Select the dates
my $BeginDate = new RT::Date ($session{'Current_User'});
my $EndDate = new RT::Date ($session{'Current_User'});
$BeginDate->Set(Value => $Begin_Date, Format => 'unknown' );
$EndDate->Set(Value => $End_Date, Format => 'unknown' );

# If no dates are given, suppose a week
if (!$End_Date) { 
  $EndDate->SetToNow();
} 
if (!$Begin_Date) {
  $BeginDate->SetToNow;
  $BeginDate->AddDays (-7);
} 

$BeginDate->SetToMidnight();
$BeginDate->AddDays (+1);
$EndDate->SetToMidnight();
$EndDate->AddDays(+1);


# A queue object
my $Queues = new RT::Queues($session{'CurrentUser'}); 
$Queues->UnLimit();

# This is what we want to see
my @Stati = qw (new open stalled resolved);

if ($type eq "excel") {
    $r->content_type('application/vnd.ms-excel');
}
</%INIT>

SelectDate:

<table border="0" cellspacing="0" cellpadding="0">
	<TR>
  	<TD>Begin date:</TD>
  	<TD>
   		<a href="javascript:show_calendar('TicketUpdate.Begin_Date');";return true;">
   		<img src="<%$RT::WebPath%>/NoAuth/images/calender.gif" border="0"></a>
   		<& /Elements/SelectDate, menu_prefix => 'Begin', Default=>$BeginDate, current => 0 &>
  	</TD>
  	<TD><input type="radio" name="type" value="excel"> Export to excel</td>
	</TR>
	<TR>
  	<TD>End date:</TD>
  	<TD>
   		<a href="javascript:show_calendar('TicketUpdate.End_Date');";return true;">
   		<img src="<%$RT::WebPath%>/NoAuth/images/calender.gif" border="0"></a>
   		<& /Elements/SelectDate, menu_prefix => 'End', Default=>$EndDate, current => 0 &>
  	</TD>
  	<TD><INPUT TYPE="submit" VALUE="Go!"</INPUT></TD>
	</TR>
</TABLE>


<%ARGS>
$BeginDate => undef
$EndDate => undef
</%ARGS>


-----Ursprüngliche Nachricht-----
Von: Fred Purdue [mailto:FPurdue at newopportunitiesinc.org] 
Bereitgestellt: Donnerstag, 14. November 2002 19:09
Bereitgestellt in: rt-users
Unterhaltung: [rt-users] billing/invoicing out of RT
Betreff: [rt-users] billing/invoicing out of RT


Ladies & Gents,

One of my customers is currently using RT and loving it, but they are running into a problem and are looking for a better way to handle a process:

They currently keep each division in it's own queue and then they use an internal billing policy to 'charge back' the costs of IT on a per ticket basis.  Right now they do this by opening each resolved ticket in a time period and writing down the division name, the time spent on the ticket by each helpdesk staff member (different rates), and the resolved date.  This is obviously pretty time consuming...  Is there a better way to do this?  What is the best way to get RT to give out a report that looks like this.

Please keep in mind I while I have a good conceptual idea of what RT is doing under the hood and I have done *some* customization of it, answers that involve "write a perl script to do this" will be met with a blank stare...

Ideas?

Fred

--=--
Fred Purdue
New Opportunities, Inc.
232 N. Elm St
Waterbury, CT 06702
  -
FPurdue at NewOpportunitiesInc.org
P: 203.575.9799 x259
C: 203.887.5150
--=-- 



More information about the rt-users mailing list