summaryrefslogtreecommitdiff
path: root/FS/FS/ClientAPI/Signup.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-10-06 15:55:10 -0700
committerMark Wells <mark@freeside.biz>2016-10-06 16:21:51 -0700
commit6654e2207a768e27bc85a74e02ae66d53c0248b3 (patch)
treed16aa5bfde605bcf356aa2ca53056460e2548b56 /FS/FS/ClientAPI/Signup.pm
parentf2374a673c944e1caa381f4fd2d9c2eb833f41b8 (diff)
fix prospect creation from EUS API, #39776
Diffstat (limited to 'FS/FS/ClientAPI/Signup.pm')
-rw-r--r--FS/FS/ClientAPI/Signup.pm13
1 files changed, 10 insertions, 3 deletions
diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm
index df276f0..e11a47a 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({