diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-06-06 14:02:51 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-06-06 14:02:51 -0700 |
commit | aa5a298db560ebe2c57dc7cb010e0c2ad818c833 (patch) | |
tree | 60c61a9981d6e663b84787ccf24e274b69a1d6f3 /FS/FS/ClientAPI/Signup.pm | |
parent | 3a0faf78a1dc1e037409fd3e43461af42e47a82d (diff) |
signup without a service
Diffstat (limited to 'FS/FS/ClientAPI/Signup.pm')
-rw-r--r-- | FS/FS/ClientAPI/Signup.pm | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm index d3e534c..4e2827c 100644 --- a/FS/FS/ClientAPI/Signup.pm +++ b/FS/FS/ClientAPI/Signup.pm @@ -972,7 +972,6 @@ sub new_customer_minimal { my $part_pkg = qsearchs( 'part_pkg', { 'pkgpart' => $pkgpart } ) or return { 'error' => "WARNING: unknown pkgpart: $pkgpart" }; - my $svcpart = $part_pkg->svcpart($svc_x); my $cust_pkg = new FS::cust_pkg ( { #later#'custnum' => $custnum, @@ -981,35 +980,40 @@ sub new_customer_minimal { #my $error = $cust_pkg->check; #return { 'error' => $error } if $error; - #should be all auto-magic and shit - if ( $svc_x eq 'svc_acct' ) { + unless ( $svc_x eq 'none' ) { - my $svc = new FS::svc_acct { - 'svcpart' => $svcpart, - map { $_ => $packet->{$_} } - qw( username _password sec_phrase popnum domsvc ), - }; + my $svcpart = $part_pkg->svcpart($svc_x); + #should be all auto-magic and shit + if ( $svc_x eq 'svc_acct' ) { - push @svc, $svc; + my $svc = new FS::svc_acct { + 'svcpart' => $svcpart, + map { $_ => $packet->{$_} } + qw( username _password sec_phrase popnum domsvc ), + }; - } elsif ( $svc_x eq 'svc_phone' ) { + push @svc, $svc; - push @svc, new FS::svc_phone ( { - 'svcpart' => $svcpart, - map { $_ => $packet->{$_} } - qw( countrycode phonenum sip_password pin ), - } ); - - } elsif ( $svc_x eq 'svc_pbx' ) { + } elsif ( $svc_x eq 'svc_phone' ) { - push @svc, new FS::svc_pbx ( { + push @svc, new FS::svc_phone ( { 'svcpart' => $svcpart, - map { $_ => $packet->{$_} } - qw( id title ), - } ); + map { $_ => $packet->{$_} } + qw( countrycode phonenum sip_password pin ), + } ); + + } elsif ( $svc_x eq 'svc_pbx' ) { + + push @svc, new FS::svc_pbx ( { + 'svcpart' => $svcpart, + map { $_ => $packet->{$_} } + qw( id title ), + } ); - } else { - die "unknown signup service $svc_x"; + } else { + die "unknown signup service $svc_x"; + } + } foreach my $svc ( @svc ) { @@ -1057,6 +1061,7 @@ sub new_customer_minimal { 'signup_service' => $svc_x, 'custnum' => $cust_main->custnum, 'session_id' => $session_id, + map { $_ => $cust_main->$_ } qw( first last company ), ); if ( $svc[0] ) { |