[freeside-commits] freeside/FS/FS AccessRight.pm, 1.19, 1.20 Schema.pm, 1.54, 1.55 cust_main.pm, 1.288, 1.289 cust_pkg.pm, 1.77, 1.78
Jeff Finucane,420,,
jeff at wavetail.420.am
Tue Jun 26 08:37:20 PDT 2007
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv2558/FS/FS
Modified Files:
AccessRight.pm Schema.pm cust_main.pm cust_pkg.pm
Log Message:
suspend later just like expire (#1487)
Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- Schema.pm 15 Jun 2007 00:58:41 -0000 1.54
+++ Schema.pm 26 Jun 2007 15:37:16 -0000 1.55
@@ -651,6 +651,7 @@
'bill', @date_type, '', '',
'last_bill', @date_type, '', '',
'susp', @date_type, '', '',
+ 'adjourn', @date_type, '', '',
'cancel', @date_type, '', '',
'expire', @date_type, '', '',
'manual_flag', 'char', 'NULL', 1, '', '',
Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.288
retrieving revision 1.289
diff -u -d -r1.288 -r1.289
--- cust_main.pm 21 Jun 2007 04:03:14 -0000 1.288
+++ cust_main.pm 26 Jun 2007 15:37:18 -0000 1.289
@@ -4725,7 +4725,7 @@
my %svc_acct = ();
foreach my $field ( @fields ) {
- if ( $field =~ /^cust_pkg\.(pkgpart|setup|bill|susp|expire|cancel)$/ ) {
+ if ( $field =~ /^cust_pkg\.(pkgpart|setup|bill|susp|adjourn|expire|cancel)$/ ) {
#$cust_pkg{$1} = str2time( shift @$columns );
if ( $1 eq 'pkgpart' ) {
Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- cust_pkg.pm 21 Jun 2007 04:03:14 -0000 1.77
+++ cust_pkg.pm 26 Jun 2007 15:37:18 -0000 1.78
@@ -111,6 +111,8 @@
=item last_bill - last bill date
+=item adjourn - date
+
=item susp - date
=item expire - date
@@ -124,7 +126,7 @@
=back
-Note: setup, bill, susp, expire and cancel are specified as UNIX timestamps;
+Note: setup, bill, adjourn, susp, expire and cancel are specified as UNIX timestamps;
see L<perlfunc/"time">. Also see L<Time::Local> and L<Date::Parse> for
conversion functions.
@@ -264,7 +266,7 @@
Replaces the OLD_RECORD with this one in the database. If there is an error,
returns the error, otherwise returns false.
-Currently, custnum, setup, bill, susp, expire, and cancel may be changed.
+Currently, custnum, setup, bill, adjourn, susp, expire, and cancel may be changed.
Changing pkgpart may have disasterous effects. See the order subroutine.
@@ -310,13 +312,15 @@
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
- if ($options{'reason'} && $new->expire && $old->expire ne $new->expire) {
- my $error = $new->insert_reason( 'reason' => $options{'reason'},
- 'date' => $new->expire,
- );
- if ( $error ) {
- dbh->rollback if $oldAutoCommit;
- return "Error inserting cust_pkg_reason: $error";
+ foreach my $method ( qw(adjourn expire) ) { # How many reasons?
+ if ($options{'reason'} && $new->$method && $old->$method ne $new->$method) {
+ my $error = $new->insert_reason( 'reason' => $options{'reason'},
+ 'date' => $new->$method,
+ );
+ if ( $error ) {
+ dbh->rollback if $oldAutoCommit;
+ return "Error inserting cust_pkg_reason: $error";
+ }
}
}
@@ -377,6 +381,8 @@
|| $self->ut_numbern('bill')
|| $self->ut_numbern('susp')
|| $self->ut_numbern('cancel')
+ || $self->ut_numbern('adjourn')
+ || $self->ut_numbern('expire')
;
return $error if $error;
@@ -601,7 +607,8 @@
=item unsuspend [ OPTION => VALUE ... ]
Unsuspends all services (see L<FS::cust_svc> and L<FS::part_svc>) in this
-package, then unsuspends the package itself (clears the susp field).
+package, then unsuspends the package itself (clears the susp field and the
+adjourn field if it is in the past).
Available options are: I<adjust_next_bill>.
@@ -666,6 +673,7 @@
&& $inactive > 0 && ( $hash{'bill'} || $hash{'setup'} );
$hash{'susp'} = '';
+ $hash{'adjourn'} = '' if $hash{'adjourn'} < time;
my $new = new FS::cust_pkg ( \%hash );
$error = $new->replace( $self, options => { $self->options } );
if ( $error ) {
Index: AccessRight.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/AccessRight.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- AccessRight.pm 1 Apr 2007 02:45:28 -0000 1.19
+++ AccessRight.pm 26 Jun 2007 15:37:16 -0000 1.20
@@ -106,6 +106,7 @@
'Edit customer package dates',
'Customize customer package',
'Suspend customer package',
+ 'Suspend customer package later',
'Unsuspend customer package',
'Cancel customer package immediately',
'Cancel customer package later',
More information about the freeside-commits
mailing list