summaryrefslogtreecommitdiff
path: root/FS/FS/cust_pkg.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-02-28 13:20:39 -0800
committerMark Wells <mark@freeside.biz>2015-02-28 13:20:39 -0800
commitf054f4db2a70c60b3adbaaa1672eefcddd62d96e (patch)
tree5db2bba1a87eced107a44fbe0e7f5d6c2eb96351 /FS/FS/cust_pkg.pm
parentd8484ba64691b5bf02b289393706d73ab531c403 (diff)
change interaction between unsuspend_adjust_bill and unused_credit_suspend, #31651
Diffstat (limited to 'FS/FS/cust_pkg.pm')
-rw-r--r--FS/FS/cust_pkg.pm13
1 files changed, 9 insertions, 4 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index ae86ca0..8eb4ce3 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -1684,15 +1684,20 @@ sub unsuspend {
and ! $self->option('no_suspend_bill',1)
)
or $hash{'order_date'} == $hash{'susp'}
- or $self->part_pkg->option('unused_credit_suspend')
- or ( ref($reason) and $reason->unused_credit )
) {
$adjust_bill = 0;
}
- # then add the length of time suspended to the bill date
if ( $adjust_bill ) {
- $hash{'bill'} = ( $hash{'bill'} || $hash{'setup'} ) + $inactive
+ if ( $self->part_pkg->option('unused_credit_suspend')
+ or ( ref($reason) and $reason->unused_credit ) ) {
+ # then the customer was credited for the unused time before suspending,
+ # so their next bill should be immediate
+ $hash{'bill'} = time;
+ } else {
+ # add the length of time suspended to the bill date
+ $hash{'bill'} = ( $hash{'bill'} || $hash{'setup'} ) + $inactive;
+ }
}
$hash{'susp'} = '';