summaryrefslogtreecommitdiff
path: root/httemplate/edit/cust_main
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-05-08 15:34:37 -0700
committerIvan Kohler <ivan@freeside.biz>2012-05-08 15:34:37 -0700
commitfaadb1bcccbbdfee91afffded23dfebb89ebafe0 (patch)
tree357322b1fc04d0949f67e41d8a5d50d446a137f3 /httemplate/edit/cust_main
parentb5aceddf3c5720330e1027d46fea36f4ab06b55a (diff)
separate tax exemption numbers for individual exemptions w/tax-cust_exempt-groups, RT#17658
Diffstat (limited to 'httemplate/edit/cust_main')
-rw-r--r--httemplate/edit/cust_main/billing.html30
1 files changed, 25 insertions, 5 deletions
diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html
index ddc6cc2a7..f280e3a68 100644
--- a/httemplate/edit/cust_main/billing.html
+++ b/httemplate/edit/cust_main/billing.html
@@ -117,6 +117,15 @@
//why? select.selectedIndex = 0;
}
}
+
+ function tax_changed(what) {
+ var num = document.getElementById(what.id + '_num');
+ if ( what.checked ) {
+ num.disabled = false;
+ } else {
+ num.disabled = true;
+ }
+ }
</SCRIPT>
@@ -437,14 +446,25 @@
% 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('tax-cust_exempt-groups-require_individual_nums') ) {
+
+ <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
+% my $cust_main_exemption = $cust_main->tax_exemption($exempt_group);
+% #escape $exempt_group for NAME etc.
+% my $checked = ($cust_main_exemption || $cgi->param("tax_$exempt_group"));
<TR>
- <TD WIDTH="608" COLSPAN="2">&nbsp;&nbsp;<INPUT TYPE="checkbox" NAME="tax_<% $exempt_group %>" VALUE="Y" <% $cust_main->tax_exemption($exempt_group) ? 'CHECKED' : '' %>> Tax Exempt (<% $exempt_group %> taxes)<TD>
+ <TD>&nbsp;&nbsp;<INPUT TYPE="checkbox" NAME="tax_<% $exempt_group %>" ID="tax_<% $exempt_group %>" VALUE="Y" <% $checked ? 'CHECKED' : '' %> onChange="tax_changed(this)"> Tax Exempt (<% $exempt_group %> taxes)</TD>
+ <TD> - Exemption number <INPUT TYPE="text" NAME="tax_<% $exempt_group %>_num" ID="tax_<% $exempt_group %>_num" VALUE="<% $cgi->param("tax_$exempt_group".'_num') || ( $cust_main_exemption ? $cust_main_exemption->exempt_number : '' ) |h %>" <% $checked ? '' : 'DISABLED' %>></TD>
</TR>
% }