1 <% include('/elements/header.html', 'Invoice Event Listing') %>
3 <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>
5 <A HREF="<% $p %>edit/part_bill_event.cgi"><I>Add a new invoice event</I></A>
9 <% $cgi->param('showdisabled')
10 ? do { $cgi->param('showdisabled', 0);
11 '( <a href="'. $cgi->self_url. '">hide disabled events</a> )'; }
12 : do { $cgi->param('showdisabled', 1);
13 '( <a href="'. $cgi->self_url. '">show disabled events</a> )'; }
16 % tie my %payby, 'Tie::IxHash', FS::payby->cust_payby2longname;
17 % tie my %freq, 'Tie::IxHash', '1d' => 'daily', '1m' => 'monthly';
18 % foreach my $payby ( keys %payby ) {
21 % my @payby_part_bill_event =
22 % grep { $payby eq $_->payby }
23 % sort { ( $a->freq || '1d') cmp ( $b->freq || '1d' ) # for now
24 % || $a->seconds <=> $b->seconds
25 % || $a->weight <=> $b->weight
26 % || $a->eventpart <=> $b->eventpart
31 % if ( @payby_part_bill_event ) {
34 <% include('/elements/table-grid.html') %>
35 % my $bgcolor1 = '#eeeeee';
36 % my $bgcolor2 = '#ffffff';
40 % foreach my $part_bill_event ( @payby_part_bill_event ) {
41 % my $url = "${p}edit/part_bill_event.cgi?". $part_bill_event->eventpart;
42 % my $delay = duration_exact($part_bill_event->seconds);
43 % ( my $plandata = $part_bill_event->plandata ) =~ s/\n/<BR>/go;
44 % my $freq = $part_bill_event->freq || '1d';
45 % my $reason = $part_bill_event->reasontext ;
47 % if ( $oldfreq ne $freq ) {
51 <TH CLASS="grid" BGCOLOR="#999999" COLSPAN=<% $cgi->param('showdisabled') ? 7 : 8 %>><% ucfirst($freq{$freq}) %> event tests for <FONT SIZE="+1"><I><% $payby{$payby} %> customers</I></FONT></TH>
55 <TH CLASS="grid" BGCOLOR="#cccccc" COLSPAN=<% $cgi->param('showdisabled') ? 2 : 3 %>>Event</TH>
56 <TH CLASS="grid" BGCOLOR="#cccccc">After</TH>
57 <TH CLASS="grid" BGCOLOR="#cccccc">Action</TH>
58 <TH CLASS="grid" BGCOLOR="#cccccc">Reason</TH>
59 <TH CLASS="grid" BGCOLOR="#cccccc">Options</TH>
60 <TH CLASS="grid" BGCOLOR="#cccccc">Code</TH>
68 % if ( $bgcolor eq $bgcolor1 ) {
69 % $bgcolor = $bgcolor2;
71 % $bgcolor = $bgcolor1;
77 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF="<% $url %>">
78 <% $part_bill_event->eventpart %></A></TD>
79 % unless ( $cgi->param('showdisabled') ) {
81 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
82 <% $part_bill_event->disabled ? 'DISABLED' : '' %></TD>
85 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF="<% $url %>">
86 <% $part_bill_event->event %></A></TD>
87 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
89 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
90 <% $part_bill_event->plan %></TD>
91 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
93 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
95 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><FONT SIZE="-1">
96 <% $part_bill_event->eventcode %></FONT></TD>
105 <% include('/elements/footer.html') %>
110 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
113 if ( $cgi->param('showdisabled') ) {
116 %search = ( 'disabled' => '' );
119 my @part_bill_event = qsearch('part_bill_event', \%search );
120 my $total = scalar(@part_bill_event);