[freeside-commits] branch FREESIDE_4_BRANCH updated. 9ae057172c76a6f1a445318d2186e6f255e7b716

Ivan ivan at 420.am
Wed May 31 17:55:21 PDT 2017


The branch, FREESIDE_4_BRANCH has been updated
       via  9ae057172c76a6f1a445318d2186e6f255e7b716 (commit)
      from  8730161d33270f760e1718184380e8996c8deef8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9ae057172c76a6f1a445318d2186e6f255e7b716
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed May 31 17:55:21 2017 -0700

    better error importing credits with unknown customer numbers, RT#76184

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) {

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_credit.pm |    4 ++++
 1 file changed, 4 insertions(+)




More information about the freeside-commits mailing list