Merge branch 'master' of git.freeside.biz:/home/git/freeside
authorIvan Kohler <ivan@freeside.biz>
Mon, 9 Jul 2012 05:45:58 +0000 (22:45 -0700)
committerIvan Kohler <ivan@freeside.biz>
Mon, 9 Jul 2012 05:45:58 +0000 (22:45 -0700)
Conflicts:
httemplate/misc/process/cancel_pkg.html

FS/FS/cust_main/Billing.pm
FS/FS/cust_main/Packages.pm
FS/FS/cust_pkg.pm
FS/FS/domain_record.pm
bin/23commit
fs_selfservice/FS-SelfService/cgi/myaccount.html
fs_selfservice/FS-SelfService/cgi/provision_list.html
httemplate/edit/radius_group.html
httemplate/misc/cancel_pkg.html
httemplate/misc/process/cancel_pkg.html
httemplate/view/cust_main/packages/status.html

index e7b9530..bab94c3 100644 (file)
@@ -968,7 +968,10 @@ sub _make_lines {
   my @recur_discounts = ();
   my $sdate;
   if (     ! $cust_pkg->start_date
-       and ( ! $cust_pkg->susp || $part_pkg->option('suspend_bill', 1) )
+       and ( ! $cust_pkg->susp || $cust_pkg->option('suspend_bill',1)
+                               || ( $part_pkg->option('suspend_bill', 1) )
+                                     && ! $cust_pkg->option('no_suspend_bill',1)
+                                  )
        and
             ( $part_pkg->freq ne '0' && ( $cust_pkg->bill || 0 ) <= day_end($time) )
          || ( $part_pkg->plan eq 'voip_cdr'
index 957043a..11c13e5 100644 (file)
@@ -412,7 +412,11 @@ sub billing_pkgs {
   my $self = shift;
   grep { my $part_pkg = $_->part_pkg;
          $part_pkg->freq ne '' && $part_pkg->freq ne '0'
-           && ( ! $_->susp || $part_pkg->option('suspend_bill', 1) );
+           && ( ! $_->susp || $_->option('suspend_bill',1)
+                           || ( $part_pkg->option('suspend_bill', 1)
+                                  && ! $_->option('no_suspend_bill',1)
+                              )
+              );
        }
        $self->ncancelled_pkgs;
 }
index 22559e9..627a7fc 100644 (file)
@@ -1189,8 +1189,13 @@ sub suspend {
     $hash{'resume'} = $resume_date;
   }
 
+  $options{options} ||= {};
+
   my $new = new FS::cust_pkg ( \%hash );
-  $error = $new->replace( $self, options => { $self->options } );
+  $error = $new->replace( $self, options => { $self->options,
+                                              %{ $options{options} },
+                                            }
+                        );
   if ( $error ) {
     $dbh->rollback if $oldAutoCommit;
     return $error;
index 8d767d5..cd881ae 100644 (file)
@@ -3,8 +3,7 @@ package FS::domain_record;
 use strict;
 use vars qw( @ISA $noserial_hack $DEBUG $me );
 use FS::Conf;
-#use FS::Record qw( qsearch qsearchs );
-use FS::Record qw( qsearchs dbh );
+use FS::Record qw( qsearchs dbh ); #qsearch
 use FS::svc_domain;
 use FS::svc_www;
 
index b7b0c1e..d64459c 100755 (executable)
@@ -19,7 +19,7 @@ die "no files!" unless @ARGV;
 #print <<END;
 system join('',
   "( cd /home/$USER/freeside2.3/$prefix; git pull ) && ",
-  "git diff -u @ARGV | ( cd /home/$USER/freeside2.3/$prefix; patch  ) ",
+  "git diff -u @ARGV | ( cd /home/$USER/freeside2.3/$prefix; patch -p1 ) ",
   " && ( ( git pull && git commit  -m $desc @ARGV && git push ); ",
   "( cd /home/$USER/freeside2.3/$prefix; git commit -m $desc @ARGV && git push ) )"
 );
index 5370f7c..9ab2622 100644 (file)
@@ -6,7 +6,7 @@ Hello <%= $name %>!<BR><BR>
 <%= include('small_custview') %>
 
 <BR>
-<%= if ( $access_pkgnum ) {
+<%= unless ( $access_pkgnum ) {
       $OUT .= qq!Balance: <B>\$$balance</B><BR><BR>!;
     }
     '';
index 22054e6..2a3a8e9 100644 (file)
@@ -10,7 +10,6 @@ foreach my $pkg (
          } @cust_pkg
     ) {
   my $susp = $pkg->{'susp'} || '';
-  warn $pkg->{'pkg'}. ' '.$susp."\n";
   my @pkg_actions = ( [ 'customer_change_pkg' => 'change' ] );
   push @pkg_actions, [ 'process_suspend_pkg' => 'suspend' ] 
     if $self_suspend_reason and !$susp;
index 0255611..0c99b4c 100644 (file)
@@ -8,6 +8,7 @@
     'attrnum'   => 'Attribute',
     'priority'  => 'Priority',
   },
+  'viewall_dir' => 'browse',
   'menubar' => \@menubar,
   'edit_callback' => $edit_callback,
   'error_callback' => $edit_callback,
index 348f0a6..f9a46a8 100755 (executable)
   &>
 % }
 
-% if ( ( $method eq 'adjourn' or $method eq 'suspend' ) and 
+% if ( $method eq 'adjourn' || $method eq 'suspend' ) {
+    <TR><TD COLSPAN=2>
+%   if ( $part_pkg->option('suspend_bill', 1) ) {
+      <& /elements/checkbox.html, name=>'no_suspend_bill', value=>'Y' &>
+      Disable recurring billing while suspended
+%   } else {
+      <& /elements/checkbox.html, name=>'suspend_bill', value=>'Y' &>
+      Continue recurring billing while suspended
+%   }
+    </TD></TR>
+% }
+
+% if ( ( $method eq 'adjourn' || $method eq 'suspend' ) and 
 %      $curuser->access_right('Unsuspend customer package') )  { #later?
 %   my $resume_date = $cgi->param('error') 
 %                     ? str2time($cgi->param('resume_date'))
index b2d7bfa..79e489c 100755 (executable)
@@ -52,10 +52,15 @@ if ($method eq 'expire' || $method eq 'adjourn' || $method eq 'resume') {
   $method = 'unsuspend' if $method eq 'resume';
 }
 
-my $resume_date;
+my $resume_date = '';
+my $options = '';
 if ( $method eq 'suspend' ) { #or 'adjourn'
   $resume_date = parse_datetime($cgi->param('resume_date'))
     if $cgi->param('resume_date');
+
+  $options = { map scalar($cgi->param($_)),
+                 suspend_bill no_suspend_bill
+             };
 }
 
 my $cust_pkg = qsearchs( 'cust_pkg', {'pkgnum'=>$pkgnum} );
@@ -88,6 +93,7 @@ my $error = $cust_pkg->$method( 'reason'      => $reasonnum,
                                 'last_bill'   => $last_bill,
                                 'bill'        => $bill,
                                 'svc_fatal'   => $svc_fatal,
+                                'options'     => $options,
                               );
 
 if ($error) {
index 4aec90e..e901774 100644 (file)
 
     <% pkg_status_row_changed( $cust_pkg, %opt, 'colspan'=>$colspan ) %>
     <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', %opt, curuser=>$curuser ) %>
-%   if ( $part_pkg->option('suspend_bill', 1) ) {
+%   if ( $cust_pkg->option('suspend_bill', 1)
+%        || ( $part_pkg->option('suspend_bill', 1)
+%               && ! $cust_pkg->option('no_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 ) %>