1 <% include('/elements/header-popup.html', $title ) %>
3 <FORM ACTION="<% popurl(1)."process/bulk-cust_main_county.html" %>" METHOD="POST">
5 <INPUT TYPE="hidden" NAME="action" VALUE="<% $action %>">
6 <INPUT TYPE="hidden" NAME="taxnum" VALUE="<% join(',', @taxnum) %>">
8 <TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0>
10 <% include('/elements/tr-td-label.html', 'label' => 'Country' ) %>
11 <TD BGCOLOR="#dddddd"><% $countries %>
15 <% include('/elements/tr-td-label.html', 'label' => 'State' ) %>
16 <TD BGCOLOR="#dddddd"><% $states %>
21 <% include('/elements/tr-td-label.html', 'label' => 'County' ) %>
22 <TD BGCOLOR="#dddddd"><% $counties %>
27 % if ( $conf->exists('enable_taxclasses') && $taxclasses ) {
28 <% include('/elements/tr-td-label.html', 'label' => 'Tax Class' ) %>
29 <TD BGCOLOR="#dddddd"><% $taxclasses %>
34 <% include('/elements/tr-input-text.html',
40 <% include('/elements/tr-input-percentage.html',
42 'label' => 'Tax rate',
46 <% include('/elements/tablebreak-tr-title.html', value=>'Exemptions' ) %>
48 <% include('/elements/tr-checkbox.html',
49 'field' => 'setuptax',
51 'label' => 'This tax not applicable to setup fees',
55 <% include('/elements/tr-checkbox.html',
56 'field' => 'recurtax',
58 'label' => 'This tax not applicable to recurring fees',
62 <% include('/elements/tr-input-money.html',
63 'field' => 'exempt_amount',
64 'label' => 'Monthly exemption per customer ($25 "Texas tax")',
72 <INPUT TYPE="submit" VALUE="Bulk <% $action %> tax">
76 my $conf = new FS::Conf;
79 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
82 $cgi->param('taxnum') =~ /^([\d,]+)$/
83 or $m->comp('/elements/errorpage-popup.html', $cgi->param('error') || 'Nothing selected');
84 my @taxnum = split(',', $1);
86 $cgi->param('action') =~ /^(add|edit)$/ or die "unknown action";
88 my $title = "Bulk $action tax rate";
90 my @cust_main_county =
92 qsearchs('cust_main_county', { 'taxnum' => $_ })
93 or die "unknown taxnum $1";
97 my %seen_country = {};
98 my @countries = map code2country($_)." ($_)",
99 grep !$seen_country{$_}++,
102 my $countries = join(', ', @countries);
105 my @states = map state_label($_->[0], $_->[1]),
106 grep !$seen_state{$_->[0]}++,
107 map [ $_->state, $_->country ],
109 my $states = join(', ', @states);
111 my %seen_county = {};
112 my @counties = grep !$seen_county{$_}++, map $_->county, @cust_main_county;
113 my $counties = join(', ', @counties);
115 my %seen_taxclass = {};
116 my @taxclasses = grep !$seen_taxclass{$_}++, map $_->taxclass, @cust_main_county;
117 my $taxclasses = join(', ', @taxclasses);
120 # { field=>'country', type=>'fixed-country', },
121 # { field=>'state', type=>'fixed-state', },
122 # { field=>'county', type=>'fixed', },
125 #push @fields, { field=>'taxclass', type=>'fixed', }
126 # if $conf->exists('enable_taxclasses');