'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({
$doc = new SimpleXMLElement($xml);
$cd = $doc->CustomerDetails;
if ($DEBUG) {
- error_log(var_dump($cd));
+ error_log(print_r($cd),1);
}
// State and Country are names rather than codes, but we fix that on the other
foreach ($map_fields as $k => $v) {
$prospect[$k] = (string)($cd->$v);
}
-error_log(var_dump($prospect));
+error_log(print_r($prospect),1);
$freeside = new FreesideSelfService();
$result = $freeside->new_prospect($prospect);
-error_log(var_dump($result));
+error_log(print_r($result),1);
?>