X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FSignup.pm;h=e1ee6cddaa3e9d499ba2526f2f9d6b3ba2e2db8a;hb=b91dcaf3fc07c23955ce571c2257df4efff2923a;hp=6e341d4bdaa54ef9a4f1e3f739189256b99b8a3b;hpb=04f93bdaea44ad9194bd9c6960d4e3d87077cd4e;p=freeside.git diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm index 6e341d4bd..e1ee6cdda 100644 --- a/FS/FS/ClientAPI/Signup.pm +++ b/FS/FS/ClientAPI/Signup.pm @@ -23,6 +23,7 @@ use FS::queue; use FS::reg_code; use FS::payby; use FS::banned_pay; +use FS::part_tag; $DEBUG = 0; $me = '[FS::ClientAPI::Signup]'; @@ -475,7 +476,6 @@ sub domain_select_hash { sub new_customer { my $packet = shift; -warn Dumper($packet); my $conf = new FS::Conf; my $svc_x = $conf->config('signup_server-service') || 'svc_acct'; @@ -521,6 +521,28 @@ warn Dumper($packet); #shares some stuff with htdocs/edit/process/cust_main.cgi... take any # common that are still here and library them. + + my %cust_main = ( + 'agentnum' => $agentnum, + 'refnum' => $packet->{refnum} + || $conf->config('signup_server-default_refnum'), + 'tagnum' => [ FS::part_tag->default_tags ], + + ( map { $_ => $packet->{$_} } qw( + salesnum + ss stateid stateid_state + + payby + payinfo paycvv paydate payname paystate paytype + paystart_month paystart_year payissue + payip + + referral_custnum comments + ) + ), + + ); + my $template_custnum = $conf->config('signup_server-prepaid-template-custnum'); my $cust_main; if ( $template_custnum && $packet->{prepaid_shortform} ) { @@ -528,27 +550,10 @@ warn Dumper($packet); my $template_cust = qsearchs('cust_main', { 'custnum' => $template_custnum } ); return { 'error' => 'Configuration error' } unless $template_cust; $cust_main = new FS::cust_main ( { - 'agentnum' => $agentnum, - 'refnum' => $packet->{refnum} - || $conf->config('signup_server-default_refnum'), - - ( map { $_ => $template_cust->$_ } qw( - last first company daytime night fax mobile - ) - ), - - ( map { $_ => $packet->{$_} } qw( - ss stateid stateid_state - - payby - payinfo paycvv paydate payname paystate paytype - paystart_month paystart_year payissue - payip - - referral_custnum comments - ) + %cust_main, + map { $_ => $template_cust->$_ } qw( + last first company daytime night fax mobile ), - } ); $bill_hash = { $template_cust->bill_location->location_hash }; @@ -557,23 +562,11 @@ warn Dumper($packet); } else { $cust_main = new FS::cust_main ( { - #'custnum' => '', - 'agentnum' => $agentnum, - 'refnum' => $packet->{refnum} - || $conf->config('signup_server-default_refnum'), - + %cust_main, map { $_ => $packet->{$_} } qw( - last first ss company - daytime night fax mobile - stateid stateid_state - payby - payinfo paycvv paydate payname paystate paytype - paystart_month paystart_year payissue - payip + last first company daytime night fax mobile override_ban_warn - referral_custnum comments ), - } ); } @@ -631,7 +624,7 @@ warn Dumper($packet); ); } - $cust_main->payby('BILL') # MCRD better? + $cust_main->payby('BILL') # MCRD better? no, that's for something else if $gw && $gw->gateway_namespace eq 'Business::OnlineThirdPartyPayment'; } @@ -643,6 +636,16 @@ warn Dumper($packet); $cust_main->payinfo($cust_main->daytime) if $cust_main->payby eq 'LECB' && ! $cust_main->payinfo; + if ( grep length($packet->{$_}), FS::cust_main->location_fields ) { + my $bill_hash; + foreach my $f (FS::cust_main->location_fields) { + $bill_hash->{$f} = $packet->{$f}; + } + my $bill_location = FS::cust_location->new($bill_hash); + $cust_main->set('bill_location' => $bill_location); + $cust_main->set('ship_location' => $bill_location); + } + my @invoicing_list = $packet->{'invoicing_list'} ? split( /\s*\,\s*/, $packet->{'invoicing_list'} ) : ();