diff options
Diffstat (limited to 'htdocs/misc/bill.cgi')
-rwxr-xr-x | htdocs/misc/bill.cgi | 48 |
1 files changed, 15 insertions, 33 deletions
diff --git a/htdocs/misc/bill.cgi b/htdocs/misc/bill.cgi index d41f6d1c9..76f160289 100755 --- a/htdocs/misc/bill.cgi +++ b/htdocs/misc/bill.cgi @@ -1,36 +1,40 @@ #!/usr/bin/perl -Tw # +# $Id: bill.cgi,v 1.2 1998-12-17 09:12:41 ivan Exp $ +# # s/FS:Search/FS::Record/ and cgisuidsetup($cgi) ivan@sisd.com 98-mar-13 # # Changes to allow page to work at a relative position in server # bmccane@maxbaud.net 98-apr-3 +# +# $Log: bill.cgi,v $ +# Revision 1.2 1998-12-17 09:12:41 ivan +# s/CGI::(Request|Base)/CGI.pm/; +# use strict; -use CGI::Base qw(:DEFAULT :CGI); +use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); +use FS::CGI qw(popurl eidiot); use FS::Record qw(qsearchs); -use FS::Bill; +use FS::cust_main; -my($cgi) = new CGI::Base; -$cgi->get; +my($cgi) = new CGI; &cgisuidsetup($cgi); #untaint custnum -$QUERY_STRING =~ /^(\d*)$/; +$cgi->query_string =~ /^(\d*)$/; my($custnum)=$1; my($cust_main)=qsearchs('cust_main',{'custnum'=>$custnum}); die "Can't find customer!\n" unless $cust_main; -# ? -bless($cust_main,"FS::Bill"); - my($error); $error = $cust_main->bill( # 'time'=>$time ); -&idiot($error) if $error; +&eidiot($error) if $error; $error = $cust_main->collect( # 'invoice-time'=>$time, @@ -38,29 +42,7 @@ $error = $cust_main->collect( 'batch_card'=> 'no', 'report_badcard'=> 'yes', ); -&idiot($error) if $error; - -$cgi->redirect("../view/cust_main.cgi?$custnum#history"); - -sub idiot { - my($error)=@_; - CGI::Base::SendHeaders(); # one guess - print <<END; -<HTML> - <HEAD> - <TITLE>Error billing customer</TITLE> - </HEAD> - <BODY> - <CENTER> - <H4>Error billing customer</H4> - </CENTER> - Your update did not occur because of the following error: - <P><B>$error</B> - </BODY> -</HTML> -END - - exit; +&eidiot($error) if $error; -} +print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum#history"); |