diff options
author | Ivan Kohler <ivan@freeside.biz> | 2017-05-31 17:55:22 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2017-05-31 17:55:22 -0700 |
commit | a6fdc051a4920122c2302191be4855cfa7440e80 (patch) | |
tree | 0ca8863f3889311352b36b8b4502448eb13c61f7 /FS | |
parent | 362003556ad0c58f21f82d5529e7bf10049d5688 (diff) |
better error importing credits with unknown customer numbers, RT#76184
Diffstat (limited to 'FS')
-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 ca410757b..f8c13f9f0 100644 --- a/FS/FS/cust_credit.pm +++ b/FS/FS/cust_credit.pm @@ -154,6 +154,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) { |