3 % my $param = $cgi->Vars;
5 % my @description = ();
6 % for ( my $row = 0; exists($param->{"description$row"}); $row++ ) {
7 % push @description, $param->{"description$row"}
8 % if ($param->{"description$row"} =~ /\S/);
11 % $param->{"custnum"} =~ /^(\d+)$/
12 % or $error .= "Illegal customer number " . $param->{"custnum"} . " ";
15 % $param->{"amount"} =~ /^\s*(\d+(\.\d{1,2})?)\s*$/
16 % or $error .= "Illegal amount " . $param->{"amount"} . " ";
19 % if ( $param->{'taxclass'} eq '(select)' ) {
20 % $error .= "Must select a tax class. ";
24 % my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
25 % or $error .= "Unknown customer number $custnum. ";
27 % $error ||= $cust_main->charge({ 'amount' => $amount,
28 % 'pkg' => $cgi->param('pkg'),
29 % 'taxclass' => $cgi->param('taxclass'),
30 % 'additional' => \@description,
37 % $cgi->param('error', "$error" );
39 <% $cgi->redirect($p.'quick-charge.html?'. $cgi->query_string) %>
42 <% header("One-time charge added") %>
43 <SCRIPT TYPE="text/javascript">
44 window.top.location.reload();