[freeside-commits] branch FREESIDE_4_BRANCH updated. c85feb8ed34e07182695757322dfe132f6485045

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


The branch, FREESIDE_4_BRANCH has been updated
       via  c85feb8ed34e07182695757322dfe132f6485045 (commit)
      from  54d0218255a59a5133668e6ae06ccf264c58c758 (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 c85feb8ed34e07182695757322dfe132f6485045
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Aug 29 19:05:44 2016 -0700

    stop making spurious extra contacts

diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 1253ac3..25b3d08 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -597,17 +597,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