[freeside-commits] branch master updated. b5e8459bb1b5775edb0f55b05a9a7b1021b49621

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


The branch, master has been updated
       via  b5e8459bb1b5775edb0f55b05a9a7b1021b49621 (commit)
      from  67656d73de7b9b8cb829995aba7c43b5e35067df (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 b5e8459bb1b5775edb0f55b05a9a7b1021b49621
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed May 31 17:55:19 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 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) {

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

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




More information about the freeside-commits mailing list