diff options
| author | Mitch Jackson <mitch@freeside.biz> | 2018-11-08 14:12:13 -0500 |
|---|---|---|
| committer | Mitch Jackson <mitch@freeside.biz> | 2018-11-08 14:18:53 -0500 |
| commit | 67afbc5ac97546dc9ce9163a5ff6596a9a5213be (patch) | |
| tree | 82aa915428e59ee142cde3b6dc9f8807e3c33514 | |
| parent | ae27d43bf9b2bbd8126e4fe1f7c38bba2c4a0407 (diff) | |
RT# 81608 Improved error msg for Bill Now
Update Bill Now to throw an appropriate error
message to user if they try to use Bill Now
on a customer with pending package expiration
| -rw-r--r-- | FS/FS/cust_main.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index ae1c46ad5..afc21a97f 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -5776,7 +5776,13 @@ sub process_bill_and_collect { $param->{'fatal'} = 1; # runs from job queue, will be caught $param->{'retry'} = 1; - $cust_main->bill_and_collect( %$param ); + local $@; + eval { $cust_main->bill_and_collect( %$param) }; + if ( $@ ) { + die $@ =~ /cancel_pkgs cannot be run inside a transaction/ + ? "Bill Now unavailable for customer with pending package expiration\n" + : $@; + } } =item pending_invoice_count |
