summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2004-06-25 08:44:56 +0000
committerivan <ivan>2004-06-25 08:44:56 +0000
commit74d6490b9bb61dfb0a4f0633e074ab6126638bdb (patch)
tree92154cf562c9bc3436f399646c4642d9212f5f85
parent5027a7aa538722663cf1f01aa5ac401d4430bf28 (diff)
move up next bill date on unsuspend
-rw-r--r--FS/FS/cust_pkg.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index a62c44e00..a3297ab47 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -462,7 +462,10 @@ sub unsuspend {
unless ( ! $self->getfield('susp') ) {
my %hash = $self->hash;
+ my $inactive = time - $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 ) {