[freeside-commits] branch master updated. c348008de567bbede345c2fa861c4d3694f8b1d3

Ivan ivan at 420.am
Mon Aug 29 19:05:43 PDT 2016


The branch, master has been updated
       via  c348008de567bbede345c2fa861c4d3694f8b1d3 (commit)
      from  1d76bfaa881079e4c44109698277525082a95733 (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 c348008de567bbede345c2fa861c4d3694f8b1d3
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Aug 29 19:05:42 2016 -0700

    stop making spurious extra contacts

diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 2af6a1f..7bbed1b 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -598,17 +598,21 @@ sub insert {
       }
     }
 
-    my $contact = FS::contact->new({
-      'custnum'       => $self->get('custnum'),
-      'last'          => $self->get('last'),
-      'first'         => $self->get('first'),
-      'emailaddress'  => $email,
-      'invoice_dest'  => 'Y', # yes, you can set this via the contact
-    });
-    my $error = $contact->insert;
-    if ( $error ) {
-      $dbh->rollback if $oldAutoCommit;
-      return $error;
+    if ( $email ) {
+
+      my $contact = FS::contact->new({
+        'custnum'       => $self->get('custnum'),
+        'last'          => $self->get('last'),
+        'first'         => $self->get('first'),
+        'emailaddress'  => $email,
+        'invoice_dest'  => 'Y', # yes, you can set this via the contact
+      });
+      my $error = $contact->insert;
+      if ( $error ) {
+        $dbh->rollback if $oldAutoCommit;
+        return $error;
+      }
+
     }
 
   }

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

Summary of changes:
 FS/FS/cust_main.pm |   26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)




More information about the freeside-commits mailing list