'security_phrase' => $conf->exists('security_phrase'),
- 'nomadix' => $conf->exists('signup_server-nomadix'),
-
'payby' => [ $conf->config('signup_server-payby') ],
'payby_longname' => [ map { FS::payby->longname($_) }
'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 ],
'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} ) {
}
$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({