3 if ( $cgi->param('showdisabled') ) {
6 %search = ( 'disabled' => '' );
9 my @part_bill_event = qsearch('part_bill_event', \%search );
10 my $total = scalar(@part_bill_event);
13 <%= include("/elements/header.html",'Invoice Event Listing', menubar( 'Main Menu' => $p) ) %>
15 Invoice events are actions taken on open invoices.<BR><BR>
17 <A HREF="<%= $p %>edit/part_bill_event.cgi"><I>Add a new invoice event</I></A>
21 <%= $cgi->param('showdisabled')
22 ? do { $cgi->param('showdisabled', 0);
23 '( <a href="'. $cgi->self_url. '">hide disabled events</a> )'; }
24 : do { $cgi->param('showdisabled', 1);
25 '( <a href="'. $cgi->self_url. '">show disabled events</a> )'; }
29 <% tie my %payby, 'Tie::IxHash', FS::payby->cust_payby2longname;
30 tie my %freq, 'Tie::IxHash', '1d' => 'daily', '1m' => 'monthly';
31 foreach my $payby ( keys %payby ) {
34 my @payby_part_bill_event =
35 grep { $payby eq $_->payby }
36 sort { ( $a->freq || '1d') cmp ( $b->freq || '1d' ) # for now
37 || $a->seconds <=> $b->seconds
38 || $a->weight <=> $b->weight
39 || $a->eventpart <=> $b->eventpart
45 <% if ( @payby_part_bill_event ) { %>
47 <%= include('/elements/table-grid.html') %>
49 <% my $bgcolor1 = '#eeeeee';
50 my $bgcolor2 = '#ffffff';
55 foreach my $part_bill_event ( @payby_part_bill_event ) {
56 my $url = "${p}edit/part_bill_event.cgi?". $part_bill_event->eventpart;
57 my $delay = duration_exact($part_bill_event->seconds);
58 ( my $plandata = $part_bill_event->plandata ) =~ s/\n/<BR>/go;
59 my $freq = $part_bill_event->freq || '1d';
62 <% if ( $oldfreq ne $freq ) { %>
65 <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>
69 <TH CLASS="grid" BGCOLOR="#cccccc" COLSPAN=<%= $cgi->param('showdisabled') ? 2 : 3 %>>Event</TH>
70 <TH CLASS="grid" BGCOLOR="#cccccc">After</TH>
71 <TH CLASS="grid" BGCOLOR="#cccccc">Action</TH>
72 <TH CLASS="grid" BGCOLOR="#cccccc">Options</TH>
73 <TH CLASS="grid" BGCOLOR="#cccccc">Code</TH>
84 if ( $bgcolor eq $bgcolor1 ) {
92 <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"><A HREF="<%= $url %>">
93 <%= $part_bill_event->eventpart %></A></TD>
94 <% unless ( $cgi->param('showdisabled') ) { %>
95 <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>">
96 <%= $part_bill_event->disabled ? 'DISABLED' : '' %></TD>
98 <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"><A HREF="<%= $url %>">
99 <%= $part_bill_event->event %></A></TD>
100 <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>">
102 <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>">
103 <%= $part_bill_event->plan %></TD>
104 <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>">
105 <%= $plandata %></TD>
106 <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"><FONT SIZE="-1">
107 <%= $part_bill_event->eventcode %></FONT></TD>