summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/quick-charge.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit/process/quick-charge.cgi')
-rw-r--r--httemplate/edit/process/quick-charge.cgi13
1 files changed, 12 insertions, 1 deletions
diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi
index 4c4927f4d..839a4e911 100644
--- a/httemplate/edit/process/quick-charge.cgi
+++ b/httemplate/edit/process/quick-charge.cgi
@@ -14,6 +14,7 @@ die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('One-time charge');
my $error = '';
+my $conf = new FS::conf;
my $param = $cgi->Vars;
my @description = ();
@@ -35,8 +36,16 @@ if ( $cgi->param('quantity') =~ /^\s*(\d+)\s*$/ ) {
$quantity = $1;
}
+$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. ";
+ $error .= "Must select a tax class. "
+ unless ($conf->exists('enable_taxproducts') &&
+ ( $override || $param->{taxproductnum} )
+ );
+ $cgi->param('taxclass', '');
}
unless ( $error ) {
@@ -48,6 +57,8 @@ unless ( $error ) {
'quantity' => $quantity,
'pkg' => scalar($cgi->param('pkg')),
'taxclass' => scalar($cgi->param('taxclass')),
+ 'taxproductnum' => scalar($cgi->param('taxproductnum')),
+ 'tax_override' => $override,
'classnum' => scalar($cgi->param('classnum')),
'additional' => \@description,
} );