[freeside-commits] branch master updated. a6fe07e49e3fc12169e801b1ed6874c3a5bd8500

Ivan ivan at 420.am
Sun Jul 8 22:47:00 PDT 2012


The branch, master has been updated
       via  a6fe07e49e3fc12169e801b1ed6874c3a5bd8500 (commit)
       via  e27244386c346f459d1569db26344407a0372a05 (commit)
       via  4db3780dd49caf7b84e48fe1cfc72f1d13f1282c (commit)
      from  005424d0c899aa899f43f583a6c74deb13ea4be1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a6fe07e49e3fc12169e801b1ed6874c3a5bd8500
Merge: e272443 005424d
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Jul 8 22:45:58 2012 -0700

    Merge branch 'master' of git.freeside.biz:/home/git/freeside
    
    Conflicts:
    	httemplate/misc/process/cancel_pkg.html

diff --cc FS/FS/domain_record.pm
index 8d767d5,8d767d5..cd881ae
--- a/FS/FS/domain_record.pm
+++ b/FS/FS/domain_record.pm
@@@ -3,8 -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;
  
diff --cc bin/23commit
index b7b0c1e,b7b0c1e..d64459c
--- a/bin/23commit
+++ b/bin/23commit
@@@ -19,7 -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 ) )"
  );
diff --cc fs_selfservice/FS-SelfService/cgi/myaccount.html
index f82b706,5370f7c..9ab2622
--- a/fs_selfservice/FS-SelfService/cgi/myaccount.html
+++ b/fs_selfservice/FS-SelfService/cgi/myaccount.html
@@@ -2,9 -2,11 +2,11 @@@
  <%= include('header', 'My Account') %>
  
  Hello <%= $name %>!<BR><BR>
- <%= $small_custview %>
+ 
+ <%= include('small_custview') %>
+ 
  <BR>
 -<%= if ( $access_pkgnum ) {
 +<%= unless ( $access_pkgnum ) {
        $OUT .= qq!Balance: <B>\$$balance</B><BR><BR>!;
      }
      '';
diff --cc fs_selfservice/FS-SelfService/cgi/provision_list.html
index 22054e6,22054e6..2a3a8e9
--- a/fs_selfservice/FS-SelfService/cgi/provision_list.html
+++ b/fs_selfservice/FS-SelfService/cgi/provision_list.html
@@@ -10,7 -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;
diff --cc httemplate/edit/radius_group.html
index 0255611,0255611..0c99b4c
--- a/httemplate/edit/radius_group.html
+++ b/httemplate/edit/radius_group.html
@@@ -8,6 -8,6 +8,7 @@@
      'attrnum'   => 'Attribute',
      'priority'  => 'Priority',
    },
++  'viewall_dir' => 'browse',
    'menubar' => \@menubar,
    'edit_callback' => $edit_callback,
    'error_callback' => $edit_callback,
diff --cc httemplate/misc/cancel_pkg.html
index 42cc56d,348f0a6..f9a46a8
--- a/httemplate/misc/cancel_pkg.html
+++ b/httemplate/misc/cancel_pkg.html
@@@ -22,28 -22,47 +22,59 @@@
  %   $date_init = 1;
  % }
  
