summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-04-15 15:38:27 -0700
committerIvan Kohler <ivan@freeside.biz>2012-04-15 15:38:27 -0700
commit2ce6ee8e5cd817a4018ad26eb1e364198c1dd931 (patch)
treef1f1d447c8dc76060a07ed594691dbacd7658425 /httemplate
parent33013bb1ef0b5f07105fe13f5bfc06350fc4d868 (diff)
add cust_class-tax_exempt conf setting to control the tax exemption flag per customer class rather than per indivual customer, RT#16818
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/edit/cust_class.html23
-rw-r--r--httemplate/edit/cust_main/billing.html14
-rw-r--r--httemplate/edit/elements/class_Common.html4
-rw-r--r--httemplate/edit/pkg_class.html2
-rw-r--r--httemplate/view/cust_main/billing.html20
5 files changed, 47 insertions, 16 deletions
diff --git a/httemplate/edit/cust_class.html b/httemplate/edit/cust_class.html
index fdb58e6..8fce905 100644
--- a/httemplate/edit/cust_class.html
+++ b/httemplate/edit/cust_class.html
@@ -1,5 +1,24 @@
<% include( 'elements/class_Common.html',
- 'name' => 'Customer Class',
- 'table' => 'cust_class',
+ 'name' => 'Customer Class',
+ 'table' => 'cust_class',
+ 'addl_fields' => \@addl_fields,
+ 'addl_labels' => { 'tax' => 'Tax Exempt' },
)
%>
+<%init>
+
+my $conf = new FS::Conf;
+
+my @addl_fields = ();
+if ( $conf->exists('cust_class-tax_exempt') ) {
+ push @addl_fields, { 'field' => 'tax',
+ 'type' => 'checkbox',
+ 'value' => 'Y',
+ };
+} else {
+ push @addl_fields, { 'field' => 'tax',
+ 'type' => 'hidden',
+ };
+}
+
+</%init>
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html
index 18c7ae9..9f4cb74 100644
--- a/httemplate/edit/cust_main/billing.html
+++ b/httemplate/edit/cust_main/billing.html
@@ -437,9 +437,17 @@
% my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups');
- <TR>
- <TD WIDTH="608" COLSPAN="2"><INPUT TYPE="checkbox" NAME="tax" VALUE="Y" <% $cust_main->tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt<% @exempt_groups ? ' (all taxes)' : '' %></TD>
- </TR>
+% if ( $conf->exists('cust_class-tax_exempt') ) {
+
+ <INPUT TYPE="hidden" NAME="tax" VALUE="<% $cust_main->tax eq 'Y' ? 'Y' : '' %>">
+
+% } else {
+
+ <TR>
+ <TD WIDTH="608" COLSPAN="2"><INPUT TYPE="checkbox" NAME="tax" VALUE="Y" <% $cust_main->tax eq "Y" ? 'CHECKED' : '' %>> Tax Exempt<% @exempt_groups ? ' (all taxes)' : '' %></TD>
+ </TR>
+
+% }
% foreach my $exempt_group ( @exempt_groups ) {
% #escape $exempt_group for NAME
diff --git a/httemplate/edit/elements/class_Common.html b/httemplate/edit/elements/class_Common.html
index 69da4db..a0025b3 100644
--- a/httemplate/edit/elements/class_Common.html
+++ b/httemplate/edit/elements/class_Common.html
@@ -34,9 +34,9 @@ my $fields = [ 'classname',
),
{ field=>'disabled', type=>'checkbox', value=>'Y', },
];
-push @$fields, $opt{'addl_fields'} if $opt{'addl_fields'};
+push @$fields, @{ $opt{'addl_fields'} } if $opt{'addl_fields'};
my %addl_labels = ();
-%addl_labels = %{$opt{'addl_labels'}} if $opt{'addl_labels'};
+%addl_labels = %{ $opt{'addl_labels'} } if $opt{'addl_labels'};
</%init>
diff --git a/httemplate/edit/pkg_class.html b/httemplate/edit/pkg_class.html
index 1bc100e..c4e3d8a 100644
--- a/httemplate/edit/pkg_class.html
+++ b/httemplate/edit/pkg_class.html
@@ -10,7 +10,7 @@ my $conf = new FS::Conf;
my %opt = ();
if($conf->exists('cust_main-require_censustract')) {
- $opt{'addl_fields'} = qw( fcc_ds0s );
+ $opt{'addl_fields'} = [ 'fcc_ds0s' ];
$opt{'addl_labels'} = { 'fcc_ds0s' => 'FCC form 477 voice-grade equivalents' };
}
</%init>
diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html
index 522c6db..4d55f70 100644
--- a/httemplate/view/cust_main/billing.html
+++ b/httemplate/view/cust_main/billing.html
@@ -189,15 +189,19 @@
% my $no = emt('no');
% my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups');
-<TR>
- <TD ALIGN="right"><% mt('Tax exempt') |h %><% @exempt_groups ? ' ('.emt('all taxes').')' : '' %></TD>
- <TD BGCOLOR="#ffffff"><% $cust_main->tax ? $yes : $no %></TD>
-</TR>
+
+% unless ( $conf->exists('cust_class-tax_exempt') ) {
+ <TR>
+ <TD ALIGN="right"><% mt('Tax exempt') |h %><% @exempt_groups ? ' ('.emt('all taxes').')' : '' %></TD>
+ <TD BGCOLOR="#ffffff"><% $cust_main->tax ? $yes : $no %></TD>
+ </TR>
+% }
+
% foreach my $exempt_group ( @exempt_groups ) {
-<TR>
- <TD ALIGN="right"><% mt('Tax exempt') |h %> (<% $exempt_group %> taxes)</TD>
- <TD BGCOLOR="#ffffff"><% $cust_main->tax_exemption($exempt_group) ? $yes : $no %></TD>
-</TR>
+ <TR>
+ <TD ALIGN="right"><% mt('Tax exempt') |h %> (<% $exempt_group %> taxes)</TD>
+ <TD BGCOLOR="#ffffff"><% $cust_main->tax_exemption($exempt_group) ? $yes : $no %></TD>
+ </TR>
% }
% if ( $conf->exists('enable_taxproducts') ) {