summaryrefslogtreecommitdiff
path: root/httemplate/browse/part_bill_event.cgi
blob: 670474d48873d3f7a95930c9ddef3d52d5ff3bfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<!-- mason kludge -->
<% 

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);

%>
<%= header('Invoice Event Listing', menubar( 'Main Menu' => $p) ) %>

    Invoice events are actions taken on overdue invoices.<BR><BR>
<A HREF="<%= $p %>edit/part_bill_event.cgi"><I>Add a new invoice event</I></A>
<BR><BR>
<%= $total %> events
<%= $cgi->param('showdisabled')
      ? do { $cgi->param('showdisabled', 0);
             '( <a href="'. $cgi->self_url. '">hide disabled events</a> )'; }
      : do { $cgi->param('showdisabled', 1);
             '( <a href="'. $cgi->self_url. '">show disabled events</a> )'; }
%>
<%= table() %>
  <TR>
    <TH COLSPAN=<%= $cgi->param('showdisabled') ? 2 : 3 %>>Event</TH>
    <TH>Payby</TH>
    <TH>After</TH>
    <TH>Action</TH>
    <TH>Options</TH>
    <TH>Code</TH>
  </TR>

<% foreach my $part_bill_event ( sort {    $a->payby     cmp $b->payby
                                        || $a->seconds   <=> $b->seconds
                                        || $a->weight    <=> $b->weight
                                        || $a->eventpart <=> $b->eventpart
                                      } @part_bill_event ) {
     my $url = "${p}edit/part_bill_event.cgi?". $part_bill_event->eventpart;
     use Time::Duration;
     my $delay = duration_exact($part_bill_event->seconds);
     my $plandata = $part_bill_event->plandata;
     $plandata =~ s/\n/<BR>/go;
%>
  <TR>
    <TD><A HREF="<%= $url %>">
      <%= $part_bill_event->eventpart %></A></TD>
<% unless ( $cgi->param('showdisabled') ) { %>
    <TD>
      <%= $part_bill_event->disabled ? 'DISABLED' : '' %></TD>
<% } %>
    <TD><A HREF="<%= $url %>">
      <%= $part_bill_event->event %></A></TD>
    <TD>
      <%= $part_bill_event->payby %></TD>
    <TD>
      <%= $delay %></TD>
    <TD>
      <%= $part_bill_event->plan %></TD>
    <TD>
      <%= $plandata %></TD>
    <TD><FONT SIZE="-1">
      <%= $part_bill_event->eventcode %></FONT></TD>
  </TR>
<% } %>
</TABLE>
</BODY>
</HTML>