optimize CDR rating after timed rate perf regression, RT#15739
[freeside.git] / httemplate / browse / part_bill_event.cgi
index 2486c66..11bc14e 100755 (executable)
@@ -1,19 +1,6 @@
-% 
-%my %search;
-%if ( $cgi->param('showdisabled') ) {
-%  %search = ();
-%} else {
-%  %search = ( 'disabled' => '' );
-%}
-%
-%my @part_bill_event = qsearch('part_bill_event', \%search );
-%my $total = scalar(@part_bill_event);
-%
-
+<% include('/elements/header.html', 'Invoice Event Listing') %>
 
-<% include("/elements/header.html",'Invoice Event Listing', menubar( 'Main Menu' => $p) ) %>
-
-    Invoice events are actions taken on open invoices.<BR><BR>
+    <FONT SIZE="+1">Invoice events are the deprecated, old-style actions taken on open invoices.  Any events still listed here should be migrated to new-style events.</FONT><BR><BR>
 
 <A HREF="<% $p %>edit/part_bill_event.cgi"><I>Add a new invoice event</I></A>
 <BR><BR>
@@ -55,6 +42,7 @@
 %         my $delay = duration_exact($part_bill_event->seconds);
 %         ( my $plandata = $part_bill_event->plandata ) =~ s/\n/<BR>/go;
 %         my $freq = $part_bill_event->freq || '1d';
+%         my $reason = $part_bill_event->reasontext ;
 %    
 % if ( $oldfreq ne $freq ) { 
 
@@ -67,6 +55,7 @@
           <TH CLASS="grid" BGCOLOR="#cccccc" COLSPAN=<% $cgi->param('showdisabled') ? 2 : 3 %>>Event</TH>
           <TH CLASS="grid" BGCOLOR="#cccccc">After</TH>
           <TH CLASS="grid" BGCOLOR="#cccccc">Action</TH>
+          <TH CLASS="grid" BGCOLOR="#cccccc">Reason</TH>
           <TH CLASS="grid" BGCOLOR="#cccccc">Options</TH>
           <TH CLASS="grid" BGCOLOR="#cccccc">Code</TH>
         </TR>
         <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
           <% $part_bill_event->plan %></TD>
         <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+          <% $reason %></TD>
+        <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
           <% $plandata %></TD>
         <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><FONT SIZE="-1">
           <% $part_bill_event->eventcode %></FONT></TD>
 % } 
 % } 
 
+<% include('/elements/footer.html') %>
+
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+my %search;
+if ( $cgi->param('showdisabled') ) {
+%search = ();
+} else {
+%search = ( 'disabled' => '' );
+}
+
+my @part_bill_event = qsearch('part_bill_event', \%search );
+my $total = scalar(@part_bill_event);
 
-</BODY>
-</HTML>
+</%init>