From: Ivan Kohler Date: Mon, 9 Jul 2012 05:45:58 +0000 (-0700) Subject: Merge branch 'master' of git.freeside.biz:/home/git/freeside X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=a6fe07e49e3fc12169e801b1ed6874c3a5bd8500;hp=005424d0c899aa899f43f583a6c74deb13ea4be1 Merge branch 'master' of git.freeside.biz:/home/git/freeside Conflicts: httemplate/misc/process/cancel_pkg.html --- diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm index e7b953060..bab94c31d 100644 --- a/FS/FS/cust_main/Billing.pm +++ b/FS/FS/cust_main/Billing.pm @@ -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' diff --git a/FS/FS/cust_main/Packages.pm b/FS/FS/cust_main/Packages.pm index 957043a84..11c13e5dd 100644 --- a/FS/FS/cust_main/Packages.pm +++ b/FS/FS/cust_main/Packages.pm @@ -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; } diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 22559e95f..627a7fc3e 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -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; diff --git a/FS/FS/domain_record.pm b/FS/FS/domain_record.pm index 8d767d510..cd881ae08 100644 --- a/FS/FS/domain_record.pm +++ b/FS/FS/domain_record.pm @@ -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 --git a/bin/23commit b/bin/23commit index b7b0c1e57..d64459cf0 100755 --- a/bin/23commit +++ b/bin/23commit @@ -19,7 +19,7 @@ die "no files!" unless @ARGV; #print <!

<%= include('small_custview') %>
-<%= if ( $access_pkgnum ) { +<%= unless ( $access_pkgnum ) { $OUT .= qq!Balance: \$$balance

!; } ''; diff --git a/fs_selfservice/FS-SelfService/cgi/provision_list.html b/fs_selfservice/FS-SelfService/cgi/provision_list.html index 22054e644..2a3a8e909 100644 --- a/fs_selfservice/FS-SelfService/cgi/provision_list.html +++ b/fs_selfservice/FS-SelfService/cgi/provision_list.html @@ -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 --git a/httemplate/edit/radius_group.html b/httemplate/edit/radius_group.html index 025561159..0c99b4c4c 100644 --- a/httemplate/edit/radius_group.html +++ b/httemplate/edit/radius_group.html @@ -8,6 +8,7 @@ 'attrnum' => 'Attribute', 'priority' => 'Priority', }, + 'viewall_dir' => 'browse', 'menubar' => \@menubar, 'edit_callback' => $edit_callback, 'error_callback' => $edit_callback, diff --git a/httemplate/misc/cancel_pkg.html b/httemplate/misc/cancel_pkg.html index 348f0a6cb..f9a46a898 100755 --- a/httemplate/misc/cancel_pkg.html +++ b/httemplate/misc/cancel_pkg.html @@ -62,7 +62,19 @@ &> % } -% if ( ( $method eq 'adjourn' or $method eq 'suspend' ) and +% if ( $method eq 'adjourn' || $method eq 'suspend' ) { + +% 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 +% } + +% } + +% 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 b2d7bfaa4..79e489c70 100755 --- a/httemplate/misc/process/cancel_pkg.html +++ b/httemplate/misc/process/cancel_pkg.html @@ -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) { diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index 4aec90efb..e9017745b 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -73,7 +73,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 ) %>