X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_credit.pm;h=094437e22fb2836b938eb515ae57c087729dc2e6;hb=b3cc20aeca25e4351c6ec3b795a951e6124f6376;hp=4be4b177ad40036bf6745ca9256863c91ee5a80b;hpb=b1b3d6b3c0db38909b6f569e08877d2678587d22;p=freeside.git diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm index 4be4b177a..094437e22 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;