[freeside-commits] freeside/httemplate/edit/process quick-charge.cgi, 1.14, 1.15

Jeff Finucane,420,, jeff at wavetail.420.am
Thu Aug 28 14:32:25 PDT 2008


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv22114/httemplate/edit/process

Modified Files:
	quick-charge.cgi 
Log Message:
taxproduct selection for one time charges

Index: quick-charge.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/quick-charge.cgi,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- quick-charge.cgi	5 Jun 2008 19:24:33 -0000	1.14
+++ quick-charge.cgi	28 Aug 2008 21:32:22 -0000	1.15
@@ -14,6 +14,7 @@
   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 @@
   $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 @@
     '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,
   } );



More information about the freeside-commits mailing list