X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FSignup.pm;h=e11a47a0609af6513cf2a13d594a0c356d4bb206;hb=6a509099343ed155525c4304f1ad742cc6e4ce59;hp=5010ec97d8ef1a203b9a1253ec8876439391735f;hpb=46fe3dbcb3ca97d1f3c70d49351846cf0ab6461d;p=freeside.git diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm index 5010ec97d..e11a47a06 100644 --- a/FS/FS/ClientAPI/Signup.pm +++ b/FS/FS/ClientAPI/Signup.pm @@ -164,8 +164,6 @@ sub signup_info { 'security_phrase' => $conf->exists('security_phrase'), - 'nomadix' => $conf->exists('signup_server-nomadix'), - 'payby' => [ $conf->config('signup_server-payby') ], 'payby_longname' => [ map { FS::payby->longname($_) } @@ -192,7 +190,6 @@ sub signup_info { 'agentnum2part_pkg' => $agentnum2part_pkg, 'svc_acct_pop' => [ map $_->hashref, qsearch('svc_acct_pop',{} ) ], - 'nomadix' => $conf->exists('signup_server-nomadix'), 'payby' => [ $conf->config('signup_server-payby') ], 'card_types' => card_types(), 'paytypes' => [ FS::cust_payby->paytypes ], @@ -1298,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} ) { @@ -1347,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({