X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=0da2364f1f2e11e71abca307e4d3e39611f93725;hb=960c55002469c33ea9b0a949ad473a705e1b6cf9;hp=9e3c285c273e9810d64a37a0e458208f267807c3;hpb=23732b74ef41e6810b25ce212bce512fd399bbb0;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 9e3c285c2..0da2364f1 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -350,6 +350,9 @@ created and inserted. If I is set, moves contacts and locations from that prospect. +If I is set to an arrayref of FS::contact objects, inserts those +new contacts with this new customer. + =cut sub insert { @@ -538,6 +541,21 @@ sub insert { } + my $contact = delete $options{'contact'}; + if ( $contact ) { + + foreach my $c ( @$contact ) { + $c->custnum($self->custnum); + my $error = $c->insert; + if ( $error ) { + $dbh->rollback if $oldAutoCommit; + return $error; + } + + } + + } + warn " setting cust_main_exemption\n" if $DEBUG > 1;