diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2016-03-14 23:39:18 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2016-03-17 00:31:29 -0500 |
commit | fdff077d075af80c623bf03ce65cca4af0ebdde5 (patch) | |
tree | 8550b45ecb206bfadac1cc31da8bec5f07c6c0d5 /FS/FS/cust_credit.pm | |
parent | 216272ed8a5ccfc8dc72268b9b02cc8fcd4479cf (diff) |
RT#28648: Unsuspend when past due balance is paid
Diffstat (limited to 'FS/FS/cust_credit.pm')
-rw-r--r-- | FS/FS/cust_credit.pm | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm index 4be4b17..094437e 100644 --- a/FS/FS/cust_credit.pm +++ b/FS/FS/cust_credit.pm @@ -3,7 +3,7 @@ use base qw( FS::otaker_Mixin FS::cust_main_Mixin FS::reason_Mixin FS::Record ); use strict; -use vars qw( $conf $unsuspendauto $me $DEBUG +use vars qw( $conf $me $DEBUG $otaker_upgrade_kludge $ignore_empty_reasonnum ); use List::Util qw( min ); @@ -34,7 +34,6 @@ $ignore_empty_reasonnum = 0; $FS::UID::callback{'FS::cust_credit'} = sub { $conf = new FS::Conf; - $unsuspendauto = $conf->exists('unsuspendauto'); }; @@ -210,16 +209,8 @@ sub insert { $dbh->commit or die $dbh->errstr if $oldAutoCommit; - #false laziness w/ cust_pay::insert - if ( $unsuspendauto && $old_balance && $cust_main->balance <= 0 ) { - my @errors = $cust_main->unsuspend; - #return - # side-fx with nested transactions? upstack rolls back? - warn "WARNING:Errors unsuspending customer ". $cust_main->custnum. ": ". - join(' / ', @errors) - if @errors; - } - #eslaf + # possibly trigger package unsuspend, doesn't abort transaction on failure + $self->unsuspend_balance if $old_balance; $dbh->commit or die $dbh->errstr if $oldAutoCommit; |