diff options
author | ivan <ivan> | 2005-10-07 02:25:41 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-10-07 02:25:41 +0000 |
commit | 7a97ed31c38e975c6548083039ff2ce31c6d8cf3 (patch) | |
tree | a18baccd2db1d7fbe297529c475fd4c39ff88126 /httemplate/edit | |
parent | e65217c9d44ce759a397f3948c2f19ceb16f8931 (diff) |
add require_taxclasses config flag
Diffstat (limited to 'httemplate/edit')
-rw-r--r-- | httemplate/edit/process/quick-charge.cgi | 27 |
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) { %> |