move up next bill date on unsuspend
authorivan <ivan>
Fri, 25 Jun 2004 08:44:54 +0000 (08:44 +0000)
committerivan <ivan>
Fri, 25 Jun 2004 08:44:54 +0000 (08:44 +0000)
FS/FS/cust_pkg.pm

index db0f7d4..fb41dfc 100644 (file)
@@ -452,7 +452,10 @@ sub unsuspend {
 
   unless ( ! $self->getfield('susp') ) {
     my %hash = $self->hash;
 
   unless ( ! $self->getfield('susp') ) {
     my %hash = $self->hash;
+    my $inactive = time - $hash{'susp'};
     $hash{'susp'} = '';
     $hash{'susp'} = '';
+    $hash{'bill'} = ( $hash{'bill'} || $hash{'setup'} ) + $inactive
+      if $inactive > 0 && ( $hash{'bill'} || $hash{'setup'} );
     my $new = new FS::cust_pkg ( \%hash );
     $error = $new->replace($self);
     if ( $error ) {
     my $new = new FS::cust_pkg ( \%hash );
     $error = $new->replace($self);
     if ( $error ) {