diff options
author | Ivan Kohler <ivan@freeside.biz> | 2017-05-31 17:55:19 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2017-05-31 17:55:19 -0700 |
commit | b5e8459bb1b5775edb0f55b05a9a7b1021b49621 (patch) | |
tree | a8e2d355336aa3461c7d3f5070f7bc95b8e0453f /FS/FS/cust_credit.pm | |
parent | 67656d73de7b9b8cb829995aba7c43b5e35067df (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 6249713..ddf407b 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) { |