summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2004-06-25 08:44:54 +0000
committerivan <ivan>2004-06-25 08:44:54 +0000
commitebccee59f6339778da851c5c13e7238e457f3e62 (patch)
treefdba22a85f14350d9c0b0d1ec3bbac9e8fe91ed3 /FS
parentaf723d02722d00c863ec4552627fe4ad77973d75 (diff)
move up next bill date on unsuspend
Diffstat (limited to 'FS')
-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 db0f7d423..fb41dfcf8 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -452,7 +452,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 ) {