summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorivan <ivan>2005-10-07 02:25:41 +0000
committerivan <ivan>2005-10-07 02:25:41 +0000
commit7a97ed31c38e975c6548083039ff2ce31c6d8cf3 (patch)
treea18baccd2db1d7fbe297529c475fd4c39ff88126 /httemplate/edit
parente65217c9d44ce759a397f3948c2f19ceb16f8931 (diff)
add require_taxclasses config flag
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/process/quick-charge.cgi27
1 files changed, 18 insertions, 9 deletions
diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi
index 477f58508..9d9aa980a 100644
--- a/httemplate/edit/process/quick-charge.cgi
+++ b/httemplate/edit/process/quick-charge.cgi
@@ -9,15 +9,24 @@ $cgi->param('amount') =~ /^\s*(\d+(\.\d{1,2})?)\s*$/
or die 'illegal amount '. $cgi->param('amount');
my $amount = $1;
-my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
- or die "unknown custnum $custnum";
-
-my $error = $cust_main->charge(
- $amount,
- $cgi->param('pkg'),
- '$'. sprintf("%.2f",$amount),
- $cgi->param('taxclass')
-);
+my( $error, $cust_main);
+if ( $cgi->param('taxclass') eq '(select)' ) {
+
+
+ $error = "Must select a tax class";
+} else {
+
+ my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
+ or die "unknown custnum $custnum";
+
+ $error = $cust_main->charge(
+ $amount,
+ $cgi->param('pkg'),
+ '$'. sprintf("%.2f",$amount),
+ $cgi->param('taxclass')
+ );
+
+}
if ($error) {
%>