X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=a4f88b4f4e6d5838c25e8a9adafc17ca8da9918b;hp=50c840c51d3c42d21a9602988037842192094808;hb=76d7b15503b50b3bb33459006ff9fcab413ea15c;hpb=230b8ef145194a2efde57215cc352cb8c02c49f5 diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 50c840c51..a4f88b4f4 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2475,33 +2475,33 @@ sub bill_and_collect { $error = $self->cancel_expired_pkgs( $options{actual_time} ); if ( $error ) { $error = "Error expiring custnum ". $self->custnum. ": $error"; - if ( $options{'fatal'} eq 'return' ) { return $error; } - elsif ( $options{'fatal'} ) { die $error; } - else { warn $error; } + if ( $options{fatal} && $options{fatal} eq 'return' ) { return $error; } + elsif ( $options{fatal} ) { die $error; } + else { warn $error; } } $error = $self->suspend_adjourned_pkgs( $options{actual_time} ); if ( $error ) { $error = "Error adjourning custnum ". $self->custnum. ": $error"; - if ( $options{'fatal'} eq 'return' ) { return $error; } - elsif ( $options{'fatal'} ) { die $error; } - else { warn $error; } + if ( $options{fatal} && $options{fatal} eq 'return' ) { return $error; } + elsif ( $options{fatal} ) { die $error; } + else { warn $error; } } $error = $self->bill( %options ); if ( $error ) { $error = "Error billing custnum ". $self->custnum. ": $error"; - if ( $options{'fatal'} eq 'return' ) { return $error; } - elsif ( $options{'fatal'} ) { die $error; } - else { warn $error; } + if ( $options{fatal} && $options{fatal} eq 'return' ) { return $error; } + elsif ( $options{fatal} ) { die $error; } + else { warn $error; } } $error = $self->apply_payments_and_credits; if ( $error ) { $error = "Error applying custnum ". $self->custnum. ": $error"; - if ( $options{'fatal'} eq 'return' ) { return $error; } - elsif ( $options{'fatal'} ) { die $error; } - else { warn $error; } + if ( $options{fatal} && $options{fatal} eq 'return' ) { return $error; } + elsif ( $options{fatal} ) { die $error; } + else { warn $error; } } unless ( $conf->exists('cancelled_cust-noevents') @@ -2510,9 +2510,9 @@ sub bill_and_collect { $error = $self->collect( %options ); if ( $error ) { $error = "Error collecting custnum ". $self->custnum. ": $error"; - if ( $options{'fatal'} eq 'return' ) { return $error; } - elsif ( $options{'fatal'} ) { die $error; } - else { warn $error; } + if ($options{fatal} && $options{fatal} eq 'return') { return $error; } + elsif ($options{fatal} ) { die $error; } + else { warn $error; } } }