- % unless ( $method eq 'resume' ) { #the only one that doesn't need a reason
- <& /elements/tr-select-reason.html,
-      'field'          => 'reasonnum',
-      'reason_class'   => $class,
-      'curr_value'     => $reasonnum,
-      'control_button' => "document.getElementById('confirm_cancel_pkg_button')",
- &>
+ % if ($method eq 'uncancel' ) {
+ %
+ % #XXX customer also requested setup
+ % # setup: what usefulness is changing or blanking this?  re-charge setup fee?
+ % #        an option that says that would be better if that's what we want to do
+ 
+ % # last_bill: isn't this informational?  what good would editing it do?
+ % #            something about invoice display?
+   <& /elements/tr-input-date-field.html, {
+       'name'    => 'last_bill',
+       'value'   => ( $cgi->param('last_bill') || $cust_pkg->get('last_bill') ),
+       'label'   => mt("Last bill date"),
+       'format'  => $date_format,
+   } &>
+ 
+   <& /elements/tr-input-date-field.html, {
+       'name'    => 'bill',
+       'value'   => ( $cgi->param('bill') || $cust_pkg->get('bill') ),
+       'label'   => mt("Next bill date"),
+       'format'  => $date_format,
+   } &>
+ 
+   <& /elements/tr-checkbox.html,
+        'label'  => mt("Uncancel even if a service can't be re-provisioned"),
+        'field'  => 'svc_not_fatal',
+        'value'  => 'Y',
+   &>
+ 
+ %   $date_init = 1;
+ % }
+ 
+ % unless ( $method eq 'resume' || $method eq 'uncancel' ) {
+   <& /elements/tr-select-reason.html,
+        field          => 'reasonnum',
+        reason_class   => $class,
+        curr_value     => $reasonnum,
+        control_button => "document.getElementById('confirm_cancel_pkg_button')",
+   &>
  % }
  
 -% 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'))
diff --cc httemplate/misc/process/cancel_pkg.html
index 4f8e11b,b2d7bfa..79e489c
--- a/httemplate/misc/process/cancel_pkg.html
+++ b/httemplate/misc/process/cancel_pkg.html
@@@ -79,7 -85,9 +90,10 @@@ my $svc_fatal = ( $cgi->param('svc_not_
  my $error = $cust_pkg->$method( 'reason'      => $reasonnum,
                                  'date'        => $date,
                                  'resume_date' => $resume_date,
+                                 'last_bill'   => $last_bill,
+                                 'bill'        => $bill,
+                                 'svc_fatal'   => $svc_fatal,
 +                                'options'     => $options,
                                );
  
  if ($error) {
diff --cc httemplate/view/cust_main/packages/status.html
index 47ef1bc,4aec90e..e901774
--- a/httemplate/view/cust_main/packages/status.html
+++ b/httemplate/view/cust_main/packages/status.html
@@@ -56,14 -69,11 +69,16 @@@
        <% pkg_status_row($cust_pkg, emt('Setup'), 'setup', %opt ) %>
  %   } 
  
+     <% pkg_status_row_if($cust_pkg, emt('Un-cancelled'), 'uncancel', %opt ) %>
+ 
      <% 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 ) %>

commit e27244386c346f459d1569db26344407a0372a05
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Jul 8 22:44:43 2012 -0700

    fix selfservice balance display

diff --git a/fs_selfservice/FS-SelfService/cgi/myaccount.html b/fs_selfservice/FS-SelfService/cgi/myaccount.html
index d27f688..f82b706 100644
--- a/fs_selfservice/FS-SelfService/cgi/myaccount.html
+++ b/fs_selfservice/FS-SelfService/cgi/myaccount.html
@@ -4,7 +4,7 @@
 Hello <%= $name %>!<BR><BR>
 <%= $small_custview %>
 <BR>
-<%= if ( $access_pkgnum ) {
+<%= unless ( $access_pkgnum ) {
       $OUT .= qq!Balance: <B>\$$balance</B><BR><BR>!;
     }
     '';

commit 4db3780dd49caf7b84e48fe1cfc72f1d13f1282c
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Jul 8 22:43:27 2012 -0700

    per-package flags to override package def level suspend_bill flag, RT#18376

diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm
index 0a557fc..665662a 100644
--- a/FS/FS/cust_main/Billing.pm
+++ b/FS/FS/cust_main/Billing.pm
@@ -958,7 +958,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'
diff --git a/FS/FS/cust_main/Packages.pm b/FS/FS/cust_main/Packages.pm
index 06331d3..316dede 100644
--- a/FS/FS/cust_main/Packages.pm
+++ b/FS/FS/cust_main/Packages.pm
@@ -406,7 +406,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;
 }
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 855accc..4b458de 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -1041,8 +1041,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;
diff --git a/httemplate/misc/cancel_pkg.html b/httemplate/misc/cancel_pkg.html
index 4b5df86..42cc56d 100755
--- a/httemplate/misc/cancel_pkg.html
+++ b/httemplate/misc/cancel_pkg.html
@@ -31,7 +31,19 @@
 &>
 % }
 
-% 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'))
diff --git a/httemplate/misc/process/cancel_pkg.html b/httemplate/misc/process/cancel_pkg.html
index 662a776..4f8e11b 100755
--- a/httemplate/misc/process/cancel_pkg.html
+++ b/httemplate/misc/process/cancel_pkg.html
@@ -49,10 +49,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} );
@@ -73,7 +78,9 @@ if ( $method ne 'unsuspend' ) { #i.e. 'resume'
 
 my $error = $cust_pkg->$method( 'reason'      => $reasonnum,
                                 'date'        => $date,
-                                'resume_date' => $resume_date );
+                                'resume_date' => $resume_date,
+                                'options'     => $options,
+                              );
 
 if ($error) {
   $cgi->param('error', $error);
diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html
index 28df9da..47ef1bc 100644
--- a/httemplate/view/cust_main/packages/status.html
+++ b/httemplate/view/cust_main/packages/status.html
@@ -58,7 +58,12 @@
 
     <% 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 ) %>

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_main/Billing.pm                         |    5 ++++-
 FS/FS/cust_main/Packages.pm                        |    6 +++++-
 FS/FS/cust_pkg.pm                                  |    7 ++++++-
 FS/FS/domain_record.pm                             |    3 +--
 bin/23commit                                       |    2 +-
 fs_selfservice/FS-SelfService/cgi/myaccount.html   |    2 +-
 .../FS-SelfService/cgi/provision_list.html         |    1 -
 httemplate/edit/radius_group.html                  |    1 +
 httemplate/misc/cancel_pkg.html                    |   14 +++++++++++++-
 httemplate/misc/process/cancel_pkg.html            |    8 +++++++-
 httemplate/view/cust_main/packages/status.html     |    7 ++++++-
 11 files changed, 45 insertions(+), 11 deletions(-)




More information about the freeside-commits mailing list