+ <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
+ <TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
+%
+% sub myfreq {
+% my $part_pkg = shift;
+% my $freq = $part_pkg->freq_pretty;
+% $freq =~ s/ / /g;
+% $freq;
+% }
+%
+% #this should use cust_pkg->status and cust_pkg->statuscolor eventually
+%
+% my $colspan = $conf->exists('cust_pkg-display_times') ? 8 : 4;
+% my $width = $conf->exists('cust_pkg-display_times') ? '38%' : '56%';
+%
+% #false laziness w/edit/REAL_cust_pkg.cgi
+% my( $billed_or_prepaid, $last_bill_or_renewed, $next_bill_or_prepaid_until );
+% unless ( $part_pkg->is_prepaid ) {
+% $billed_or_prepaid = 'billed';
+% $last_bill_or_renewed = 'Last bill';
+% $next_bill_or_prepaid_until = 'Next bill';
+% } else {
+% $billed_or_prepaid = 'prepaid';
+% $last_bill_or_renewed = 'Renewed';
+% $next_bill_or_prepaid_until = 'Prepaid until';
+% }
+%
+%
+% if ( $cust_pkg->get('cancel') ) {
+ <!-- #status: cancelled -->
+
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right"><FONT COLOR="#ff0000"><B>Cancelled </B></FONT></TD>
+ <% pkg_datestr($cust_pkg, 'cancel', $conf) %>
+ </TR>
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right"><FONT COLOR="#ff0000" SIZE="-2">
+ <% $cust_pkg->last_reason ? $cust_pkg->last_reason->reason : '' %>
+ </FONT></TD>
+ </TR>
+% unless ( $cust_pkg->get('setup') ) {
+
+
+ <TR>
+ <TD COLSPAN=<%$colspan%>>Never billed</TD>
+ </TR>
+% } else {
+
+
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right">Setup </TD>
+ <% pkg_datestr($cust_pkg, 'setup', $conf) %>
+ </TR>
+% if ( $cust_pkg->get('last_bill') ) {
+
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right"><% $last_bill_or_renewed %> </TD>
+ <% pkg_datestr($cust_pkg, 'last_bill',$conf) %>
+ </TR>
+% }
+% if ( $cust_pkg->get('susp') ) {
+
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right">Suspended </TD>
+ <% pkg_datestr($cust_pkg, 'susp', $conf) %>
+ </TR>
+% }
+% }
+% } else {
+% if ( $cust_pkg->get('susp') ) {
+ <!-- #status: suspended -->
+
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right"><FONT COLOR="#FF9900"><B>Suspended</B> </FONT></TD>
+ <% pkg_datestr($cust_pkg, 'susp', $conf) %>
+ </TR>
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right"><FONT COLOR="#FF9900" SIZE="-2">
+ <% $cust_pkg->last_reason ? $cust_pkg->last_reason->reason : '' %>
+ </FONT></TD>
+ </TR>
+% unless ( $cust_pkg->get('setup') ) {
+
+
+ <TR>
+ <TD COLSPAN=<%$colspan%>>Never billed</TD>
+ </TR>
+% } else {
+
+
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right">Setup </TD>
+ <% pkg_datestr($cust_pkg, 'setup', $conf) %>
+ </TR>
+% }
+% if ( $cust_pkg->get('last_bill') ) {
+
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right"><% $last_bill_or_renewed %> </TD>
+ <% pkg_datestr($cust_pkg, 'last_bill', $conf) %>
+ </TR>
+% }
+
+
+ <!-- # next bill ?? -->
+% if ( $cust_pkg->get('expire') ) {
+
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right">Expires </TD>
+ <% pkg_datestr($cust_pkg, 'expire', $conf) %>
+ </TR>
+% }
+
+
+ <TR>
+ <TD COLSPAN=<%$colspan%>>
+ <FONT SIZE=-1>
+% if ( $curuser->access_right('Unsuspend customer package') ) {
+
+ ( <% pkg_unsuspend_link($cust_pkg) %> )
+% }
+% if ( $curuser->access_right('Cancel customer package immediately') ) {
+
+ ( <% pkg_cancel_link($cust_pkg) %> )
+% }
+
+ </FONT>
+ </TD>
+ </TR>
+% } else {
+ <!-- #status: active -->
+% unless ( $cust_pkg->get('setup') ) {
+ <!-- #not setup -->
+% unless ( $part_pkg->freq ) {
+
+
+ <TR>
+ <TD COLSPAN=<%$colspan%>>Not yet billed (one-time charge)</TD>
+ </TR>
+
+ <TR>
+ <TD COLSPAN=<%$colspan%>>
+ <FONT SIZE=-1>
+% if ( $curuser->access_right('Cancel customer package immediately') ) {
+
+ ( <% pkg_cancel_link($cust_pkg) %> )
+% }
+
+ </FONT>
+ </TD>
+ </TR>
+% } else {
+
+
+ <TR>
+ <TD COLSPAN=<%$colspan%>>Not yet billed (<% $billed_or_prepaid %> <% myfreq($part_pkg) %>)</TD>
+ </TR>
+% }
+% } else {
+ <!-- #setup -->
+% unless ( $part_pkg->freq ) {
+
+
+ <TR>
+ <TD COLSPAN=<%$colspan%>>One-time charge</TD>
+ </TR>
+
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right">Billed </TD>
+ <% pkg_datestr($cust_pkg, 'setup', $conf) %>
+ </TR>
+% } else {
+% if (scalar($cust_pkg->overlimit)) {
+ <TR>
+ <TD COLSPAN=<%$colspan%>><FONT COLOR="#FFD000"><B>Overlimit</B></FONT>, <% $billed_or_prepaid %> <% myfreq($part_pkg) %></TD>
+ </TR>
+%}else{
+ <TR>
+ <TD COLSPAN=<%$colspan%>><FONT COLOR="#00CC00"><B>Active</B></FONT>, <% $billed_or_prepaid %> <% myfreq($part_pkg) %></TD>
+ </TR>
+% }
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right">Setup </TD>
+ <% pkg_datestr($cust_pkg, 'setup', $conf) %>
+ </TR>
+% }
+% }
+% if ( $cust_pkg->get('last_bill') ) {
+
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right"><% $last_bill_or_renewed %> </TD>
+ <% pkg_datestr($cust_pkg, 'last_bill', $conf) %>
+ </TR>
+% }
+% if ( $cust_pkg->get('bill') ) { #next bill
+
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right"><% $next_bill_or_prepaid_until %> </TD>
+ <% pkg_datestr($cust_pkg, 'bill', $conf) %>
+ </TR>
+% }
+% if ( $cust_pkg->get('adjourn') ) {
+
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right">Adjourns </TD>
+ <% pkg_datestr($cust_pkg, 'adjourn', $conf) %>
+ </TR>
+% }
+% if ( $cust_pkg->get('expire') ) {
+
+ <TR>
+ <TD WIDTH="<%$width%>" ALIGN="right">Expires </TD>
+ <% pkg_datestr($cust_pkg, 'expire', $conf) %>
+ </TR>
+% }
+% if ( $part_pkg->freq ) {
+
+ <TR>
+ <TD COLSPAN=<%$colspan%>>
+ <FONT SIZE=-1>
+% if ( $curuser->access_right('Suspend customer package') ) {
+
+ ( <% pkg_suspend_link($cust_pkg) %> )
+% }
+% if ( $curuser->access_right('Suspend customer package later') ) {
+
+ ( <% pkg_adjourn_link($cust_pkg) %> )
+% }
+% if ( $curuser->access_right('Cancel customer package immediately') ) {
+
+ ( <% pkg_cancel_link($cust_pkg) %> )
+% }
+% if ( $curuser->access_right('Cancel customer package later') ) {
+
+ ( <% pkg_expire_link($cust_pkg) %> )
+% }
+
+ <FONT>
+ </TD>
+ </TR>
+% }
+% }
+% }