future package unsuspend date, #14144
[freeside.git] / httemplate / view / cust_main / packages / status.html
index 4492dad..28df9da 100644 (file)
@@ -61,6 +61,7 @@
 %   if ( $part_pkg->option('suspend_bill', 1) ) {
       <% pkg_status_row_if( $cust_pkg, emt('Next bill'), 'bill', %opt, curuser=>$curuser ) %>
 %   }
+    <% pkg_status_row_if( $cust_pkg, emt('Will resume'), 'resume', %opt, curuser=>$curuser ) %>
     <% pkg_status_row_if( $cust_pkg, emt('Expires'), 'expire', %opt, curuser=>$curuser ) %>
     <% pkg_status_row_if( $cust_pkg, emt('Contract ends'), 'contract_end', %opt ) %>
 
@@ -69,7 +70,8 @@
         <FONT SIZE=-1>
 %         if ( $curuser->access_right('Unsuspend customer package') ) { 
             (&nbsp;<% pkg_unsuspend_link($cust_pkg) %>&nbsp;)
-%         } 
+            (&nbsp;<% pkg_resume_link($cust_pkg) %>&nbsp;)
+%         }
 %         if ( $curuser->access_right('Cancel customer package immediately') ) {
             (&nbsp;<% pkg_cancel_link($cust_pkg) %>&nbsp;)
 %         } 
 
 %       } else { 
 %
-%         if (scalar($cust_pkg->overlimit)) {
+%         my $num_cust_svc = $cust_pkg->num_cust_svc;
+%         my $summarize = $opt{'cust_pkg-large_pkg_size'} > 0
+%                           && $opt{'cust_pkg-large_pkg_size'} <= $num_cust_svc;
+%
+%         #overlimit process is expensive with many services, so skip w/summary
+%         if ( !$summarize && scalar($cust_pkg->overlimit) ) {
 
             <% pkg_status_row_colspan( $cust_pkg,
                  emt('Overlimit'),
       <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', %opt, curuser=>$curuser ) %>
       <% pkg_status_row_if( $cust_pkg, $next_bill_or_prepaid_until, 'bill', %opt, curuser=>$curuser ) %>
       <% pkg_status_row_if($cust_pkg, emt('Will automatically suspend by'), 'autosuspend', %opt) %>
+      <% pkg_status_row_if($cust_pkg, emt('Automatic suspension delayed until'), 'dundate', %opt) %>
       <% pkg_status_row_if( $cust_pkg, emt('Will suspend on'), 'adjourn', %opt, curuser=>$curuser ) %>
+      <% pkg_status_row_if( $cust_pkg, emt('Will resume on'), 'resume', %opt, curuser=>$curuser ) %>
       <% pkg_status_row_if( $cust_pkg, emt('Expires'), 'expire', %opt, curuser=>$curuser ) %>
       <% pkg_status_row_if( $cust_pkg, emt('Contract ends'), 'contract_end', %opt ) %>
 
@@ -235,7 +244,7 @@ unless ( $part_pkg->is_prepaid ) {
 sub myfreq {
   my $part_pkg = shift;
   my $freq = $part_pkg->freq_pretty;
-  $freq =~ s/ /&nbsp;/g;
+  #$freq =~ s/ /&nbsp;/g;
   $freq;
 }
 
@@ -422,15 +431,29 @@ sub pkg_adjourn_link {
 }
 
 sub pkg_delay_link  {
+  my($cust_pkg) = shift;
   include( '/elements/popup_link-cust_pkg.html',
              'action'      => $p. 'misc/delay_susp_pkg.html',
-             'label'       => emt('Delay suspend'),
+             'label'       => ( $cust_pkg->dundate
+                                  ? emt('Edit suspension delay')
+                                  : emt('Delay suspend')
+                              ),
              'actionlabel' => emt('Delay suspend for'),
+             'cust_pkg'    => $cust_pkg,
+         )
+}
+
+sub pkg_resume_link {
+  include( '/elements/popup_link-cust_pkg.html',
+             'action'      => $p. 'misc/cancel_pkg.html?method=resume',
+             'label'       => emt('Unsuspend later'),
+             'actionlabel' => emt('Resume'),
+             'color'       => '#00CC00',
              'cust_pkg'    => shift,
          )
 }
 
-sub pkg_unsuspend_link { pkg_link('misc/unsusp_pkg',    emt('Unsuspend'), @_ ); }
+sub pkg_unsuspend_link { pkg_link('misc/unsusp_pkg',    emt('Unsuspend now'), @_ ); }
 sub pkg_unadjourn_link { pkg_link('misc/unadjourn_pkg', emt('Abort'),     @_ ); }
 sub pkg_unexpire_link  { pkg_link('misc/unexpire_pkg',  emt('Abort'),     @_ ); }