diff options
author | Alex Brelsfoard <alex@freeside.biz> | 2015-01-31 23:20:19 -0500 |
---|---|---|
committer | Alex Brelsfoard <alex@freeside.biz> | 2015-01-31 23:20:19 -0500 |
commit | 1ed6875a411a829607836f514b9aa0bb96620181 (patch) | |
tree | 744a8dc4535d21a23f6ac8d6d313e3c92fe070bd /httemplate/edit | |
parent | a93e9be94c3a385e6b810457c0e06c889e6a6000 (diff) |
RT #31482 you can now change the tax class when modifying a one-time charge.
Diffstat (limited to 'httemplate/edit')
-rw-r--r-- | httemplate/edit/process/quick-charge.cgi | 16 | ||||
-rw-r--r-- | httemplate/edit/quick-charge.html | 9 |
2 files changed, 25 insertions, 0 deletions
diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi index c130a550f..aa6010ef9 100644 --- a/httemplate/edit/process/quick-charge.cgi +++ b/httemplate/edit/process/quick-charge.cgi @@ -67,6 +67,18 @@ if ( $param->{'pkgnum'} =~ /^(\d+)$/ ) { #modifying an existing one-time charge my $start_date = $cgi->param('start_date') ? parse_datetime($cgi->param('start_date')) : time; + + $param->{'tax_override'} =~ /^\s*([,\d]*)\s*$/ + or $error .= "Illegal tax override " . $param->{"tax_override"} . " "; + my $override = $1; + + if ( $param->{'taxclass'} eq '(select)' ) { + $error .= "Must select a tax class. " + unless ($conf->exists('enable_taxproducts') && + ( $override || $param->{taxproductnum} ) + ); + $cgi->param('taxclass', ''); + } $error = $cust_pkg->modify_charge( 'pkg' => scalar($cgi->param('pkg')), @@ -75,6 +87,10 @@ if ( $param->{'pkgnum'} =~ /^(\d+)$/ ) { #modifying an existing one-time charge 'adjust_commission' => ($cgi->param('adjust_commission') ? 1 : 0), 'amount' => $amount, 'setup_cost' => $setup_cost, + 'setuptax' => scalar($cgi->param('setuptax')), + 'taxclass' => scalar($cgi->param('taxclass')), + 'taxproductnum' => scalar($cgi->param('taxproductnum')), + 'tax_override' => $override, 'quantity' => $quantity, 'start_date' => $start_date, ); diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index dfaf404fa..20a9ec783 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -171,6 +171,15 @@ function bill_now_changed (what) { &> % } +<TR> + <TD ALIGN="right"><% mt('Tax exempt') |h %> </TD> + <TD><INPUT TYPE="checkbox" NAME="setuptax" VALUE="Y" <% $cgi->param('setuptax') ? 'CHECKED' : '' %>></TD> +</TR> + +<& /elements/tr-select-taxclass.html, 'curr_value' => $part_pkg->get('taxclass') &> + +<& /elements/tr-select-taxproduct.html, 'label' => emt('Tax product'), 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $part_pkg->get('taxproductnum') &> + % } else { # new one-time charge <TR> |