X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FSignup.pm;h=ebf56936381041ddb83c9cfec97e57e73b10b165;hb=b0dcfb17045dca111b177084ecb857ae2ee6c670;hp=29ec23972512285c6c704d99f8c4e79936173d0c;hpb=960c55002469c33ea9b0a949ad473a705e1b6cf9;p=freeside.git diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm index 29ec23972..ebf569363 100644 --- a/FS/FS/ClientAPI/Signup.pm +++ b/FS/FS/ClientAPI/Signup.pm @@ -178,6 +178,7 @@ sub signup_info { 'require_cvv' => $conf->exists('signup-require_cvv'), 'stateid_enabled' => $conf->exists('show_stateid'), 'paystate_enabled' => $conf->exists('show_bankstate'), + 'exempt_groups' => [ grep /\S/, $conf->config('tax-cust_exempt-groups') ], 'ship_enabled' => 1, 'msgcat' => $msgcat, 'label' => $label, @@ -475,6 +476,7 @@ 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'; @@ -532,7 +534,7 @@ sub new_customer { || $conf->config('signup_server-default_refnum'), ( map { $_ => $template_cust->$_ } qw( - last first company daytime night fax + last first company daytime night fax mobile ) ), @@ -563,7 +565,8 @@ sub new_customer { map { $_ => $packet->{$_} } qw( last first ss company - daytime night fax stateid stateid_state + daytime night fax mobile + stateid stateid_state payby payinfo paycvv paydate payname paystate paytype paystart_month paystart_year payissue @@ -645,6 +648,14 @@ sub new_customer { ? split( /\s*\,\s*/, $packet->{'invoicing_list'} ) : (); + my %insert_options = (); + + my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups'); + my @tax_exempt = grep { $packet->{"tax_$_"} eq 'Y' } @exempt_groups; + $insert_options{'tax_exemption'} = { + map { $_ => $packet->{"tax_$_".'_num'} } @tax_exempt + }; + $packet->{'pkgpart'} =~ /^(\d+)$/ or '' =~ /^()$/; my $pkgpart = $1; return { 'error' => 'Please select a package' } unless $pkgpart; #msgcat @@ -760,6 +771,7 @@ sub new_customer { \%hash, \@invoicing_list, 'depend_jobnum' => $placeholder->jobnum, + %insert_options, ); if ( $error ) { my $perror = $placeholder->delete; @@ -930,7 +942,7 @@ sub new_customer_minimal { map { $_ => $packet->{$_} } qw( last first ss company - daytime night fax + daytime night fax mobile ), } );