Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / httemplate / view / cust_main / packages / status.html
index 3641964..3515b38 100644 (file)
@@ -69,6 +69,8 @@
 
     <% pkg_status_row_noauto( $cust_pkg, %opt ) %>
 
+    <% pkg_status_row_separate_bill( $cust_pkg, %opt ) %>
+
     <% pkg_status_row_discount( $cust_pkg, %opt ) %>
 
 %   unless ( $cust_pkg->order_date eq $cust_pkg->get('susp') ) { #on hold
 
           <% pkg_status_row_noauto( $cust_pkg, %opt ) %>
 
+          <% pkg_status_row_separate_bill( $cust_pkg, %opt ) %>
+
           <% pkg_status_row_discount( $cust_pkg, %opt ) %>
 
           <% pkg_status_row_if(
 
           <% pkg_status_row_noauto( $cust_pkg, %opt ) %>
 
+          <% pkg_status_row_separate_bill( $cust_pkg, %opt ) %>
+
           <% pkg_status_row_discount( $cust_pkg, %opt ) %>
 
           <% pkg_status_row_if($cust_pkg, emt('Start billing'), 'start_date', %opt) %>
 
           <% pkg_status_row_noauto( $cust_pkg, %opt ) %>
 
+          <% pkg_status_row_separate_bill( $cust_pkg, %opt ) %>
+
           <% pkg_status_row_discount( $cust_pkg, %opt ) %>
 
           <% pkg_status_row_if($cust_pkg, emt('Un-cancelled'), 'uncancel', %opt ) %>
 
           <% pkg_status_row_noauto( $cust_pkg, %opt ) %>
 
+          <% pkg_status_row_separate_bill( $cust_pkg, %opt ) %>
+
           <% pkg_status_row_discount( $cust_pkg, %opt ) %>
 
           <% pkg_status_row($cust_pkg, emt('Setup'), 'setup', %opt) %>
@@ -484,16 +494,17 @@ sub pkg_status_row_detached {
 
 sub pkg_status_row_noauto {
   my( $cust_pkg, %opt ) = @_;
-  my $part_pkg = $opt{'part_pkg'};
-  return '' unless $cust_pkg->no_auto || $part_pkg->no_auto;
 
-  #inefficient, should be passed in
-  my $cust_main = $cust_pkg->cust_main;
+  return '' unless ( $cust_pkg->no_auto || $opt{'part_pkg'}->no_auto );
+                && $opt{'has_cust_payby_auto'};
 
-  return '' unless $cust_main->payby =~ /^(CARD|CHEK)$/;
-  my $what = lc(FS::payby->shortname($cust_main->payby));
+  pkg_status_row_colspan( $cust_pkg, emt("No automatic charge"), '');
+}
 
-  pkg_status_row_colspan( $cust_pkg, emt("No automatic $what charge"), '');
+sub pkg_status_row_separate_bill {
+  my $cust_pkg = shift;
+  return '' unless $cust_pkg->separate_bill;
+  pkg_status_row_colspan( $cust_pkg, emt("Invoiced separately") );
 }
 
 sub pkg_status_row_discount {