X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FSignup.pm;h=e11a47a0609af6513cf2a13d594a0c356d4bb206;hp=df276f049c770a17e105c1a3e8c4c26b63c02cec;hb=c42bf39feed32a9d0ca83944284463a148dbfed6;hpb=dbff6cc9f027e23599ecc35e7092583da4be0b77 diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm index df276f049..e11a47a06 100644 --- a/FS/FS/ClientAPI/Signup.pm +++ b/FS/FS/ClientAPI/Signup.pm @@ -1295,7 +1295,15 @@ sub new_prospect { 'title' => $title, }); if (!$part_referral) { - return { error => "Unknown referral type: '$title'" }; + $part_referral = FS::part_referral->new({ + 'agentnum' => $agentnum, + 'title' => $title, + 'referral' => $title, + }); + $error = $part_referral->insert; + if ( $error ) { + warn "ERROR: could not create referral type '$title': $error\n"; + } } $refnum = $part_referral->refnum; } elsif ( $packet->{refnum} ) { @@ -1344,9 +1352,8 @@ sub new_prospect { } $location->set('country', $country); $location->set('state', $state); - $prospect->set('cust_location', $location); - $error ||= $prospect->insert; # also does location + $error ||= $prospect->insert( cust_location => $location ); return { error => $error } if $error; my $contact = FS::contact->new({