X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fcust_main.pm;h=ee1c15f25fd2025a54a7b3c5497125956e407be9;hb=a1d1dc9edcb57c0295689203de577c670f947b60;hp=cb5181d8925bde4ed3443c401db0ff980e2c10c5;hpb=d22baa4e71bfa9e153c1fe1152ff4c748f1d935c;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index cb5181d89..ee1c15f25 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -532,6 +532,7 @@ sub insert { foreach my $prospect_contact ( $prospect_main->prospect_contact ) { my $cust_contact = new FS::cust_contact { 'custnum' => $self->custnum, + 'invoice_dest' => 'Y', # invoice_dest currently not set for prospect contacts map { $_ => $prospect_contact->$_() } qw( contactnum classnum comment ) }; my $error = $cust_contact->insert @@ -554,7 +555,10 @@ sub insert { return $error; } } - + # since we set invoice_dest on all migrated prospect contacts (for now), + # don't process invoicing_list. + delete $options{'invoicing_list'}; + $invoicing_list = undef; } warn " setting contacts\n" @@ -578,8 +582,7 @@ sub insert { custnum => $self->custnum, }); $cust_contact->set('invoice_dest', 'Y'); - my $error = $cust_contact->contactnum ? - $cust_contact->replace : $cust_contact->insert; + my $error = $cust_contact->insert; if ( $error ) { $dbh->rollback if $oldAutoCommit; return "$error (linking to email address $dest)";