diff options
author | cvs2git <cvs2git> | 2008-03-16 19:58:34 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 2008-03-16 19:58:34 +0000 |
commit | eb061f5119325e666f0dff40d4089e5c1df58e17 (patch) | |
tree | d55e8fef5aca62eb13bbc8ad20dbdf941c3bd266 /httemplate/edit/process/quick-charge.cgi | |
parent | 3a17b276638200475d54201fa62566b7440e819a (diff) |
This commit was manufactured by cvs2svn to create tag 'TRIXBOX_2_6'.TRIXBOX_2_6
Diffstat (limited to 'httemplate/edit/process/quick-charge.cgi')
-rw-r--r-- | httemplate/edit/process/quick-charge.cgi | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi deleted file mode 100644 index 22f96852f..000000000 --- a/httemplate/edit/process/quick-charge.cgi +++ /dev/null @@ -1,50 +0,0 @@ -% if ( $error ) { -% $cgi->param('error', $error ); -<% $cgi->redirect($p.'quick-charge.html?'. $cgi->query_string) %> -% } else { -<% header("One-time charge added") %> - <SCRIPT TYPE="text/javascript"> - window.top.location.reload(); - </SCRIPT> - </BODY></HTML> -% } -<%init> - -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('One-time charge'); - -my $error = ''; -my $param = $cgi->Vars; - -my @description = (); -for ( my $row = 0; exists($param->{"description$row"}); $row++ ) { - push @description, $param->{"description$row"} - if ($param->{"description$row"} =~ /\S/); -} - -$param->{"custnum"} =~ /^(\d+)$/ - or $error .= "Illegal customer number " . $param->{"custnum"} . " "; -my $custnum = $1; - -$param->{"amount"} =~ /^\s*(\d+(\.\d{1,2})?)\s*$/ - or $error .= "Illegal amount " . $param->{"amount"} . " "; -my $amount = $1; - -if ( $param->{'taxclass'} eq '(select)' ) { - $error .= "Must select a tax class. "; -} - -unless ( $error ) { - my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ) - or $error .= "Unknown customer number $custnum. "; - - $error ||= $cust_main->charge( { - 'amount' => $amount, - 'pkg' => scalar($cgi->param('pkg')), - 'taxclass' => scalar($cgi->param('taxclass')), - 'classnum' => scalar($cgi->param('classnum')), - 'additional' => \@description, - } ); -} - -</%init> |