diff options
author | Ivan Kohler <ivan@freeside.biz> | 2017-05-31 17:55:21 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2017-05-31 17:55:21 -0700 |
commit | 9ae057172c76a6f1a445318d2186e6f255e7b716 (patch) | |
tree | 01aec7183af2cc0e3558b639d5c26e4cedca6f1d /FS/FS/cust_credit.pm | |
parent | 8730161d33270f760e1718184380e8996c8deef8 (diff) |
better error importing credits with unknown customer numbers, RT#76184
Diffstat (limited to 'FS/FS/cust_credit.pm')
-rw-r--r-- | FS/FS/cust_credit.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm index dfc4c80..77460e2 100644 --- a/FS/FS/cust_credit.pm +++ b/FS/FS/cust_credit.pm @@ -167,6 +167,10 @@ sub insert { my $dbh = dbh; my $cust_main = qsearchs( 'cust_main', { 'custnum' => $self->custnum } ); + unless ( $cust_main ) { + $dbh->rollback if $oldAutoCommit; + return "Unknown custnum ". $self->custnum; + } my $old_balance = $cust_main->balance; if (!$self->reasonnum) { |