summaryrefslogtreecommitdiff
path: root/FS/FS/ClientAPI
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-12-10 20:58:56 -0800
committerIvan Kohler <ivan@freeside.biz>2014-12-10 20:58:56 -0800
commit04f93bdaea44ad9194bd9c6960d4e3d87077cd4e (patch)
tree144db9f2a600df1939229124ed15a2e36f998696 /FS/FS/ClientAPI
parenta83f6bb859327c0ff55d6aa30e39e8a0f657be75 (diff)
tax-exempt numbers during signup, RT#32299
Diffstat (limited to 'FS/FS/ClientAPI')
-rw-r--r--FS/FS/ClientAPI/Signup.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm
index 502959817..6e341d4bd 100644
--- a/FS/FS/ClientAPI/Signup.pm
+++ b/FS/FS/ClientAPI/Signup.pm
@@ -177,6 +177,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,
@@ -474,6 +475,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';
@@ -645,6 +647,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 +770,7 @@ sub new_customer {
\%hash,
\@invoicing_list,
'depend_jobnum' => $placeholder->jobnum,
+ %insert_options,
);
if ( $error ) {
my $perror = $placeholder->delete;